Short-term Memory (STM)
Attentional working memory for the current session, simulating human cognitive limits.
Purpose
Short-term Memory acts as the "working RAM" for the agent. It holds the immediate context of the current conversation/session.
Key Features
- Attention Mechanism: Items have a
relevance_score. High-relevance items stay; low-relevance items decay and are evicted. - Capacity Limit: Simulates the human "7±2" cognitive limit to prevent context window overflow with irrelevant noise.
Functional Deep Dive
Attention Decay
Items in the buffer lose relevance_score over time unless they are accessed or "refreshed" by new interactions.
Context Injection
The most relevant STM items are prepended to the LLM's system prompt. This ensures the agent maintains immediate conversation continuity without re-reading the entire history.
Eviction Strategy
When the buffer reaches capacity, the item with the lowest score (calculated as Relevance * Recency) is dropped. Valuable items may be promoted to Episodic memory before eviction.
Attention Mechanism
API Reference
Short-term Memory provides endpoints for managing session buffers.
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/memory/v1/short-term | Add to buffer |
| GET | /api/memory/v1/short-term/session_id/key | Get item from buffer |
| GET | /api/memory/v1/short-term/session_id/keys | List all keys in buffer |
| PUT | /api/memory/v1/short-term/session_id | Update buffer item |
| DELETE | /api/memory/v1/short-term/session_id | Clear session buffer |
SDK Reference
The Functor SDK provides a Python interface for short-term memory operations.