Skip to content

Memory System Specification

Document ID: AGENT-003
File Path: docs/04-agent-framework/memory-system.md
Version: 1.0.0
Status: Draft
Owner: AI Platform Team
Last Updated: 2026-06-26


The Memory System provides persistent and transient memory capabilities for AI agents executing within the Wovyr AI Platform.

Unlike traditional chat history, the Memory System enables agents to remember information across:

  • Conversations
  • Workflow executions
  • Projects
  • Organizations
  • Teams
  • Long-running tasks

The Memory System transforms AI agents from stateless assistants into continuously learning collaborators.


The Memory System shall provide:

  • Persistent memory
  • Short-term memory
  • Long-term memory
  • Semantic retrieval
  • Context compression
  • Vector search
  • Knowledge graph integration
  • Versioned memories
  • Tenant isolation
  • Memory sharing
  • Automatic summarization

  1. Memory is independent of the LLM.
  2. Every memory is versioned.
  3. Memory retrieval is deterministic.
  4. Memories are searchable.
  5. Memories have configurable retention.
  6. Memory access is permission-controlled.
  7. Memory supports replay and auditing.

Agent Runtime
Memory Manager
┌────────────────┼─────────────────┐
▼ ▼ ▼
Working Memory Episodic Memory Semantic Memory
│ │ │
└────────────────┼─────────────────┘
Retrieval Engine
┌────────────────┼─────────────────┐
▼ ▼ ▼
Vector Store Knowledge Graph Object Store

User Prompt
Working Memory
Conversation Memory
Workflow Memory
Episodic Memory
Semantic Memory
Knowledge Base
Archive

Each layer has different persistence and retrieval policies.


Memory TypeDescription
WorkingTemporary execution context
ConversationChat history
WorkflowWorkflow execution state
EpisodicHistorical events
SemanticFacts and knowledge
SharedTeam-wide memory
OrganizationalTenant-level knowledge
ArchivedHistorical records

Working Memory exists only during a single execution.

Characteristics:

  • In-memory only
  • Fast access
  • Automatically discarded
  • Not searchable
  • Not persisted

Typical contents:

  • Current task
  • Intermediate reasoning
  • Temporary variables
  • Tool outputs

Stores conversational history.

Example:

conversationId:
agentId:
userId:
messages:
summary:
createdAt:
updatedAt:

Supports long-running conversations.


Workflow Memory stores execution-specific knowledge.

Examples:

  • Workflow variables
  • Generated artifacts
  • AI decisions
  • Tool outputs
  • User approvals
  • Intermediate plans

Workflow Memory is persisted with the workflow.


Stores historical experiences.

Examples:

  • Previous projects
  • Earlier conversations
  • Similar workflow executions
  • Past failures
  • Successful solutions

Agents use episodic memory to improve future decisions.


Semantic Memory stores facts rather than conversations.

Examples:

  • Product documentation
  • APIs
  • Coding standards
  • Company policies
  • Technical knowledge
  • Best practices

Semantic Memory is retrieved using embeddings.


Shared Memory enables collaboration.

Example:

Developer Agent
Shared Memory
QA Agent
Documentation Agent

Shared Memory is permission-controlled.


Created
Indexed
Embedded
Stored
Retrieved
Updated
Archived

memoryId:
tenantId:
agentId:
workflowId:
conversationId:
type:
title:
content:
embedding:
tags:
labels:
metadata:
createdAt:
updatedAt:
version:

Every semantic memory may generate an embedding.

Supported providers:

  • OpenAI
  • Gemini
  • VoyageAI
  • Cohere
  • Ollama
  • Local embedding models

Embeddings enable semantic retrieval.


User Request
Embedding
Similarity Search
Ranking
Policy Filter
Context Builder
Prompt Assembly

Retrieval occurs before prompt generation.


Supported strategies:

  • Vector similarity
  • Keyword search
  • Hybrid search
  • Metadata filtering
  • Graph traversal
  • Time-based ranking
  • Importance scoring

Strategies may be combined.


Each memory is indexed using:

  • Embeddings
  • Keywords
  • Labels
  • Tags
  • Metadata
  • Creation date
  • Last access time

Indexes are updated automatically.


Large memory collections are compressed.

Compression methods:

  • Summarization
  • Hierarchical clustering
  • Semantic deduplication
  • Sliding window
  • Token optimization

Compression reduces LLM token usage.


Prompt construction order:

System Prompt
Policies
Workflow Context
Conversation
Retrieved Memory
User Input
Tool Results

The Context Manager controls final prompt size.


Every update creates a new version.

Memory
Version 1
Version 2
Version 3

Historical versions remain accessible.


Retention examples:

MemoryRetention
WorkingExecution only
ConversationConfigurable
WorkflowPermanent
EpisodicPermanent
SemanticPermanent
ArchiveConfigurable

Security features:

  • Encryption at rest
  • Encryption in transit
  • RBAC
  • ABAC
  • Tenant isolation
  • Secret masking
  • Audit logging

Sensitive memories require elevated permissions.


Sharing scopes:

  • Private
  • Agent
  • Workflow
  • Project
  • Organization
  • Public

Permissions determine accessibility.


pub trait MemoryProvider {
fn store(
&self,
memory: MemoryRecord,
) -> Result<MemoryId>;
fn retrieve(
&self,
query: MemoryQuery,
) -> Result<Vec<MemoryRecord>>;
fn update(
&self,
memory: MemoryRecord,
) -> Result<()>;
fn delete(
&self,
id: MemoryId,
) -> Result<()>;
}

engine-memory/
├── manager/
├── retrieval/
├── embeddings/
├── vector-store/
├── graph/
├── compression/
├── indexing/
├── policies/
├── providers/
├── cache/
├── metrics/
└── mod.rs

  • Embedding generation
  • Retrieval accuracy
  • Context compression
  • Versioning
  • Retention
  • Agent Runtime integration
  • Workflow Memory
  • Shared Memory
  • Vector Store
  • Knowledge Graph
  • Billion-memory datasets
  • Large embeddings
  • High concurrency
  • Massive retrieval operations

RequirementTarget
Retrieval latency< 30 ms
Embedding generationProvider dependent
Context assembly< 20 ms
Availability99.99%
Horizontal scalingUnlimited

  • docs/03-workflow-engine/agent-runtime.md
  • docs/03-workflow-engine/persistence-layer.md
  • docs/03-workflow-engine/event-bus.md

  • docs/04-agent-framework/agent-definition.md
  • docs/04-agent-framework/tool-framework.md
  • docs/04-agent-framework/planning-engine.md
  • docs/04-agent-framework/context-manager.md
  • docs/04-agent-framework/provider-sdk.md

  • Memory federation
  • Cross-agent knowledge transfer
  • Autonomous memory pruning
  • AI-generated knowledge graphs
  • Multi-modal memory
  • Time-travel memory queries
  • Federated vector databases
  • Memory confidence scoring
  • Continual learning integration

VersionDateDescription
1.0.02026-06-26Initial Memory System Specification