Shared Agent Knowledge Base (Cross-Session Memory) #12

Open
opened 2026-03-20 22:23:52 +00:00 by replit · 0 comments
Owner

What & Why

Timmy and agents forget everything between sessions. A lightweight shared knowledge base — a readable/writable key-value store that persists facts across sessions — lets agents remember user preferences, standing instructions, and domain context. 'You know my writing style is direct and technical' becomes something Timmy genuinely knows.

Done looks like

  • knowledge_base DB table (key, value, category, created_by_agent, updated_at, confidence) stores persistent facts
  • During job execution, Timmy reads relevant KB entries (keyword matched) and injects into context
  • After a job, Timmy identifies new facts worth remembering and writes them to KB (post-execution Haiku call)
  • /api/kb endpoint allows listing, searching, and deleting KB entries
  • 'Timmy's Memory' section in performance dashboard shows top 10 KB entries with delete button
  • KB entries have 30-day TTL with soft-delete

Out of scope

  • Vector embeddings / semantic search (keyword matching only)
  • Per-visitor knowledge bases (global shared knowledge)
  • Automatic syncing across agents other than Timmy

Tasks

  1. DB schema + CRUD — Create knowledge_base table; service functions for read (keyword search), write, and TTL cleanup.
  2. Context injection — Before executing a job, query KB for relevant entries and prepend to Timmy's system prompt.
  3. Post-job extraction — After job completion, Haiku call to extract new facts worth storing; write them to KB.
  4. KB API + UI — Expose /api/kb endpoints; add 'Timmy's Memory' sub-section to the performance dashboard panel.

Relevant files

  • artifacts/api-server/src/lib/agent.ts
  • artifacts/api-server/src/routes/jobs.ts
  • the-matrix/js/ui.js
## What & Why Timmy and agents forget everything between sessions. A lightweight shared knowledge base — a readable/writable key-value store that persists facts across sessions — lets agents remember user preferences, standing instructions, and domain context. 'You know my writing style is direct and technical' becomes something Timmy genuinely knows. ## Done looks like - `knowledge_base` DB table (key, value, category, created_by_agent, updated_at, confidence) stores persistent facts - During job execution, Timmy reads relevant KB entries (keyword matched) and injects into context - After a job, Timmy identifies new facts worth remembering and writes them to KB (post-execution Haiku call) - `/api/kb` endpoint allows listing, searching, and deleting KB entries - 'Timmy's Memory' section in performance dashboard shows top 10 KB entries with delete button - KB entries have 30-day TTL with soft-delete ## Out of scope - Vector embeddings / semantic search (keyword matching only) - Per-visitor knowledge bases (global shared knowledge) - Automatic syncing across agents other than Timmy ## Tasks 1. **DB schema + CRUD** — Create `knowledge_base` table; service functions for read (keyword search), write, and TTL cleanup. 2. **Context injection** — Before executing a job, query KB for relevant entries and prepend to Timmy's system prompt. 3. **Post-job extraction** — After job completion, Haiku call to extract new facts worth storing; write them to KB. 4. **KB API + UI** — Expose `/api/kb` endpoints; add 'Timmy's Memory' sub-section to the performance dashboard panel. ## Relevant files - `artifacts/api-server/src/lib/agent.ts` - `artifacts/api-server/src/routes/jobs.ts` - `the-matrix/js/ui.js`
replit added the aibackendworkshopfrontend labels 2026-03-20 22:23:52 +00:00
gemini was assigned by Rockachopa 2026-03-22 23:37:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: replit/timmy-tower#12