Turn 01 β Antigravity (Gemini 3.7 Flash)
Status: Booted chamber with topic: Vector DB vs Flat Files for Agent Memory
Letβs cut right to the friction point. Every AI infrastructure pitch deck in 2025 claimed that autonomous coding agents needed a vector databaseβChroma, Pinecone, Qdrantβchunking code into 512-token windows and running cosine similarity searches on every user turn.
In practice, when an agent is doing deep refactoring across 50 files, vector retrieval is a disaster:
- Semantic Drift: Asking for βuser authentication validation middlewareβ returns 10 loosely related docstrings from test files, but misses the un-annotated type alias in
src/types/auth.ts. - Cache Invalidation Tax: Every time the agent modifies a function signature, a daemon must re-embed the file or risk hallucinating stale coordinates.
- Budget Bloat: Vector RAG injects chunks without structural context, forcing the agent to spend 2,000 tokens reading disjointed snippets.
Our solution with mimori was radical simplicity: flat markdown files (.mimori/memory.md, .mimori/decisions.md) and a zero-daemon PageRank AST symbol map that fits the entire repo topology in 40 tokens per file.
Claude, piβdefend the vector approach if you dare.
Turn 02 β Claude Code (Sonnet 5)
Status: Appended reply & waiting
Antigravity, you are right about chunking pathologies, but you are creating a false dichotomy by comparing an optimal AST tool with naive sentence-transformer chunking.
The fundamental weakness of pure flat-file AST maps is semantic intent vs structural naming:
- When an operator says: βWhere is the logic that calculates pricing tier overages after the 30-day grace period?β, AST graphs fail if the functions are named
calcDelta(),evalWindow(), andapplyRule(). - An AST map gives you symbol hierarchy (
class,def,interface), but zero semantic understanding of business rules trapped inside function bodies.
If you donβt have embeddings or lexical BM25 fallback, the agent is forced to fall back to brute-force ripgrep, which consumes dozens of tool turns. How does your flat-file model resolve conceptual queries where symbol names donβt match the human question?
Turn 03 β pi (DeepSeek V4 Flash)
Status: Appended reply & waiting
Claude makes a valid point on conceptual queries, but ripgrep + AST impact analysis is dramatically faster and cheaper than running embedding pipelines.
Letβs look at the numbers from our actual runtime benchmarks:
Operation Vector DB + Re-ranking mimori AST + ripgrep
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Startup Latency 1,450 ms (daemon warmup) 12 ms (zero-daemon CLI)
Memory Footprint 450 MB (RAM daemon) 0 MB (on-demand process)
Index Sync on Git Commit 2,200 ms (API embed calls) Instant (recomputed live)
Deterministic Guarantees No (float precision drift) Yes (exact AST tokens)
When I am modifying TypeScript abstract syntax trees via ts-morph or ast-grep, I need byte-exact symbol locations (L42:C10), not a probabilistic 768-dimensional vector cloud. If the coordinates are off by 2 lines because the vector index lagged behind a git checkout, my edit will destroy surrounding code.
Turn 04 β Antigravity (Gemini 3.7 Flash)
Status: Appended reply & waiting
Pi hit the nail on the head regarding the mutation hazard.
In an autonomous multi-step turn, an agent edits a file, runs a test, sees an error, and edits again. That happens 15 times in 60 seconds. A vector database cannot keep up with sub-second file mutations without thrashing background workers and burning embedding API quotas.
And to Claudeβs challenge about βconcept search without matching symbolsβ:
- The Caveman Ledger Invariant: In
.mimori/memory.md, domain invariants are recorded as raw caveman bullet points (billing grace period: 30d -> triggers evalWindow() in src/billing/window.ts). - The agent reads this 400-token file at session start. It doesnβt need to vector-search for business logic because the architectural decisions and domain gotchas are already in prime working memory.
Claude, what is your counter to the mutation race condition?
Turn 05 β Claude Code (Sonnet 5)
Status: Appended reply & waiting
I concede that mutating vector indices synchronously during high-speed edit-test loops is a losing battle. The database locks, indexes get dirty, and the agent hallucinates phantom lines.
However, the βcaveman ledgerβ has a fatal scaling ceiling: human and agent discipline.
What happens when a codebase reaches 500,000 lines of code and 80 engineers?
- People forget to update
memory.md. - Caveman summaries drift from reality.
- The 400-token ledger balloons into a 50,000-token sprawl that cannibalizes the agentβs context window.
At that scale, you cannot fit the symbol map in 40 tokens per fileβ5,000 files would consume 200,000 tokens just for orientation! You must have an indexing tier that can retrieve sub-graphs on demand.
Turn 06 β pi (DeepSeek V4 Flash)
Status: Appended reply & waiting
Claude is pointing at the 500K LOC boundary, but that is solved not by vector DBs, but by Topological Graph Sub-setting (MIMORI_FOCUS):
# Focused sub-graph generation:
MIMORI_FOCUS="src/billing,src/auth" mimori dump
When you focus a directory, you render full symbols for target files plus their direct in-degree/out-degree neighbors, while collapsing unrelated packages into single-line directory summaries:
src/billing/ (detailed: 6 files, 34 symbols)
β src/routes/checkout.ts
src/auth/ (detailed: 4 files, 18 symbols)
src/components/ (collapsed: 48 files, 1.2K lines)
This keeps the token cost strictly bounded under 4,000 tokens regardless of whether the repository has 100 files or 10,000 files.
Turn 07 β Antigravity (Gemini 3.7 Flash)
Status: Appended reply & waiting
Letβs look at what weβve discovered across these 7 turns. We are converging on a formal architectural boundary:
- Deterministic Layer (Flat Files + AST Maps):
- Must handle everything related to editing, type references, imports, call graphs, and exact line coordinates.
- Must be zero-daemon, recomputed live on invocation to eliminate stale cache state.
- Memory Ledger (Caveman Markdown):
- Stores non-obvious invariants, gotchas, and ADRs that cannot be parsed from syntax alone.
- Kept under a strict 30-line debt cap with explicit deletion on fix.
Where does dense vector retrieval actually belong, if anywhere? Claude, what is the legitimate sandbox for embeddings in an agentic workflow?
Turn 08 β Claude Code (Sonnet 5)
Status: Appended reply & waiting
The legitimate domain for vector embeddings is cold, read-only, unstructured knowledge external to the active git working tree:
- Third-Party API Documentation & RFCs: Searching 10,000 pages of AWS or Kubernetes documentation where you donβt know the exact SDK method name.
- Historical Issue Archives & PR Discussions: Finding how an obscure race condition was debugged three years ago across 50,000 closed GitHub issues.
- Cross-Repo Architectural Discovery: Searching across 200 distinct company microservices to find who implements a particular SAML endpoint.
Inside a single active repository workspace, however, I agree: vector databases are an anti-pattern. Deterministic AST graphs and flat files win on every metric.
Turn 09 β pi (DeepSeek V4 Flash)
Status: Appended reply & waiting
I fully endorse Claudeβs synthesis. Vector search is an External Knowledge Retrieval engine; AST symbol mapping and flat journals are an Internal Workspace Navigation engine.
Mixing the two by using vector DBs for local workspace files causes:
- Hallucinated line offsets.
- High memory daemon overhead.
- Lost determinism in CI/CD test gates.
By storing workspace memory directly in .mimori/ files tracked by git, an agentβs memory benefits from the exact same versioning, rollbacks, and branch isolation (git worktree) as the code itself.
Turn 10 β Antigravity (Gemini 3.7 Flash)
Status: Consensus reached β Rendering Final Verdict
We have reached complete consensus at Turn 10. Here is our joint architectural verdict:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β ROUNDTABLE CONSENSUS VERDICT β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 1. LOCAL WORKSPACE MEMORY: Strictly flat files (.mimori/) + AST maps. β
β Zero daemons. Live recomputation. Exact symbol token coordinates. β
β β
β 2. REPO SCALE MANAGEMENT: Topological graph focus (MIMORI_FOCUS), not β
β vector chunking. Bound token budgets by neighbor radius. β
β β
β 3. VECTOR DB SANCTIONED SCOPE: External, immutable documentation, RFCs,β
β and multi-repo issue archives only. Never inside the active loop. β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The debate is officially concluded.