DREAM is a memory-centric framework for AI agents, designed to provide long-term episodic memory with a modular and extensible architecture.
It is based on the DREAM Architecture, a research proposal focused on efficient memory organization, reduced energy usage, and scalable cognition for intelligent systems.
This repository provides a reference implementation of the DREAM architecture as a Python framework.
Modern AI agents and LLM-based systems suffer from fundamental limitations:
- Short context windows
- Loss of long-term episodic information
- High energy and memory costs when scaling context
- Tight coupling between memory, model, and infrastructure
DREAM addresses these issues by treating memory as a first-class system component, decoupled from models and execution logic.
- Episodic Memory: Memories are stored as discrete episodes with metadata.
- Backend Abstraction: Memory storage and retrieval are fully pluggable.
- Low Coupling: Agents interact with memory through a simple, stable API.
- Research-Oriented: Designed to support experimentation and future backends (vector databases, embeddings, distributed storage).
For now, DREAM is intended to be installed in editable mode:
pip install -e .PyPI distribution will be available in a future release.
from dream import Memory
memory = Memory()
memory.ingest(
"User prefers narrative gameplay and dislikes long combat",
{"user_id": "123"}
)
results = memory.retrieve("combat")
for r in results:
print(r["content"])DREAM supports backend injection by design.
from dream import Memory
from dream.backends.inmemory import InMemoryBackend
backend = InMemoryBackend()
memory = Memory(backend=backend)Any backend implementing the BaseMemoryBackend interface can be used.
The framework follows a clean separation of concerns:
Memory: Public API used by agentsBaseMemoryBackend: Abstract backend interfaceInMemoryBackend: Reference backend implementationexamples/: Usage demonstrationstests/: Minimal validation tests
This design allows new backends (SQLite, FAISS, vector databases, etc.) to be introduced without modifying agent code.
- Current version: v0.1.0
- Status: Early-stage framework / reference implementation
- Focus: Correct architecture, extensibility, and clarity
This project is intentionally minimal at this stage. Performance optimizations and advanced backends will be introduced incrementally.
This framework is a practical implementation inspired by the DREAM research work:
- DREAM Architecture (Paper): https://zenodo.org/records/17619917
The goal of this repository is not to replace the paper, but to provide a concrete and extensible foundation for experimentation and further research.
- Core memory API [✓]
- Backend abstraction [✓]
- In-memory backend [✓]
- Persistent storage backend (SQLite)
- Vector-based retrieval backend
- Embedding-based similarity
- CLI utilities
- PyPI release
This project is licensed under the Apache License 2.0.
Matheus Pereira da Silva Independent Researcher & Software Developer
DREAM is a research-oriented framework. It is not intended to be a production-ready system at this stage. Use it for experimentation, learning, and exploration.