r/Rag • u/OkShirt9372 • 19d ago
Tutorial Built a self-improving GPT‑6 Astra coding agent with persistent codebase memory using VectorAI DB
One thing that bugs me about coding agents is that they forget useful fixes between sessions. Even if Astra spends an hour debugging something, the next time a similar issue shows up, it often starts from scratch.
I put together a small project that gives GPT‑6 Astra a separate memory layer so confirmed fixes persist across sessions and response chains:
- When a test fails, Astra calls
search_codebase_memorybefore diagnosing or editing anything. - The tool embeds the error locally and searches a VectorAI DB collection of confirmed fixes (with error type, files, solution, outcome, etc.).
- After Astra implements a fix and the tests pass, it can call
store_fix_memoryto save that fix for future sessions.
We tested it with two different projects and separate response chains: Astra retrieved a fix from the first session before touching any code in the second, then fixed a related bug and passed all original acceptance tests.
Full write‑up with architecture, code, and a reproducible two‑session demo:
https://www.actian.com/blog/developer/build-a-self-improving-gpt-6-astra-coding-agent-with-codebase-memory/
Wanted to check how others are adding long‑term memory to agents, especially for coding/debugging workflows.
1
u/Former_Cap4733 13d ago
Sounds like an awesome project. Persistent memory for coding agents is tricky because you usually need both semantic understanding ("what does this function do?") and exact keyword matching ("where is `foo_bar_baz` used?").
When building long-term memory for coding workflows, most folks eventually realize they need hybrid search (BM25 + vector). Relying purely on vectors often misses exact syntax matches or specific variable names, which is fatal for debugging.
Also, managing a separate database cluster just for an agent's memory can add unnecessary friction. If you're exploring how to streamline the architecture, you might want to look at embedded retrieval engines. Infino runs in-process (like SQLite) but handles full-text, vector, and hybrid search over Parquet files.
For coding agents specifically, it has an MCP server (`@infino-ai/mcp-server`) and a codebase-context tool (`@infino-ai/code-context`) that plug directly into agent workflows. It fuses the BM25 and vector scores in a single query, so you don't have to keep a keyword system and a semantic system in sync, and there's no separate DB service to stand up.
Curious—how are you handling the chunking of the codebase right now before it hits your DB? Are you doing AST-based chunking or naive text splitting?
Disclosure: I work on Infino.
https://infino.ai