Skip to main content

DMF Logo

arXiv

DMF

The Deterministic Memory Framework (DMF) is a memory management system designed for conversational agents. The idea behind this framework is to avoid unpredictable retention, hallucination, and information loss in memory systems due to an "LLM-in-the-flow" architecture. For this reason, DMF operates on deterministic rules, mathematical temporal decay, and structured semantic retrieval.

At its core, the framework orchestrates active short-term and long-term memory by bridging interaction pipelines with vector databases.

Motivations

Current approaches to memory in conversational agents rely heavily on the LLM itself to decide what to remember, summarize, or forget. This introduces several fundamental problems:

  • Non-reproducibility: The same conversation can produce different memory states across runs, making debugging and testing nearly impossible (caching is practically infeasible).
  • Silent information loss: LLM-driven summarization silently drops details that may be critical later, with no audit trail or recovery mechanism.
  • Hallucinated recall: When asked to retrieve past context, models may confabulate facts that were never part of the conversation.
  • Opaque retention logic: There is no way to inspect, tune, or predict which information will survive and which will be discarded.

DMF addresses these issues by replacing probabilistic memory management with a fully deterministic, mathematically grounded pipeline. Every retention decision is traceable to explicit scoring functions, configurable thresholds, and transparent decay curves.

Core Design Principles

  • Deterministic NLP Analysis: Employs rule-based parsing to deterministically extract interaction signals, topics, and metrics like information density.
  • Temporal Dynamics: Automatically manages context size using mathematical time-decay functions and recency windows, naturally prioritizing fresh and highly relevant information.
  • Pluggable Long-Term Memory: Seamlessly archives interactions into vector databases and triggers context-aware semantic recalls when relevant historical data is needed.
  • Structured Retrieval: Guarantees that the context injected into your agent's prompt is always optimized through multi-stage candidate generation, answerability reranking, and evidence assembly.

Installation

You can install it via pip:

pip install dmf-memory

Install the optional Qdrant backend for in-memory or server-backed Qdrant LTM:

pip install 'dmf-memory[qdrant]'

Configuration

DMF is fully configurable via a TOML file. You can adjust NLP models, temporal decay rates, and pruning priorities to suit your agent's needs.

Minimal Qdrant Local Mode configuration:

[ltm]
enabled = true
storage_type = "qdrant"
qdrant_mode = "memory"

Qdrant Local Mode uses QdrantClient(":memory:") and remains the default. Set qdrant_mode = "server" with qdrant_host and qdrant_port to use a separately managed persistent service.

For a comprehensive guide on all configuration parameters, please check our configuration documentation in MkDocs.

Development & Makefile

The project provides a Makefile to simplify common development tasks:

  • make install: Install project dependencies using Poetry.
  • make test: Run the unit suite without external services.
  • make chroma-up: Start the version-pinned local Chroma server and wait for readiness.
  • make test-integration: Run the opt-in Chroma server roundtrip test.
  • make qdrant-up: Start the version-pinned local Qdrant server.
  • make test-integration-qdrant: Run the Qdrant multi-client roundtrip test.
  • make benchmark-ltm-local: Run the separate 10-case DMF LTM benchmark against local Ollama.
  • make chroma-down: Stop the local Chroma server while preserving its data volume.
  • make qdrant-down: Stop the local Qdrant server while preserving its data volume.
  • make check: Verify package metadata.
  • make build: Build the distributable wheel.
  • make docs-serve: Serve the documentation locally.
  • make docs-build: Build the static documentation site.

The local server uses chromadb/chroma:0.6.3, matching the supported 0.6.x Python client. See the configuration documentation for server mode, authentication, port overrides, and the complete workflow. The benchmark defaults to the already-installed Ollama model qwen2.5:0.5b; override it with OLLAMA_MODEL and keep OLLAMA_BASE_URL on a loopback host. Reports are written under integrationtest/results/ and are not part of pytest.

Benchmarks

This framework has been tested and compared with the LoCoMo and LongMemEval frameworks; full details are available in the dedicated repository

Citation

If you use the Deterministic Memory Framework in your research, please cite our paper:

@misc{stabile2026dmf,
  title = {DMF: A Deterministic Memory Framework for Conversational AI Agents},
  author = {Matteo Stabile and Enrico Zimuel},
  year = {2026},
  eprint = {2606.03463},
  archivePrefix = {arXiv},
  primaryClass = {cs.LG},
  url = {https://arxiv.org/abs/2606.03463}
}

Copyright 2026 by Matteo Stabile and Enrico Zimuel.

Metadata

Release files for dmf-memory 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for dmf-memory 0.3.0
File Interpreter ABI Platform Actions
dmf_memory-0.3.0-py3-none-any.whl Python 3 none any Details for dmf_memory-0.3.0-py3-none-any.whl

Release files / dmf_memory-0.3.0-py3-none-any.whl

Download URL dmf_memory-0.3.0-py3-none-any.whl
Size 172.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
184b16a1bb1a0e9a08a740f412c8f0b33aea1ccbcd325b89ba7e940a8387854e
BLAKE2b-256 checksum
How to use checksums
885628400dae7d256ec92a63050dac312007fbcb79e0a103125de4fd6ff9cbfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

Security for dmf-memory 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

1 file in this release has been uploaded with provenance metadata.

Attestation for dmf_memory-0.3.0-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page