Brain
Build a second brain, or plain RAG, on PostgreSQL.
Brain keeps memories that know where every fact came from and who may see it. Below, these docs compiled the same way: every node is a page, every line a link. Click one, or switch to search.
An interactive three-dimensional graph of this documentation. Each point is a documentation page and each line is a link from one page to another. The side panel lists the most linked pages as buttons: choose one to read its summary and the pages it links to, and press Escape to return to the overview. Switch to search to find passages across all pages, and choose a result to open it in the panel. The same pages are available in the site navigation.
Searching the passages of these docs in your browser. Brain itself ranks with full text and, with an embedder, by meaning.
drag to orbit · scroll to zoom · click a page
Three kinds of memory, side by side.
A workspace keeps as many as it needs. Access is filtered in the database before anything is ranked.
collectionSplits each source into passages and searches them: full text always, by meaning with an embedder. The RAG shape.
graphCompiles sources into pages, one per company, person or topic, each fact with its citations and links.
personalShort facts about one user that an agent remembers and forgets.
Every source is compiled, not just stored.
A new version changes only what differs; deleting a source retires only the facts no other source supports.
- Extract
The model lists the companies, people and topics the source is about.
- Resolve
Each name is looked up among existing pages by alias, similarity and full text.
- Judge
A match or a new page; when unsure, a possible duplicate goes to an admin.
- Write
Facts with citations, inside one transaction: if a step fails, nothing changed.
Ingestion with your own rules.
A connector is a workflow that ends in Memory: add source. It reads through Connect, so a mailbox or a repository keeps a memory current on a schedule, and code, if and switch steps decide what gets in.
Node types and configs follow the kit's schemas; names are illustrative.
Read it from anywhere.
One token, three memories
{
"name": "Claude Code",
"grants": [
{ "memoryId": "<graph memory id>", "access": "read" },
{ "memoryId": "<collection memory id>", "access": "write" },
{ "memoryId": "<personal memory id>", "access": "remember" }
]
}Or embed the module
@Module({
controllers: brainControllers,
providers: brainProviders({
pool,
schema: 'pilotoo_brain',
embeddingDimensions: 1024,
ports: { directory },
}),
})
export class AppModule {}Wire it to the other blocks.
Turn on a block to see what it adds to a memory.