Skip to main content

Monolithic Autonomous Agent Memory Management System

Project description

LedgerMind

v2.7.8 · Autonomous Memory Management System for AI Agents

LedgerMind is not a memory store — it is a living knowledge core that thinks, heals itself, and evolves without human intervention.

License: NCSA Python 3.10+ MCP Compatible


What is LedgerMind?

Most AI memory systems are passive stores: you write, you read, and if the information becomes stale or contradictory — that is your problem. LedgerMind takes a fundamentally different approach.

LedgerMind is an autonomous knowledge lifecycle manager. It combines a hybrid storage engine (SQLite + Git) with a built-in reasoning layer that continuously monitors knowledge health, detects conflicts, distills raw experience into structured rules, and repairs itself — all in the background, without any intervention from the developer or the agent.

Core Capabilities

Capability Description
Autonomous Heartbeat A background worker runs every 5 minutes: Git sync, reflection, decay, self-healing.
Intelligent Conflict Resolution Vector similarity analysis automatically supersedes outdated decisions (threshold: 70%).
Multi-agent Namespacing Logical partitioning of memory for multiple agents within a single project.
4-bit GGUF Integration Optimized for Termux/Android using Jina v5 Small in 4-bit quantization via Llama-CPP.
API-Key Authentication Secure your MCP and REST endpoints with X-API-Key (env: LEDGERMIND_API_KEY).
Real-time Webhooks Subscribe external systems to memory events (decisions, proposals, updates).
Thread-Safe Transactions Thread-local transaction isolation and SQLite WAL mode for high concurrency.
Autonomy Stress Testing Built-in test suite for validating Falsifiability, Noise Immunity, and Deep Truth Resolution.
Canonical Target Registry Auto-normalizes target names and resolves aliases to prevent memory fragmentation.
Autonomous Reflection Proposals with confidence ≥ 0.9 are automatically promoted to active decisions.
Hybrid Storage SQLite for fast queries + Git for cryptographic audit and version history.
MCP Server 15 tools with namespacing and pagination support for any compatible client.
REST Gateway FastAPI endpoints + Server-Sent Events + WebSocket for real-time updates.
Git Evolution Automatically generates "Evolving Pattern" proposals based on code changes (minimum 2 commits).

Architecture at a Glance

graph TD
    subgraph Core ["LedgerMind Core"]
        Bridge["Integration Bridge"]
        Memory["Memory (Main API)"]
        Server["MCP / REST Server"]
        
        Bridge --> Memory
        Server <--> Memory
        
        subgraph Stores ["Storage Layer"]
            Semantic["Semantic Store (Git + MD)"]
            Episodic["Episodic Store (SQLite)"]
            Vector["Vector Index (NumPy/Jina v5 GGUF)"]
        end
        
        Memory --> Semantic
        Memory --> Episodic
        Memory --> Vector
        
        subgraph Reasoning ["Reasoning Layer"]
            Conflict["Conflict Engine"]
            Reflection["Reflection Engine"]
            Decay["Decay Engine"]
            Merge["Merge Engine"]
            Distillation["Distillation Engine"]
        end
        
        Memory -.-> Reasoning
    end

    subgraph Background ["Background Process"]
        Worker["Background Worker (Heartbeat)"]
        Worker --- WorkerAction["Health Check | Git Sync | Reflection | Decay"]
        Worker -.-> Webhooks["HTTP Webhooks"]
    end
    
    Worker -.-> Memory

Installation

# Basic install
pip install ledgermind

# With 4-bit vector search (recommended for CPU/Mobile)
pkg install clang cmake ninja
pip install llama-cpp-python
pip install ledgermind[vector]

Requirements: Python 3.10+, Git installed and configured in PATH.


Quick Start

Option A: Library (Direct Integration)

from ledgermind.core.api.bridge import IntegrationBridge

# Using Jina v5 Small 4-bit GGUF for best accuracy on CPU
bridge = IntegrationBridge(
    memory_path="./memory", 
    vector_model=".ledgermind/models/v5-small-text-matching-Q4_K_M.gguf"
)

# Inject relevant context into your agent's prompt
context = bridge.memory.search_decisions("database migrations", namespace="prod_agent")

# Record a structured decision with namespacing
bridge.memory.record_decision(
    title="Use Alembic for all database migrations",
    target="database_migrations",
    rationale="Alembic provides version-controlled, reversible migrations.",
    namespace="prod_agent"
)

Option B: MCP Server (Secure)

# Set your API key for security
export LEDGERMIND_API_KEY="your-secure-key"

# Start the MCP server
ledgermind-mcp run --path ./memory

Key Workflows

Workflow 1: Multi-agent Namespacing — Isolation Within One Core

# Agent A decision
memory.record_decision(title="Use PostgreSQL", target="db", namespace="agent_a")

# Agent B decision (same target, different namespace)
memory.record_decision(title="Use MongoDB", target="db", namespace="agent_b")

# Search only returns what belongs to the agent
memory.search_decisions("db", namespace="agent_a") # -> Returns PostgreSQL

Workflow 2: Hybrid Search & Evidence Boost

LedgerMind uses Reciprocal Rank Fusion (RRF) to combine Keyword and Vector search. Decisions with more "Evidence Links" (episodic events) receive a +20% boost per link to their final relevance score.


Documentation

Document Description
API Reference Complete reference for all public methods
Integration Guide Library and MCP integration patterns
MCP Tools Reference All 15 MCP tools with namespacing and offset
Architecture Deep dive into internals and design decisions
Configuration API keys, Webhooks, and tuning

Benchmarks (February 24, 2026, v2.7.8)

LedgerMind (v2.7.8) is optimized for high-speed operation on Android/Termux as well as containerized environments. It includes built-in security for MCP and REST endpoints.

Retrieval Performance (Jina v5 Small Q4_K_M)

Metric Mean (v2.7.8) Note
Search p95 (ms) 24.2 ms Hybrid RRF (Vector + Keyword)
Write p95 (ms) 98.4 ms Optimized Metadata Indexing
Memory OPS 15.1 ops/s Parallelized write throughput

License

LedgerMind is distributed under the Non-Commercial Source Available License (NCSA).


LedgerMind — the foundation of AI autonomy.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ledgermind-2.7.8.tar.gz (81.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ledgermind-2.7.8-py3-none-any.whl (91.6 kB view details)

Uploaded Python 3

File details

Details for the file ledgermind-2.7.8.tar.gz.

File metadata

  • Download URL: ledgermind-2.7.8.tar.gz
  • Upload date:
  • Size: 81.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ledgermind-2.7.8.tar.gz
Algorithm Hash digest
SHA256 7e4fbfbe489d5228a41adfb11ab83f9b1e9e27de780639e4c3ea671c5a0cbe02
MD5 6c9045dadf3c60787b0a22a61d3b757b
BLAKE2b-256 ee85bcc4a7e409b1a639b73009511c13aca29bb45fc82202d6fda43f3f881b51

See more details on using hashes here.

File details

Details for the file ledgermind-2.7.8-py3-none-any.whl.

File metadata

  • Download URL: ledgermind-2.7.8-py3-none-any.whl
  • Upload date:
  • Size: 91.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ledgermind-2.7.8-py3-none-any.whl
Algorithm Hash digest
SHA256 942856e1b564f0b813d8ccc645a3055ee96dc00e5b88bd38a558e1739e314507
MD5 6956d4c51888197298149549d0533026
BLAKE2b-256 56151d3fa2600489197d3bc4c0daea5fd2b3714fdf6b901fef4592ea4b6231a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page