Why agent memory goes stale without ingest hooks
When a private codebase graph stops tracking your working tree, agents ground edits on yesterday. Lifecycle-coupled ingest keeps memory honest every session.
By Trellis

A coding agent that "knows" your codebase is only as honest as the memory it is reading. When that memory is a private graph or index built yesterday, and the working tree moved this morning, the agent does not feel confused — it feels sure. It searches, it grounds a call site, it opens a PR against a repository that no longer matches the map.
That is not a model failure first. It is a freshness failure. Agent memory goes stale the moment ingest stops tracking the same clock as the code you are about to change.
Two clocks, one agent
Most agent setups keep two answers to the question "what is in this repo?"

One answer is the working tree: the files on disk right now, the branch you checked out, the rename you just made. The agent edits that surface.
The other answer is the index or graph the agent uses to find things: embeddings, symbol tables, a knowledge graph of code, docs, PRs, and work items. That surface is built to be durable across sessions so every prompt does not re-parse the monorepo from scratch.
Those two surfaces refresh on different clocks. Industry write-ups of agent platforms describe the failure plainly: mirrors lag origin, durable embeddings outlive large refactors, a partial indexer leaves last week's commits out while retrieval still returns confident hits. The agent grounds search and function signatures on the durable view, then applies edits on the fresher tree. When the views diverge by a few commits — or a few weeks — you get phantom APIs, deleted helpers, and call sites that used to be right.
The dangerous part is the absence of a staleness signal. Search still returns results. The model still writes fluent code. Reviewers see a clean narrative. Staleness shows up late: a compile break, a runtime miss, or a stub the agent inserted to "make tests pass" against a map that no longer exists.
Indexed agents can be faster and cheaper on static look-ups. That only makes the coherence gap more expensive when the map is wrong: speed multiplies confident mistakes.

Why scheduled re-index is the wrong unit of work
Teams that notice the problem often invent a job: rebuild the index nightly, or run a full re-index after each release train, or remind everyone to click "Refresh" on Monday.
A scheduled full rebuild is better than never rebuilding. It is still the wrong unit of work for agent memory.
Agents do not consume the graph once per day. They hop: find a seed, expand callers, re-check after a patch, check again after the next file. Every hop assumes the map still matches the tree. A nightly job leaves the entire workday open for drift — and the busiest hours of change are exactly when the map is least trusted.
Manual re-index has a worse failure mode. It is opt-in hygiene. The person who forgot is the person who just asked the agent for a multi-file refactor. The graph looks authoritative; the authority is unearned.
Practitioner tooling in the wild has already moved past "run reindex when you remember." Self-updating graph setups wire refresh to events that already mark a boundary in the work — session end, commit, branch switch — and try to reprocess changed files rather than the whole tree. The product insight is not any one CLI flag. It is that freshness belongs to the same lifecycle as the work, not to a separate ops calendar.

Ingest as session hygiene, not a separate job
Trellis markets this as ingest while you work: lifecycle hooks keep the graph fresh every session so you are not babysitting a manual re-index. The how-it-works path is blunt — install, connect the agent, and the product re-indexes changed files every session while the agent queries a current graph of code, docs, and decisions over MCP. The FAQ states the same contract: hooks re-index changed files (and pull connector updates) every session so the agent is not stuck on a manual rebuild.
Read that as a design claim, not as a promise of zero lag under every load. The important move is architectural: ingest is coupled to session lifecycle, not parked as a job someone has to remember after the fact.
What you should not need is a second mental model — "I code here, and over there I maintain the agent index." When those models separate, they drift. When ingest rides the same session boundaries you already open and close, the private graph has a chance to stay honest without becoming a side project.
Exact hook event names and CLI flags belong in product manuals when they ship. The product claim that matters here is simpler: without some form of lifecycle-coupled ingest, "agent memory" is a snapshot wearing a durable badge.
What a private graph needs to stay trustworthy
A codebase knowledge graph is useful because it makes structure queryable: symbols, docs, decisions, PRs, work items, and the edges between them. That is agent memory — a map you can ask, not a chat log you hope the model re-reads.
None of that helps if the nodes describe last week's repository.
Trust for a private graph is two-sided. The first side is well covered elsewhere: keep the index on the machine that already has the source, so you are not exporting the company into someone else's retention policy. The second side is this article's topic: the graph must keep up with the code it claims to represent. Local and stale is still stale. Private and wrong is still wrong.
So the bar for "memory for your agent" is not only "we built a graph once." It is "the graph you query this session is the graph of the work you are doing this session" — changed files re-ingested on lifecycle boundaries, connectors refreshed with that same rhythm, no manual full rebuild as the normal path.
That is the difference between agent memory as marketing and agent memory as an engineering contract with your working tree.

Start with the clocks
A bigger context window does not replace durable memory. Dumping more files into the prompt does not create a maintained graph; it only re-pays orientation cost every session. Durable memory without continuous ingest recreates a different cost: confident orientation against a ghost.
Freshness is a product decision. The default decision — build once, hope, re-index when burned — fails quietly. If your team is already feeling the ghost — agents citing deleted modules, review threads about APIs that moved last sprint, "the agent was so sure" stories — start with the clocks. Ask what refreshes the map, and when. If the honest answer is "whenever someone runs the re-index job," you have named the bug.
Want this for your team?
Trellis builds local-first knowledge graphs for coding agents, and the Free plan runs on your own machine.