Skip to main content
The Palyra memory subsystem provides agents with durable storage, multi-modal retrieval, and a post-run reflection pipeline. It bridges the gap between transient session state and long-term knowledge by managing the lifecycle of facts, preferences, and procedures across different scopes.

4.1. Memory Lifecycle and Storage

The memory system operates on a tiered scope model: Principal (user-wide), Channel (platform-specific), and Session (current conversation) crates/palyra-daemon/src/application/memory.rs#11-16. All memory operations are mediated by the MemoryLifecycleProvider, which handles ingestion through a pipeline of classification, deduplication, and redaction crates/palyra-daemon/src/application/memory.rs#4-9. Durable memory items are stored in the journal and exposed via the gRPC MemoryService crates/palyra-daemon/src/transport/grpc/services/memory/service.rs. The system enforces strict visibility: channel-scoped items are invisible without matching channel context, and all text is redacted before being returned to models to prevent credential leakage crates/palyra-daemon/src/application/memory.rs#107-138. Key Components: For details, see Memory Lifecycle and Storage. Sources: crates/palyra-daemon/src/application/memory.rs#1-170, crates/palyra-daemon/src/transport/grpc/services/memory/service.rs

4.2. Retrieval-Augmented Generation (RAG) and Recall

Retrieval is governed by the RecallPlan, which coordinates hybrid search across multiple indices. The InstructionCompiler integrates retrieved context into the model’s system prompt, ensuring the agent is aware of the trust posture of the provided data crates/palyra-daemon/src/application/instruction_compiler.rs#28-38.

Hybrid Search Architecture

Palyra combines lexical search (FTS5), vector embeddings, and recency scoring to rank results. The palyra.memory.search tool allows agents to query their own memory or indexed workspace documents crates/palyra-daemon/src/application/tool_registry/builtin.rs#105-139. Memory Retrieval Mapping Sources: crates/palyra-daemon/src/application/recall.rs, crates/palyra-daemon/src/application/instruction_compiler.rs#1-87, crates/palyra-daemon/src/application/tool_registry/builtin.rs#105-140 For details, see Retrieval-Augmented Generation (RAG) and Recall.

4.3. Post-Run Learning and Reflection Pipeline

The learning subsystem performs asynchronous reflection on completed runs to extract reusable knowledge. It generates LearningCandidate objects, which can be durable facts, user preferences, or “patch skills” (suggested improvements to existing tools) crates/palyra-daemon/src/application/learning.rs.

Learning Ingestion Flow

The Learning Curator audits these candidates, applying sampling heuristics to prioritize high-value insights. Candidates remain in a pending state until an operator approves them via the Web Console apps/web/src/console/sections/MemorySection.tsx#71-112. Memory Learning Pipeline Sources: crates/palyra-daemon/src/application/learning.rs, apps/web/src/console/sections/MemorySection.tsx#131-190, crates/palyra-daemon/src/application/memory.rs#1-9 For details, see Post-Run Learning and Reflection Pipeline.

Child Pages