# Memory for AI agents: conversational vs codebase (and why coding agents need both) "Memory for AI agents" usually means remembering a conversation. If your agent writes code, that's only half of what it needs. Here's the difference, and why it matters. "Memory for AI agents" almost always means one thing: remembering the conversation — what was said across turns and sessions, the user's preferences, facts the agent picked up. Tools like mem0, Zep and Letta live here. But if your agent writes code, that's only half the memory it needs. A coding agent also needs **codebase memory**: a durable, accurate model of the code's structure that stays correct as the code changes. They're different problems, and most tools solve only one. ## Two kinds of memory, two different anchors Conversational memory is anchored to a *dialogue*. Codebase memory is anchored to *code* — the symbols, the call graph, the routes, the schema. | | Conversational memory | Codebase memory | |---|---|---| | Remembers | what was said | how the code is shaped | | Anchored to | a conversation | real symbols + structure | | Goes stale when | rarely | the code changes (unless it's structure-aware) | | Examples | mem0, Zep, Letta | SecondOS | ## Why a coding agent needs both An agent can remember your name and your preferences perfectly and still have no idea that verifyToken is called by two modules, or that you renamed a function an hour ago. Conversational memory doesn't carry your call graph. The single biggest time sink with AI coding tools isn't reasoning — it's re-explaining the codebase every session. That's a codebase-memory gap, not a conversation-memory gap. ## Why you can't fake it with chat history The tempting shortcut is to dump chat history or a hand-written summary and call it memory. It works for a while, then rots: prose describes code at a moment in time, and code moves. A note that says "auth lives in hashPassword" is wrong the second someone renames that function — and nothing tells you. Structure-aware memory is anchored to the symbol, so it's flagged stale automatically. ## Where SecondOS fits SecondOS is codebase memory for AI tools: sync your repo once, and any AI tool reads a structure-aware map of it over MCP instead of re-scanning. It stays correct as the code changes, and your source never leaves your machine — only a structural map syncs. Pair it with a conversational memory layer and your coding agent finally has both halves. [See the product](/product) · [how it compares](/compare) · [the benchmark](/benchmark).