Corpus
Corpus puts chat, memory, notes, bookmarks and an inbox under one search. Every answer names the store it came from.
What it does
Five stores, one workspace
The workspace holds an inbox for documents, bookmarks, notes in markdown, a memory palace with wings, rooms and items, and the chat. Each store keeps its own shape.
One search across all of it
A question is answered from the whole workspace. The answer points to the store it came from, so you can open the source.
No dead ends
The structure stays legible under the search. When a search finds no match, you browse the rooms instead.
How a question is answered
Five stores feed one search. A match returns an answer naming its store; with no match, you browse the rooms.
Core responsibilities
Hold five stores
Chat, structured memory, notes, bookmarks and a document inbox in one workspace.
Search across all of them
One search runs over all five stores, and the chat answers from the workspace.
Name the source
Every answer points to the store it came from.
Stay browsable
When a search finds nothing, the reader walks the palace by wing, room and item instead.
File memory as a palace
Structured memory is kept as wings, rooms and items, a shape a person can walk as well as search.
Corpus in figures
- 5stores: chat, memory, notes, bookmarks, documentsthe repository
- 1search across all five, each answer naming its storethe repository
- 227files in the repositorycounted in the repository
- 3days to build, first commit to lastread in the commit log
Counted in the repository, read from a run or set in the code. No figure is estimated.
The chat reads the workspace first
Before each reply, it searches the notes, bookmarks and documents for the message. It reads up to five notes, five bookmarks and three documents, with the palace's wings.
One query, every field
A search checks titles, content and tags in every store at once and returns up to twenty of each.
The code behind Corpus
Three files from the repository, shown in turn. Select one to read it.
01res.json({02 notes,03 bookmarks,04 documents,05 total: notes.length + bookmarks.length + documents.length,06});01const wingBody = z.object({02 name: z.string().min(1),03 description: z.string().default(""),04 icon: z.string().default("🏛️"),05 color: z.string().default("cyan"),06});07 08const roomBody = z.object({09 wingId: z.number().int(),10 name: z.string().min(1),11 description: z.string().default(""),12 hall: z.enum(["facts", "events", "discoveries", "preferences", "advice"]).default("facts"),01export const memoryRooms = pgTable("memory_rooms", {02 id: serial("id").primaryKey(),03 wingId: integer("wing_id").references(() => memoryWings.id, { onDelete: "cascade" }).notNull(),04 name: text("name").notNull(),05 description: text("description").notNull().default(""),06 hall: text("hall").notNull().default("facts"),07 createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),08});Bring the workflow that keeps breaking.
Our engineers work through it with you in a free 45-minute briefing.