Portal Community

Human Cognition Analogy

In human cognitive psychology, episodic memory stores autobiographical events — "what happened to me, when, where." Octopus episodic memory is the direct computational analog: each conversation episode records "what the agent and user discussed, when, in which session."

Compare to other Octopus memory types:

Memory TypeHuman AnalogyOctopus Equivalent
Episodic"I remember our conversation last Tuesday"Stored past conversation sessions — SQL
Semantic"I know that Paris is the capital of France"Embedded knowledge — vector DB
Procedural"I know how to ride a bike"Stored skill sequences — SQL
Working"What I'm thinking about right now"Current LLM context window — in-process

How Episodic Memory Powers Continuity

Without episodic memory, every new conversation starts from zero. With it, the agent can:

IEpisodicMemoryStore Interface

public interface IEpisodicMemoryStore
{
    // Store a complete episode at session end
    Task StoreAsync(Episode episode, CancellationToken ct = default);

    // Recall recent episodes for a user+agent pair
    Task<IReadOnlyList<Episode>> RecallRecentAsync(
        Guid agentId, Guid userId, int limit = 5,
        CancellationToken ct = default);

    // Semantic search across episodes for relevant past content
    Task<IReadOnlyList<EpisodeSnippet>> SearchAsync(
        Guid agentId, Guid userId, string query, int topK = 3,
        CancellationToken ct = default);

    // Query episodes by session ID
    Task<Episode?> GetBySessionAsync(Guid sessionId, string tenantId,
        CancellationToken ct = default);
}

Episodic Memory in the Reasoning Loop

Before each LLM call, the MemoryOrchestrator invokes episodic memory search to find relevant past context:

1

User Sends Message

New user message arrives in the conversation.

2

Episodic Search

IEpisodicMemoryStore.SearchAsync(agentId, userId, userMessage, topK:3) — find the 3 most relevant past episode snippets.

3

Inject into Context

Relevant episode snippets are formatted as a [Past Conversation Context] block and injected before the user's message.

4

LLM Responds with Context

The LLM has access to relevant past episodes and can reference them naturally in its response.

Prerequisites

Episodic memory requires the SqlServerStorage plugin (for SQL persistence) or a custom IEpisodicMemoryStore implementation. Without a persistent store, episodes are lost on application restart.