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)
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)
session_id(required) — Links the memory to a conversation sessionsequence_number(optional) — Explicit ordering within the session
Semantic
Facts, preferences, and knowledge about entities. Semantic memories capture what is known and persist across sessions. Default scope:global (shared knowledge)
entity_id(optional) — Links the memory to a specific entity (user, project, concept)
Procedural
Workflows, strategies, and reusable patterns. Procedural memories capture how to do things. Default scope:global (reusable strategies)
steps(optional) — Ordered list of steps, stored in metadatatrigger_conditions(optional) — When to apply this procedure, stored in metadata
Control
Meta-rules, error patterns, and constraints. Control memories capture what to avoid and behavioral boundaries. Default scope:global (system-wide rules)
error_pattern(optional) — Categorizes the error typeseverity(optional) — Priority level, stored in metadatasource_trajectory_id(optional) — Links to the trajectory that triggered this rule
Querying Typed Memories
Type-Filtered Search
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:| Existing Type | New Equivalent | Difference |
|---|---|---|
standard | semantic | semantic adds entity_id linking |
strategy | procedural | procedural adds structured steps and trigger_conditions |
reflection | control | control adds severity and broader meta-rule scope |
progress | episodic | episodic adds session_id and sequence_number for finer granularity |
feature | — | No equivalent; feature tracking remains unique |
When to Use Which Type
| Scenario | Recommended Type |
|---|---|
| Recording what happened in a conversation | episodic |
| Storing a fact about a user or entity | semantic |
| Saving a reusable workflow or pattern | procedural |
| Recording a rule or constraint | control |
| General-purpose memory storage | standard |
| Storing a lesson from a failure | reflection or control |
| Tracking session progress | progress |
| Tracking feature completion | feature |
Database Schema
Three new columns on thememories table:
| Column | Type | Purpose |
|---|---|---|
session_id | String(64) | Links episodic memories to sessions |
entity_id | String(128) | Links semantic memories to entities |
sequence_number | Integer | Ordering within a session |
ix_memories_session—(project_id, session_id)WHERE session_id IS NOT NULLix_memories_entity—(project_id, entity_id)WHERE entity_id IS NOT NULL