System Architecture
The memory architecture bridges the gap between transient session data and long-term knowledge. It consists of three primary components: the Memory System (vector-backed search), the Learning Pipeline (autonomous reflection), and the Workspace (versioned documents).Knowledge Flow Overview
The following diagram illustrates how data moves from active conversation into long-term storage and back into the model’s context. Knowledge Lifecycle: Tape to Fact Sources: crates/palyra-daemon/src/journal.rs#64-100, crates/palyra-daemon/src/gateway.rs#63-71, apps/web/src/console/sections/MemorySection.tsx#104-180Memory System & Embeddings
The memory subsystem handles the storage and retrieval of vector-embedded text chunks. It categorizes information into sources such astape:user_message, summary, and manual. The system uses a MemoryEmbeddingProvider to generate vectors for semantic search, which are then stored in the JournalStore.
- Vector Search: Agents can query their memory using the
palyra.memory.searchtool. - Backfill: The daemon performs background embeddings backfill for new tape entries.
- Retention: Configurable policies (TTL, max bytes, max entries) manage the lifecycle of memory items.
Learning, Reflection & Durable Facts
Palyra features an autonomous learning pipeline that runs as a background workload. It analyzes completed sessions to extract “Learning Candidates,” which include Durable Facts (objective truths), Preferences (user-specific styles), and Procedures (step-by-step instructions).- Reflection: The system periodically triggers reflection runs to synthesize new knowledge.
- Confidence (BPS): Candidates are assigned a confidence score. High-confidence items can be “Auto-Applied” based on
MemoryRetentionPolicy. - Review: The Web Console provides a
MemorySectionfor manual review and promotion of candidates.
Workspace Documents
The Workspace is a collection of versioned, high-fidelity documents stored within the daemon. Unlike the probabilistic nature of vector memory, Workspace documents provide a structured environment for “Standing Orders,” “Project Manifests,” and “Standard Operating Procedures (SOPs).”| Entity | Role | Code Reference |
|---|---|---|
WorkspaceDocumentState | Represents the current state and metadata of a doc. | crates/palyra-daemon/src/journal.rs#24-24 |
palyra.workspace.patch | Tool used by agents to update documents. | crates/palyra-daemon/src/gateway.rs#125-125 |
MemorySection UI | Web interface for managing roots and curated paths. | apps/web/src/console/sections/MemorySection.tsx#110-115 |
Recall Preview & Search
Before a run begins, the system performs a “Recall Preview” to identify relevant context. The Web Console provides a unified search interface to debug this process. Recall Integration Diagram Sources: apps/web/src/console/sections/MemorySection.tsx#77-92, crates/palyra-daemon/src/gateway.rs#64-69- Unified Search: Search across session logs, workspace documents, and vector memory simultaneously.
- Promotion: Users can promote a specific memory hit or session segment directly into a Workspace Draft.