What does an AI agent do when a question depends on several policies that amend one another? Without stored context, it searches, reads, and rebuilds its understanding every time. Agent memory architecture is the design that lets an agent keep that understanding between tasks. LangChain describes one approach: a compiled wiki built by its open-source tool OpenWiki, plus an evidence graph that links claims back to their sources.
This explainer walks through how the pieces fit, what LangChain measured, and where the approach did not help.
What problem does a memory layer solve?
LangChain explains that agents working across an organization’s policies, manuals, wikis, tickets, and code face knowledge scattered across many systems. Finding one relevant passage is only the start. The agent also has to work out which rules apply, what has changed, and how one source affects another.
Standard retrieval pipelines, often called RAG (retrieval-augmented generation, where an agent pulls text snippets from a document store before answering), return isolated chunks of text. The agent must then piece together how those chunks relate. LangChain says this is especially hard in banking and insurance, where policies and guidelines frequently amend or supersede one another. A persistent memory layer keeps those relationships so the agent does not rebuild them on every question.
What is a compiled wiki?
A compiled wiki is a set of linked pages that synthesize source material into explanations of key concepts and how they relate. OpenWiki is the tool that produces it. LangChain’s documentation describes OpenWiki as an open-source command-line tool that writes and maintains a Markdown wiki about a codebase or personal knowledge. The wiki captures details such as architecture, integrations, evaluations, and workflows so agents can use it as durable context.
The documentation says the primary audience is agents, although humans can browse the same Markdown files and a local visualizer. The intended workflow is that agents read the curated wiki first and inspect the original source only where they need more detail. LangChain’s documentation says this makes agent work faster and cheaper in tokens, the units of text that models are billed on.
LangChain says it originally built OpenWiki so coding agents would not have to rediscover architecture and code behavior on every task. The blog post applies the same idea to document libraries.
How does the wiki stay accurate when sources change?
Each statement in an OpenWiki page rests on a claim, which LangChain defines as an assertion linked to supporting source lines and a hash of those lines. A hash is a short fingerprint of a piece of text; if the text changes, the fingerprint changes.
When the supporting lines change, the hash changes, and OpenWiki can flag the affected claims without calling a model. LangChain says this saves token costs and makes stale-claim detection more deterministic. Only the flagged claims are sent to a model for confirmation, revision, or retraction. That is how the memory layer corrects itself as its sources change. The documentation lists this as the Grounded Claims capability: material facts are tracked back to versioned source evidence, and pages refresh when that evidence changes.
What does the evidence graph add?
A wiki tells an agent what is known, but the agent still has to find the passages that justify each statement. LangChain’s evidence graph turns citations and document references into explicit links, called edges, that an agent can follow. It connects wiki statements to their supporting passages and links related sources to one another.
The practical effect is that an agent can move from a wiki page to the exact evidence behind it, then to neighboring documents that amend or reference that evidence, instead of searching again from scratch.
What did LangChain’s tests show?
LangChain built a synthetic insurance document library of 111 long-form documents. It chose insurance because policies and endorsements frequently reference, amend, and supersede one another. The company reports the following results.
- On questions requiring connections across sources, an agent using OpenWiki as memory was roughly 5x more accurate than one using search tools such as grep alone.
- Adding the evidence graph on top of the wiki improved accuracy by a further 27% and doubled how consistently the agent cited the same evidence.
- Compared with the wiki alone, the graph cut cost per correct answer by 58%.
- For simple lookups, the agent with no memory was just as accurate and faster.
These figures come from LangChain’s own benchmark on a synthetic library. They have not been independently replicated in the material reviewed, and results on real, messier document collections may differ.
How does this compare with other ways to give an agent knowledge?
Three broad approaches are worth separating. Plain search tools let an agent look up text on demand and reason from whatever comes back. Retrieval pipelines index documents so the agent receives relevant chunks, which LangChain notes it has previously improved through agentic RAG and graph-based metadata filtering. A compiled memory layer goes a step further by storing the synthesized understanding itself.
LangChain’s framing is that retrieval finds relevant passages, while memory preserves how those passages relate. The two are not mutually exclusive: the wiki points back to sources, and the agent can still inspect them directly. The company’s own results suggest the trade-off depends on the question. Cross-source reasoning benefited from memory, while simple lookups did not.
What does a realistic workflow look like?
Consider an insurance operations team whose agent answers questions about coverage. A claims analyst asks whether a particular loss is covered under a policy that has been changed by two later endorsements.
- The team points OpenWiki at its policy documents and generates a wiki. Pages explain each policy and how endorsements modify it, with claims tied to specific source lines.
- An evidence graph links each wiki statement to its supporting passages and links the endorsements to the base policy.
- When the analyst asks the question, the agent reads the relevant wiki pages first, follows graph edges to the exact clauses, and cites them in its answer.
- When an endorsement is revised, the changed source lines produce a new hash. OpenWiki flags only the affected claims, and a model reviews just those.
This scenario is an illustration built from the mechanisms LangChain describes, not a reported case study. LangChain’s documentation also notes that OpenWiki can refresh docs from GitHub Actions, GitLab CI, or Bitbucket Pipelines and open a pull request when content changes, which is relevant to code repositories rather than insurance documents.
How is OpenWiki set up and where does it run?
OpenWiki is a command-line tool, so it is operated by typing commands in a terminal rather than clicking through an app. The documentation describes two modes. Code mode, the default, writes a wiki into the current repository for coding agents. Personal mode builds a local wiki from configured sources such as git repositories, Gmail, Notion, web search, Hacker News, and X/Twitter.
The documentation lists support for several model providers, including OpenAI, Anthropic, Gemini, and Bedrock, and says OpenWiki can run inside coding agents such as Codex, Claude Code, and Cursor. It can also emit Markdown bundles in the Open Knowledge Format and trace documentation runs with LangSmith. Pages can be queried over MCP, a standard way for agents to connect to tools and data. Anyone planning to use it should check the current documentation for exact commands and supported connectors, since the tool is under active development.
Where does this approach fall short?
LangChain’s own results point to the main limit: memory pays off for repeated cross-source reasoning, not simple lookups. Building and maintaining a wiki and graph is extra work that only makes sense when questions repeatedly span several documents. The benchmark used a synthetic library of 111 documents, so the size of the gains on a company’s real, inconsistent files is unknown. Teams should also confirm how claim checking behaves when a source changes in ways that a line-level hash cannot capture cleanly, since the sources describe the mechanism but do not report failure rates.
- A compiled wiki stores synthesized, cited understanding so agents do not rebuild it for every question.
- Hash-based claim tracking lets OpenWiki flag stale statements without a model call and send only those claims for review.
- The evidence graph links wiki statements to supporting passages, and LangChain reports higher accuracy, steadier citations, and lower cost per correct answer with it.
- For simple lookups, LangChain found memory added no accuracy benefit.
The open question is how these results hold up on large, real-world document collections where sources are inconsistent and change often.