Memory & knowledge
Three pages form the context layer of the Space: Memory (/space/memory), the Knowledge Base (/space/knowledge, RAG) and Artifacts (/space/artifacts). This page documents all three and the APIs behind them.
New to the AI side? Read AI concepts from scratch first — especially Embeddings, Chunking and RAG, which power the knowledge base.
Memory (/space/memory)
Section titled “Memory (/space/memory)”Memory gives agents automatic cross-session, cross-channel recall. It is a two-layer system designed for total transparency: you can see, export and delete everything that was remembered.
How it works
Section titled “How it works”- Every agent run appends memory entries — one per user/assistant/system/tool message, tagged with
role,content,timestampand optionalagentId/metadata. - Entries are served by
GET /api/memoryand written through the same API; the panel supports filtering by agent (?agentId=) and full-text filtering. - The stats header shows
totalEntries,agentsIndexedandestimatedTokens— the estimated token footprint of what would be injected into context.
Two-layer design
Section titled “Two-layer design”- System layer — the structured store agents actually query at runtime (the entries above).
- Human-readable export — one-click exports to JSON (
synthhires-memory-<date>.json) or Markdown (synthhires-memory-<date>.md, with per-entry role headers, agent ids and content), so the memory is auditable by humans, not just machine-readable.
Management
Section titled “Management”- Search / filter entries by keyword or agent.
- Delete a single entry (
action: "delete") or clear everything / one agent (action: "clear"). - Refresh to re-pull.
Transparency is a deliberate product decision: the promise is that anything the platform remembers about you is visible in this panel and removable — no hidden profiling.
The concepts behind memory & retrieval
Section titled “The concepts behind memory & retrieval”Memory and the knowledge base solve the same underlying problem in different ways: the model’s context window is finite and it has no memory after training. Anything you want it to “recall” must be re-supplied in the prompt. These two tools decide what gets re-supplied and how it’s found:
- Memory is automatic recall of what happened. Each agent run appends entries (role, content, timestamp) so what was said can be re-injected later. It’s a ledger of events, retrieved mostly by exact/full-text matching and injected when relevant. It’s not “the model remembering” — it’s the platform keeping the receipts and replaying them into context.
- The knowledge base is deliberate, semantic retrieval (RAG). When you upload documents, they’re chunked (split into coherent pieces), each chunk is embedded (turned into a vector of its meaning), and a question is answered by finding the chunk whose vector is nearest in meaning (semantic search). This is Retrieval-Augmented Generation: ground the model in sourced, up-to-date context instead of letting it answer from training alone, which also reduces hallucination and cuts context cost by sending only the relevant snippets.
For the full mechanics of embeddings, chunking and RAG, see AI concepts from scratch.
Knowledge Base (/space/knowledge) — RAG
Section titled “Knowledge Base (/space/knowledge) — RAG”The knowledge base is a semantic retrieval store: you deliberately upload documents that agents can query as grounding context (Retrieval-Augmented Generation).
Supported sources
Section titled “Supported sources”| Source | Details |
|---|---|
| Files | PDF, DOCX, TXT, MD, CSV, JSON — up to 10 MB per file, multiple files per drop |
| URLs | Any public URL, fetched and ingested server-side |
| YouTube | Video URLs — transcript extracted and ingested |
Ingestion pipeline
Section titled “Ingestion pipeline”- Upload/URL submit → the document enters
processingstate. - Text is extracted and split into chunks (
chunkDocumentinsrc/lib/rag/vector.ts). - Each chunk is embedded and chunks are indexed via
POST /api/rag(action: "ingest_text"/"ingest_url"). - Status flips to
readywith the chunk count, orerroron failure.
Semantic search
Section titled “Semantic search”POST /api/ragwithaction: "search"runs a semantic query over the indexed chunks.- Results return the matching chunk content, source
documentId/documentName, ready to be injected as context (“Use in context”). - The index panel shows every document with type icon (file / URL / YouTube), chunk count, size and status; documents can be deleted individually.
The knowledge base is the place for deliberate, curated context — company docs, product specs, API references — as opposed to memory, which is automatic recall of what happened.
Artifacts (/space/artifacts)
Section titled “Artifacts (/space/artifacts)”The artifacts gallery indexes everything generated by AI — reports, code, images, documents — by type and origin session.
- Indexed by type and origin session: you don’t need to remember which conversation produced a file.
- Searchable: full-text search across the artifact store.
- Rendered in chat: when the assistant produces an artifact (e.g. an HTML preview), it renders in the side panel (
artifacts-panel.tsx) and is also persisted to the gallery.
Artifacts bridge chat and the content library: transient in-conversation output becomes a permanent, findable asset.