Perplexity's Brain Beats Vector Search With a Self-Rewriting Memory Wiki
Perplexity's Brain turns agent memory into a linked Markdown wiki that background agents refine, boosting correctness 9.3 points with 15% fewer tokens.

- Perplexity detailed Brain, its self-improving memory system for Computer sessions.
- Memory is stored as a linked Markdown wiki inside a sandbox filesystem, not a vector store.
- Background Dream agents rewrite the wiki offline, summarizing sessions and updating pages.
- Wikilinks connect related subjects; citation edges link every claim to source sessions.
- Online results: +9.3 correctness, +8.0 currentness, +8.9 recall, 15% fewer tokens, 10% cheaper.
- On LoCoMo the wiki adds 4.6 points; on LongMemEval-S no significant change.
Perplexity has published a deep dive on Brain, the self-improving memory system behind its Computer product. Rather than stuffing embeddings into a vector store or dumping long transcripts into every prompt, Brain models a user's history as a structured knowledge wiki that agents navigate on demand, with background workers rewriting it while you sleep.
The pitch is straightforward: by the tenth session, the system should be far more productive than in the first, accumulating context on the user, their preferences, and the work already done. The interesting question is how they got there.
Memory as a filesystem, not a vector store
Brain sits on top of a plain filesystem inside the sandbox. Memory is materialized as files under a memory/ directory, and the agent uses the same tools on these files that it already uses on everything else. Three top-level directories hold context at different levels of abstraction:
knowledge/is Brain itself, a synthesized wiki of entities, concepts, and active projects.notes/stores distilled topical snippets for quick single-hop lookups.sessions/keeps indexes, summaries, and raw transcripts as the underlying evidence.
The wiki format borrows from a Karpathy sketch of an LLM wiki. Wikilinks connect pages laterally, so a project may link to its owner, client, or the concepts it depends on. Citation references connect claims downward to the raw sessions or connector sources that support them. The whole thing is Git-backed, so multiple agents can edit concurrently and diffs are inspectable.
Why not just use a vector database
Perplexity argues both extremes fail. Stuffing static memory files directly into model context maximizes accessibility but hits a classic precision-recall wall, saturating the window with minor items or degrading answers when too little is included. On-demand access to external databases is more flexible but shifts navigation onto the agent, and vector databases often store disconnected fragments while graph databases require agents to know how to query them effectively.
Brain's answer is to give the agent a map. A compact index of the wiki is preloaded into the first message, and the agent then uses ordinary shell tools like cat and grep, follows wikilinks, and chases citations back to raw sessions to explore further. There is no fixed retrieval pipeline; the agent decides when it has enough context.
Dream: the background rewriter
Fresh sessions are useless if the wiki goes stale. Perplexity handles this with background workers called Dream agents that run offline and rewrite Brain. Each Dream run follows four phases:
- Orient: read the authoritative scope, standing instructions, deletion log, and stopping conditions.
- Summarize sessions: write or update short summaries for any new session turns.
- Attach facts to subjects: route significant observations to the right wiki page, probing authenticated connectors when needed.
- Update the wiki: create new pages, revise existing ones, add links or citations, or make no changes when the graph is already correct.
Dream agents are defined as a Skill, and they write to a staged output tree rather than mutating Brain directly. Deterministic validation checks that pages are well-formed and meet objective criteria such as required frontmatter and citation format. Semantic verification then confirms that a proposed synthesis is supported by the gathered evidence and consistent with the rest of the graph. Only then does a controlled sync step commit the diff.
The latency trick worth stealing
Materializing the full memory tree into every sandbox is expensive; running it over a network filesystem is worse. In internal testing, simple grep workloads over a remote FUSE-backed path were roughly 400 to 500 times slower than the equivalent operations over local files.
Perplexity's fix is a two-tier scheme. A preloaded working set of likely-relevant files lives locally, and a Memory Agent subagent handles semantic search over the rest, materializing new files into the tree as they are pulled in. This preserves fast local grep and stable paths while keeping the main agent's context window uncluttered.
The numbers
Perplexity built an internal evaluation set of 640 questions across 44 synthetic personas, with each question mechanically tied to specific evidence in the account's history. Brain increased answer correctness from 0.600 to 0.661, a gain of 6.1 percentage points, and evidence recall from 0.573 to 0.625, a gain of 5.2 points. Gains were largest on preference recall (+10.2 pp) and temporal reasoning (+8.6 pp).
Public benchmarks tell a more mixed story. On LoCoMo, removing the wiki reduced answer correctness by 4.6 percentage points on average over three runs. On LongMemEval-S it produced no statistically significant change, consistent with Brain's intended role: LongMemEval-S primarily tests recovery of facts from individual sessions, where transcripts provide a redundant path. LoCoMo, which spreads evidence across conversations and dates, is where cross-session synthesis pays off.
The online paired evaluations are more compelling. Building on their June results, over the past 30 days Brain-enabled sessions outperformed the control on every run and every judged dimension, with users seeing improvements of 9.3 points in correctness, 8.0 points in currentness, and 8.9 points in recall. The Brain-enabled trajectories also used roughly 15% fewer tokens, cost 10% less, and completed generation 10% faster. Better answers alongside cheaper inference is a rare combination.
What this means if you are building agents
The takeaway for anyone building long-running agents is that memory architecture is starting to matter more than model choice. Three ideas worth borrowing:
- Give the agent an environment, not a retriever. Filesystem primitives beat opaque vector queries when the agent already knows how to use them.
- Separate reading from writing. Foreground agents answer; background agents refactor. That lets you spend compute on wiki hygiene without slowing user sessions.
- Log evidence edges everywhere. Citations from claims back to raw sessions turn hallucination checks into a grep, and let agents verify before acting on a claim.
Brain is not a general-purpose library you can install, but the design pattern travels. If your agent forgets what it did last week, a Markdown wiki that a background worker keeps clean is probably a better starting point than another embedding index.