Skip to content

A research-oriented Python framework implementing the DREAM architecture for long-term episodic memory in AI agents.

License

Notifications You must be signed in to change notification settings

MatheusPereiraSilva/dream-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DREAM Framework

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.


Why DREAM?

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.


Key Concepts

  • 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).

Installation

For now, DREAM is intended to be installed in editable mode:

pip install -e .

PyPI distribution will be available in a future release.


Quick Example

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"])

Using a Custom Backend

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.


Architecture Overview

The framework follows a clean separation of concerns:

  • Memory: Public API used by agents
  • BaseMemoryBackend: Abstract backend interface
  • InMemoryBackend: Reference backend implementation
  • examples/: Usage demonstrations
  • tests/: Minimal validation tests

This design allows new backends (SQLite, FAISS, vector databases, etc.) to be introduced without modifying agent code.


Project Status

  • 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.


Relation to the DREAM Architecture

This framework is a practical implementation inspired by the DREAM research work:

The goal of this repository is not to replace the paper, but to provide a concrete and extensible foundation for experimentation and further research.


Roadmap (High-Level)

  • Core memory API [✓]
  • Backend abstraction [✓]
  • In-memory backend [✓]
  • Persistent storage backend (SQLite)
  • Vector-based retrieval backend
  • Embedding-based similarity
  • CLI utilities
  • PyPI release

License

This project is licensed under the Apache License 2.0.


Author

Matheus Pereira da Silva Independent Researcher & Software Developer


Disclaimer

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.

About

A research-oriented Python framework implementing the DREAM architecture for long-term episodic memory in AI agents.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages