GBrain: The Personal Memory Brain Built for Agents, Not Humans
An opinionated Postgres-native knowledge system that turns notes, meetings, and inbox history into compiled truth, hybrid search, and automated overnight cleanup.
- GBrain treats memory as an operating layer for agents, not a notebook for humans.
- Its core move is to separate durable compiled truth from the raw historical trail that produced it.
- The repo is built to be operated by tools, skills, and CLI workflows instead of a traditional UI.
- Nightly maintenance is not housekeeping here. It is the mechanism that keeps memory coherent over time.
The Brain Is Not the Folder
GBrain starts with a refusal: personal memory should not look like a pile of files waiting for a search box. It should look like a system that can be queried, updated, and maintained by an agent that never gets tired. That is why the repo feels less like note software and more like a substrate.
The interesting shift is philosophical as much as technical. The unit of value is not a document. It is a living page that can absorb new evidence, preserve history, and expose a current belief state to downstream tools.
Compiled Truth, Not Just Raw Recall
This is the repo’s sharpest idea. The schema is built around a page that can hold both a current synthesized state and the trail of how it got there. In practice, that means GBrain can answer like a memory system without deleting the evidence that made the answer possible.
| Layer | What it stores | Why it matters |
|---|---|---|
| compiled_truth | The current synthesized belief | This is what the agent should act on now. |
| timeline | Historical changes and prior states | This preserves the evidence trail and avoids amnesia. |
| content_chunks | Chunked text with embeddings | This supports semantic retrieval across noisy inputs. |
| links | Explicit relationships between entities and pages | This lets GBrain traverse context instead of guessing from similarity alone. |
That split is the whole trick. A normal vector store gives you recall. GBrain is trying to give you memory with editorial judgment.
The Repo Speaks in Tools and Skills
GBrain is designed to be operated, not admired. The CLI exports tools in machine-readable form, and the repo’s docs are written as skills and recipes that an agent can actually follow. The interface is not a dashboard. It is a contract.
// The shape of the agent-facing surface matters more than a UI here.
// GBrain exposes operations as tools so another system can drive them directly.
const ctx = new OperationContext({
dryRun: false,
logger,
});
await brain.search({
query: "who introduced me to Alice?",
limit: 5,
includeTimeline: true,
});
await brain.updatePage({
slug: "alice",
compiledTruth: "Met at SF dinner in 2024 via Maya.",
appendTimeline: true,
});
// Agents can inspect available actions without reading source code.
// cli --tools-json
That is why the `/skills` and `/recipes` folders matter. They turn operating knowledge into Markdown the model can read, which is a lot more portable than hiding logic inside a custom app layer.
Hybrid Search Is a Three-Layer Filter
GBrain does not trust embeddings alone. It mixes lexical search, semantic search, and query expansion so vague agent prompts have more than one path to success. That matters because memory queries are often incomplete, referential, or just badly phrased.
| Retrieval layer | What it catches | Weakness if used alone |
|---|---|---|
| Keyword search | Exact names, slugs, and fuzzy text matches | Misses semantic variants and paraphrases |
| Vector search | Conceptual similarity across chunks | Can surface plausible but wrong neighbors |
| Query expansion | Broader or rephrased intent | Depends on upstream model quality and can drift |
The point is not novelty. The point is resilience. When an agent asks a messy question, GBrain can still triangulate the answer from multiple retrieval paths.
The Dream Cycle Keeps Memory Coherent
The overnight maintenance loop is what turns this from a database into a living system. Entity detection, deduplication, linking, and consolidation are not background chores. They are the reason the knowledge graph does not dissolve into duplicate pages and stale references.
This is the project’s most memorable bet: memory gets better when it is allowed to sleep. During that cycle, older fragments are re-evaluated, connected, and compressed into a cleaner structure that agents can use the next day.
Why This Feels Different From Obsidian, RAG, or a Generic Agent Stack
| System | Primary user | Truth model | Self-maintaining |
|---|---|---|---|
| Obsidian | Human writer | Notes and links | Only if the user does the work |
| Generic RAG stack | App developer | Chunks and embeddings | Usually no |
| Agent framework with memory | Agent builder | Session state or ad hoc stores | Sometimes |
| GBrain | Agent plus operator | Compiled truth plus timeline | Yes, through scheduled maintenance |
That table is the cleanest way to say it. GBrain is not trying to beat note apps at browsing. It is trying to give agents a durable cognitive substrate that can survive daily updates, conflicting inputs, and forgotten context.
The Opinionated Personal AI Stack
The repo is opinionated in the best sense. It prefers Postgres, Markdown, local-first execution where possible, and explicit agent tooling over a glossy front end. That makes it feel less like a product demo and more like a blueprint for a private AI operating layer.
The bigger idea is simple. As agents become more useful, the bottleneck shifts from model quality to memory quality. GBrain is one answer to that problem, and it is a very specific one: make memory structured, maintainable, and legible to machines.





