mnemosyne  by AxDSan

Sub-millisecond AI memory for local agents

Created 1 month ago
589 stars

Top 54.7% on SourcePulse

GitHubView on GitHub
Project Summary

Mnemosyne provides a zero-dependency, local-first memory system for AI agents, specifically designed for the Hermes Agent framework. It addresses the need for fast, private, and cost-effective memory storage by leveraging SQLite, offering sub-millisecond latency for operations like reading and writing. This makes it ideal for individual developers and researchers seeking to enhance AI agent capabilities without relying on cloud services or complex infrastructure.

How It Works

Mnemosyne employs a BEAM (Bilevel Episodic-Associative Memory) architecture, utilizing SQLite as its backend for both working and episodic memory. It integrates native vector search (sqlite-vec) and full-text search (FTS5) to perform hybrid retrieval. This approach allows for efficient, in-process memory management, eliminating network overhead and external dependencies. The system further optimizes storage and retrieval through compressed binary vectors, enabling sub-millisecond search performance entirely within SQLite.

Quick Start & Requirements

  • Primary install: Recommended installation is via PyPI: pip install mnemosyne-memory. For optional features like dense retrieval and local LLM consolidation, use pip install mnemosyne-memory[all]. Installation from source is also available for development.
  • Prerequisites: Python 3.9+ and the Hermes Agent framework are required for plugin integration. Optional dependencies include fastembed for semantic search and ctransformers for local LLM consolidation.
  • OS Notes: Ubuntu 24.04 / Debian 12 users may need to install into the Hermes runtime venv to avoid environment conflicts.
  • Links: Official documentation is available at docs.mnemosyne.site.

Highlighted Details

  • Achieves sub-millisecond read (0.076 ms) and write (0.81 ms) latencies, significantly outperforming cloud alternatives.
  • Operates entirely locally with zero cloud dependencies, ensuring 100% privacy and offline capability.
  • Features a hybrid search mechanism combining vector similarity and FTS5 ranking within SQLite.
  • Utilizes Maximally Informative Binarization (MIB) for 32x smaller binary vectors, enabling efficient Hamming-distance retrieval.
  • Demonstrates competitive performance on the BEAM benchmark at smaller context scales (100K), tying with other leading systems in some metrics.
  • Supports data portability through easy export/import of the entire memory database as a single JSON file.

Maintenance & Community

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: The permissive MIT license allows for commercial use and integration into closed-source projects. Mnemosyne is primarily designed for individual developers and local agents, not enterprise-scale team collaboration features.

Limitations & Caveats

Performance degrades significantly at context scales beyond 100K (e.g., 500K+), with benchmark results showing a notable drop, attributed to limitations in the episodic consolidation pipeline during ingestion. Weaknesses are noted in multi-hop reasoning and event ordering at scale, which rely on the episodic tier. Users are responsible for managing their own data backups and restores, as enterprise features like managed scaling or team dashboards are not provided.

Health Check
Last Commit

19 hours ago

Responsiveness

Inactive

Pull Requests (30d)
119
Issues (30d)
43
Star History
547 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.