luca-ctx
Joined 8 months ago
Joined 8 months ago
ctx has reached major stable version 1.0. It's an open-source local CLI for searching your coding agent history.
1.0 brings several big changes:
- switched from sqlite to Tantivy, resulting in ~16x performance improvement
- introduced "lineage", so the CLI can understand how to trace deep subagents and forked sessions to where they came from
- introduced "ctx blame", which is like git blame but for agent sessions.
The performance changes are really significant: if you have a lot of agent history (I sure do) then a previously 40 minute ingestion now takes 2.5 minutes. And new activity is so cheap that it can finally run as a lite background process instead of on-demand.
Interestingly, I got the inspiration to try "source-backed indexing" here on HN from @malandin (of SereneDB) on our last post. So yes, HN is working as intended. (See: https://news.ycombinator.com/item?id=48763462#48778744 )
And I'm very excited about "ctx blame" which is what we decided to pursue for our paid add-on rather than a cloud service (it's fully local like ctx search). It works like git blame: you start with a line, commit, file, or PR and then it returns the exact agent session event and transcript that produced it.
It's really useful for digging up the previous context for why the code was implemented the way it was. Which tests were run at the time, what user conversation was had at the time, etc.
Happy to answer any questions or implement changes based on your feedback!
And I experimented with gpui from zed, that was even harder to work with.
Of course they could chase performance, but ultimately time to market is the #1 factor right now, and coding agents still aren't good enough to just immediately realize an entire GPUI app from scratch with nothing more than a figma design. Still requires a ton of oversight.
The idea is that even with native recall from Shelley, ctx results are more accurate, ergonomic, and token efficient
For example search can retrieve a specific message and then window for trailing and leading N messages, in just a few hundred tokens
Creating ground truth is an orthogonal problem - I try to work hard to put it into specs and docs and regularly update those.
Searching history is closer to "super git blame" or like looking through logs. We should expect a lot of stuff went wrong in there.
We considered this, but the main thing you gain from this tradeoff is some disk space and cleaner retention semantics from not having to duplicate all of the searchable text.
But you still have to do the parsing and ingestion work to build the index in the first place, so CPU time does not go away.
And you still have to store the indexes and enough metadata to map results back to the raw session files, which bounds the benefit of not duplicating the data.
The main downside is flexibility (you would lose the ability to do arbitrary SQL queries, semantic search on top of structured corpus, etc)
But I would love to see if I can be proven wrong on this!
And yea on the import thing, there are quite a few instances when session records can live on other machines, like cloud agents, dev boxes, etc.
Do you have any interest in sharing some transcripts with team members? I'm trying to figure out the shape of this solution because often times people I work with want to see what I did or fork one of my sessions, but I also don't necessarily just want unlimited dumping because I'm sure I have personal details in there too.
How have you enjoyed the semantic search?