cd /news/developer-tools/how-to-give-your-ai-coding-agent-inf… Β· home β€Ί topics β€Ί developer-tools β€Ί article
[ARTICLE Β· art-122402] src=dev.to β†— pub= topic=developer-tools verified=true sentiment=Β· neutral

How to Give Your AI Coding Agent Infinite Memory

A developer has created an open-source system that gives AI coding agents persistent memory by indexing past conversation transcripts locally. The setup uses a FastMCP server connected to an SQLite FTS5 database, allowing agents to query historical decisions in under 10 milliseconds with minimal token overhead. The implementation, designed for Google Antigravity, filters raw transcripts to preserve key reasoning and decisions, enabling agents to retrieve exact past trade-offs on demand.

read2 min views1 publishedSep 7, 2026

AI coding agents are stateless. Once a session closes, the context window resets, and the agent forgets every architectural trade-off, rejected alternative, and subtle debugging edge case you worked through.

Cramming 100k-token transcripts into prompt context causes latency spikes, attention dilution, and cost bloat. Naive automated summaries strip away the exact chronological rationale and specific trade-offs you actually need.

Don't stuff context. Index your past trajectories locally and let the agent query them on demand.

Think of it as giving your agent an active retrieval reflex instead of asking it to carry its entire life history in working memory. By connecting a lightweight FastMCP server to an embedded SQLite FTS5 database, the agent can search its own historical conversations in sub-10ms and pull exact past decisions using fewer than 120 tokens.

~/.gemini/antigravity/brain/
            β”‚
  [<session-id>/transcript.jsonl]
            β”‚
            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Incremental MTime Parser              β”‚
β”‚ (Filters noise, diffs & shell stdout) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SQLite + FTS5 BM25 Engine             β”‚
β”‚ (conversations.db β€” local keyword FTS)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ FastMCP Server (stdio transport)      β”‚
β”‚ (Exposes search tools to the agent)   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β–Ό
          [ Antigravity Agent ]

In Google Antigravity, place the server in your global configuration (~/.gemini/config/mcp_config.json), rather than the scoped workspace config (.agents/mcp_config.json).

Raw agent transcripts (transcript.jsonl) contain megabytes of raw terminal output, file overwrite diffs, and status pings. Blindly indexing this breaks BM25 search relevance.

The ingestion parser applies three strict filters:

USER_INPUT (steering/prompts) and PLANNER_RESPONSE (reasoning/decisions). Discards binary payloads, file scrapes, and transient tool poll steps.stdout outputs. Indexes only the tool name and target file reference (e.g., write_to_file: target.py). MAX_CONTENT_CHARS = 10_000) on individual messages to prevent catastrophic index bloat. Store records in a local SQLite virtual table using FTS5, Porter stemming, and Unicode-61 tokenization. An mtime cache tracks file modification timestamps so incremental re-indexing across dozens of sessions takes less than 20 milliseconds.

The FastMCP server exposes two primary tools over stdio:

search_antigravity_conversations(query="..."): Returns BM25-ranked matches with conversation IDs, timestamps, and highlighted snippets.get_antigravity_step(conversation_id, step_index): Pulls the surrounding dialogue window for full contextual fidelity. When the agent hits friction, needs historical context, or conducts a post-mortem on earlier decisions, it calls the MCP tool directly:

search_antigravity_conversations(query="Observer Stance negative assertions")

Instead of guessing or re-reading giant raw files, SQLite returns the exact turn where the decision was made:

[Match 1 | Session: 8f2a-e1... | Date: 2026-09-02 14:18]
Role: PLANNER_RESPONSE
Snippet: "...decided to cut redundant negative assertions from Chapter 1. 
The observer stance works best when physical actions imply boundaries 
rather than explicitly stating what didn't happen..."

The complete implementation is open source on GitHub:

Stop starting from scratch every time you open a terminal. Let your agent inspect the tape.

── more in #developer-tools 4 stories Β· sorted by recency
── more on @google antigravity 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/how-to-give-your-ai-…] indexed:0 read:2min 2026-09-07 Β· β€”