Skip to main content

Typed Memory

Aegis Memory v1.9.0 introduces 4 cognitive memory types inspired by research SOTA systems (MIRIX, G-Memory, BMAM). These types move Aegis from a flat vector+metadata model toward a research-grade multi-layered memory architecture.

Motivation

Human cognition uses different memory systems for different purposes. Similarly, AI agents benefit from separating:
  • What happened (episodic) from what is known (semantic)
  • How to do things (procedural) from what to avoid (control)
This separation enables more targeted retrieval, better session continuity, and richer agent self-improvement.

Memory Types

Episodic

Time-ordered interaction traces tied to a specific session. Episodic memories capture what happened during agent interactions. Default scope: agent-private (personal interaction trace)
Key fields:
  • session_id (required) — Links the memory to a conversation session
  • sequence_number (optional) — Explicit ordering within the session
Use when: Recording interaction history, building conversation timelines, debugging agent behavior.

Semantic

Facts, preferences, and knowledge about entities. Semantic memories capture what is known and persist across sessions. Default scope: global (shared knowledge)
Key fields:
  • entity_id (optional) — Links the memory to a specific entity (user, project, concept)
Use when: Storing user profiles, extracted facts, domain knowledge, entity attributes.

Procedural

Workflows, strategies, and reusable patterns. Procedural memories capture how to do things. Default scope: global (reusable strategies)
Key fields:
  • steps (optional) — Ordered list of steps, stored in metadata
  • trigger_conditions (optional) — When to apply this procedure, stored in metadata
Use when: Recording successful strategies, building agent playbooks, codifying best practices.

Control

Meta-rules, error patterns, and constraints. Control memories capture what to avoid and behavioral boundaries. Default scope: global (system-wide rules)
Key fields:
  • error_pattern (optional) — Categorizes the error type
  • severity (optional) — Priority level, stored in metadata
  • source_trajectory_id (optional) — Links to the trajectory that triggered this rule
Use when: Recording failure modes, enforcing constraints, building guardrails.

Querying Typed Memories

Search across specific memory types:

Session Timeline

Get all episodic memories for a session, ordered by sequence:

Entity Facts

Get all semantic memories for an entity:

Existing Query Enhancement

The existing /memories/query endpoint now accepts a memory_types filter:

Relationship to Existing ACE Types

The 4 new types complement the existing 5 types — they don’t replace them: Use whichever type best fits your use case. Both sets work side-by-side.

When to Use Which Type

Database Schema

Three new columns on the memories table: Two partial indexes for efficient lookups:
  • ix_memories_session(project_id, session_id) WHERE session_id IS NOT NULL
  • ix_memories_entity(project_id, entity_id) WHERE entity_id IS NOT NULL

Next Steps

ACE Patterns

Self-improving agent patterns (vote, reflect, playbook)

API Reference

Full REST API documentation