Skip to main content
Palyra implements a multi-layered Retrieval-Augmented Generation (RAG) system designed to provide agents with persistent context across sessions. This system transitions from raw interaction logs (the “Tape”) into structured “Durable Facts” through an autonomous learning pipeline. It also supports a “Workspace” for human-curated documents that serve as high-fidelity ground truth for agent operations.

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-180

Memory System & Embeddings

The memory subsystem handles the storage and retrieval of vector-embedded text chunks. It categorizes information into sources such as tape: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.search tool.
  • 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.
For details, see Memory System & Embeddings. Sources: crates/palyra-daemon/src/journal.rs#53-68, crates/palyra-daemon/src/gateway.rs#116-121

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 MemorySection for manual review and promotion of candidates.
For details, see Learning, Reflection & Durable Facts. Sources: apps/web/src/console/sections/MemorySection.tsx#155-180, apps/web/src/console/sections/UsageSection.tsx#133-142

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).”
EntityRoleCode Reference
WorkspaceDocumentStateRepresents the current state and metadata of a doc.crates/palyra-daemon/src/journal.rs#24-24
palyra.workspace.patchTool used by agents to update documents.crates/palyra-daemon/src/gateway.rs#125-125
MemorySection UIWeb interface for managing roots and curated paths.apps/web/src/console/sections/MemorySection.tsx#110-115
Sources: crates/palyra-daemon/src/journal.rs#21-25, apps/web/src/console/sections/MemorySection.tsx#44-56
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.
Sources: apps/web/src/console/sections/MemorySection.tsx#138-145, crates/palyra-daemon/src/gateway.rs#116-121

Child Pages