{"slug": "your-coding-agent-can-read-git-log-it-can-t-read-the-four-things-you-tried-that", "title": "Your coding agent can read git log. It can't read the four things you tried that didn't work.", "summary": "A developer has built NexusMem, a local-first memory engine for AI coding agents that indexes git history, shell commands, project docs, and assistant transcripts into a SQLite database, serving ranked context over MCP or CLI. The tool uses BM25 and vector search fused with Reciprocal Rank Fusion, and the developer found that shared priors were needed to avoid ranking errors, cutting API token spend by about 40% in practice. The project is open source on GitHub.", "body_md": "I've been building [NexusMem](https://github.com/yaminbakoh4-dot/NexusMem) mostly alone, in long\n\nstretches, for a few weeks. It's a local-first memory engine for AI coding agents: it indexes your\n\ngit history, shell commands (with exit codes), project docs, and optionally your assistant\n\ntranscripts into a SQLite database on disk, then serves back a ranked, token-budgeted slice of it\n\nover MCP or a CLI. No account, no cloud, no telemetry.\n\nThe pitch, in one line: your agent can already read `git log`\n\n. It cannot read the four things you\n\ntried last Tuesday that didn't work — and that's the part actually worth remembering.\n\nThis week two strangers showed up and started fixing things I didn't ask them to fix. That felt\n\nlike a good excuse to write about what it does and why.\n\nCoding agents get context from two places: what you paste in, and what they can grep. Neither one\n\nremembers *process*. Git tells an agent what shipped. It has nothing to say about the three\n\napproaches you tried before the one that worked, or which shell commands exited non-zero while you\n\nwere debugging it. That information exists for maybe a day, in your terminal scrollback, and then\n\nit's gone.\n\nNexusMem's answer is boring on purpose: read what already exists on disk (git log, shell history,\n\nmarkdown docs), normalize it into one node shape, index it, and rank it well enough that a query\n\nreturns the right five things instead of the right fifty.\n\nThe retrieval side is BM25 over SQLite FTS5, plus a vector pass over `sqlite-vec`\n\nif an embedding\n\nmodel is reachable, fused with Reciprocal Rank Fusion. RRF fuses on rank position only, never raw\n\nscores — that's the whole point of using it, since a BM25 cost and a vector distance live on\n\nunrelated scales and position is the only thing they agree on.\n\nOn top of the fused rank, two priors adjust the score: `signal`\n\n(a `fix:`\n\ncommit outranks a\n\n`chore:`\n\n; a shell command that exited non-zero outranks one that succeeded) and `recency`\n\n. Both are\n\nreal signal. Both also almost broke the whole thing.\n\nDogfooding the tool on its own repo, a query about a PowerShell hook returned two unrelated\n\nsame-day `fix:`\n\ncommits at ranks 3 and 4, while the commit that actually answered the query sat at\n\nrank 6. The priors were capped individually — each could overturn at most a 2× relevance gap — but\n\nthe score *multiplies* them together, so a fresh, high-signal commit (which describes most of an\n\nactive working day) could overturn 4×. The fix wasn't a bigger cap, it was a shared one: priors now\n\nsplit one budget across both of them, derived so each is worth exactly `√2`\n\n, not asserted by feel.\n\nI only found this because I kept running real queries against the tool's own commit history and\n\nreading the output critically instead of trusting the ranking math on paper. That's most of what\n\nbuilding this has actually been: dogfood, find the case where it's confidently wrong, write a test\n\nthat fails before the fix and passes after.\n\nThe README has a \"Where it breaks\" section and I've tried to keep it truthful rather than\n\nreassuring. A few examples:\n\n`sync`\n\nfrom.There's also a number I was tempted to lead with and didn't: the original target was cutting API\n\ntoken spend by more than 70% versus sending full context. Measured end-to-end on this repo, it's\n\ncloser to 40%. The >70% figure describes what the packing math shows against its own candidate set,\n\nwhich is a real number but a different, rosier question than \"how much less did the agent actually\n\nread.\" The README says this outright instead of quietly reporting the friendlier number.\n\nI built this solo, iterating in long sessions, for weeks. This week, for the first time, someone I\n\ndon't know opened an issue asking to add end-to-end stdio transport coverage for the MCP server —\n\nthe existing tests only exercised an in-memory transport, which can't prove protocol framing\n\nsurvives a real process boundary. They described their approach in a comment first, then shipped a\n\n[PR](https://github.com/yaminbakoh4-dot/NexusMem/pull/9) that spawns the actual built CLI as a\n\nchild process and asserts every line written to stdout parses as JSON-RPC. CI caught a real\n\nWindows-only bug in their first pass (a `.cmd`\n\nshim needs `shell: true`\n\nto spawn on Windows) — they\n\nfixed it within the hour and it merged clean.\n\nA second person forked the repo the same day and, without opening an issue first, found something I\n\nhadn't: the PowerShell hook always inserted its block with `\\n`\n\nline endings, but a profile written\n\nby a Windows editor is CRLF by convention, so installing the hook silently turned a CRLF file into a\n\nmixed-ending one — and removing it later left a stray bare newline behind. That's a subtle enough\n\nbug that finding it means actually reading the code, not skimming it.\n\nNeither of those things needed me. That's the part worth sitting with — the project became legible\n\nenough, on its own, for someone else to extend it correctly on the first try.\n\n```\nnpx nexusmem init\nnpx nexusmem sync\nnexusmem query \"windows spawn failure\"\n```\n\nRequirements are just Node 22+ and git. Ollama is optional and only affects semantic search — BM25\n\nworks fully without it.\n\n[Repo's here](https://github.com/yaminbakoh4-dot/NexusMem) if you want to poke at it, and there's\n\nnow a [CONTRIBUTING.md](https://github.com/yaminbakoh4-dot/NexusMem/blob/master/CONTRIBUTING.md)\n\nif you find something worth fixing.", "url": "https://wpnews.pro/news/your-coding-agent-can-read-git-log-it-can-t-read-the-four-things-you-tried-that", "canonical_source": "https://dev.to/yaminbakoh4/your-coding-agent-can-read-git-log-it-cant-read-the-four-things-you-tried-that-didnt-work-1bkm", "published_at": "2026-08-14 16:12:29+00:00", "updated_at": "2026-08-14 16:35:18.651887+00:00", "lang": "en", "topics": ["developer-tools", "ai-agents", "machine-learning", "natural-language-processing"], "entities": ["NexusMem", "SQLite", "MCP", "BM25", "sqlite-vec", "Reciprocal Rank Fusion"], "alternates": {"html": "https://wpnews.pro/news/your-coding-agent-can-read-git-log-it-can-t-read-the-four-things-you-tried-that", "markdown": "https://wpnews.pro/news/your-coding-agent-can-read-git-log-it-can-t-read-the-four-things-you-tried-that.md", "text": "https://wpnews.pro/news/your-coding-agent-can-read-git-log-it-can-t-read-the-four-things-you-tried-that.txt", "jsonld": "https://wpnews.pro/news/your-coding-agent-can-read-git-log-it-can-t-read-the-four-things-you-tried-that.jsonld"}}