Long-term Memory (LTM)
Consolidated, permanent archive of important episodes and knowledge.
:LongTerm), QdrantPurpose
Long-term Memory serves as the permanent storage for high-value information. It is populated through a consolidation process that synthesizes multiple transient episodes into lasting wisdom.
Key Features
- Consolidation: Background jobs merge multiple related Episodes into a single, denser LTM item.
- Versioning: Tracks knowledge evolution over time using
:VERSION_OFrelationships.
Functional Deep Dive
Consolidation
The system runs background jobs (or triggers) that look for clusters of related episodes (e.g., multiple chats about a specific project). It asks an LLM to synthesize these into a single LongTermItem, effectively compressing history while retaining wisdom.
Versioning
LTM items are versioned. If knowledge evolves (e.g., "The project deployment script changed"), a new version is created and linked to the old one: (:LTM_Item)-[:VERSION_OF]->(:LTM_Item_Old). This preserves the history of knowledge itself.
Consolidation Flow
API Reference
Long-term Memory provides endpoints for archiving and retrieving consolidated memories.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/memory/v1/long-term/archive | Archive episode to LTM |
| POST | /api/memory/v1/long-term/retrieve | Retrieve from LTM |
| GET | /api/memory/v1/long-term | List LTM items |
| GET | /api/memory/v1/long-term/item_id | Get LTM item |
| GET | /api/memory/v1/long-term/item_id/versions | Get version history |
| PUT | /api/memory/v1/long-term/item_id | Update LTM item |
| DELETE | /api/memory/v1/long-term/item_id | Delete LTM item |
SDK Reference
The Functor SDK provides a Python interface for long-term memory operations.