Overview
The Cognitive Memory system enables Kapso to learn from past experiments and provide contextual briefings. It addresses “context stuffing” by intelligently managing what information gets passed to the agent.Architecture
| Component | Backend | Purpose |
|---|---|---|
| EpisodicStore | Weaviate | Stores learned insights from past experiments |
| KnowledgeSearch | Neo4j + Weaviate | Retrieves domain knowledge and code patterns |
| Context State | In-memory | Tracks current goal, iteration, and working memory |
Components
EpisodicStore
Stores learned insights from past experiments.- Primary: Weaviate vector database for semantic search
- Fallback: JSON file for persistence without Weaviate
- Features: Duplicate detection, confidence filtering, automatic pruning
CognitiveController
Orchestrates the memory system.- Briefing Generation: Creates context packets for agents
- Insight Extraction: Uses LLM to generalize rules from errors
- State Management: Persists working memory
- Decision Making: RETRY, PIVOT, or COMPLETE
Usage
Basic Usage
Via Configuration
Enable cognitive memory by setting context manager type:Data Types
Insight
A learned rule with confidence and source tracking:Briefing
Synthesized context packet for the agent:Goal
Parsed goal with type classification:Configuration
Default Config
Presets
| Preset | Use Case |
|---|---|
minimal | Resource-constrained (100 insights) |
high_quality | Better accuracy (large embeddings) |
local | Local development (localhost) |
docker | Docker deployment |
Insight Extraction
When an experiment fails, insights are extracted:Decision Making
After processing results, the controller decides:| Decision | Meaning |
|---|---|
retry | Try again with modifications |
pivot | Change approach significantly |
complete | Task is done |