Skip to main content
Glama

AIRust

The Memory Layer for Intelligent Systems.

AIRust is a modular Rust-native knowledge and memory engine for AI agents and local LLM applications. Its small core indexes application records in memory and finds them with lexical search (BM25 or TF-IDF), without a language model, a server or a cloud service. Optional Cargo features add versioned memory records with provenance, persistent record storage, application-supplied embeddings with hybrid ranking, source evidence bound to exact document revisions, and a read-only MCP server for agents.

AIRust stores, finds and returns evidence. It does not generate answers and it is not a complete AI platform: the application or its model writes the answer.

Term

What it means here

State

Knowledge engine

Manage and search knowledge records.

Implemented: the default lexical core, plus optional documents, retrieval, embeddings, hybrid ranking, reranking and MCP.

Memory engine

Keep information durable and retrievable for an application.

Implemented as optional features: versioned records, the memory lifecycle, record storage, snapshots and bounded JSON formats. The application decides when to persist, retain and refresh.

Intelligent memory

Automatic relevance scoring, consolidation, conflict detection from text and controlled forgetting.

Not implemented. Conflicts cover caller-declared claims only, and retention runs only when the application calls it.

Small by design. With the optional web feature, AIRust is a single server binary of about 13 MB with a built-in DOS-style terminal, using about 12 MB of memory when idle (macOS arm64, stripped release build, measured for 0.6.5). On Linux x86_64 the stripped binary is about 16 MB and uses about 14 MB when idle (measured for 0.6.11). No Python, Node, Docker or external AI service is required.

Start in 15 minutes

The quickstart goes from an empty directory to a searched record, a returned source passage and an optional MCP connection. Its Rust examples are compiled and run by the test suite. The shortest start follows.

Related MCP server: velesdb-memory

Search application records

Use Rust 1.89 or newer. In a new project (cargo new airust-demo), add the published library to the [dependencies] table of Cargo.toml:

[dependencies]
airust = { version = "=0.6.11", default-features = false }

Replace src/main.rs with this program and run cargo run in the project directory:

use airust::{Engine, KnowledgeEntry};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut index = Engine::new();
    index.upsert(KnowledgeEntry::new(
        "ownership",
        "Rust ownership protects memory.",
    ))?;
    index.upsert(KnowledgeEntry::new(
        "scripting",
        "Python helps with scripting.",
    ))?;

    let hits = index.search("Rust memory", 5);
    assert_eq!(hits[0].entry.id, "ownership");
    println!("{}", hits[0].entry.text);
    Ok(())
}

The same program ships as an example: in a clone of the AIRust repository, run cargo run --locked --example core. Applications own IDs, storage, permissions and presentation. Search returns borrowed original entries, scores and matching terms. Equal scores use ascending IDs; a query without a match returns an empty list. BM25 is the default, with TF-IDF available explicitly. Scores are relevance values, not probabilities.

Return source passages

Use documents to bind passages to an exact text revision and UTF-8 range. Add retrieval for owned, bounded excerpts and JSON suitable for an application transport. These two examples run in a clone of the AIRust repository; in your own project, follow quickstart step 4.

cargo run --locked --features documents --example documents
cargo run --locked --features retrieval --example checked_evidence

Keep the snapshot together with its passages. Resolve citations against that revision after retrieval. A verified quotation establishes a byte match with supplied text; the application still reviews whether it supports an answer. Read the task cookbook, document contract and citation checks.

Connect a local agent

Save your records as a JSON array of objects with id, text and optional metadata in a file such as knowledge.json (example); the program above keeps its records in memory only. Install the published read-only MCP executable and pass the absolute path of that file:

cargo install airust --version 0.6.11 --locked --no-default-features --features mcp --bin airust-mcp
airust-mcp --knowledge /absolute/path/knowledge.json

Use --document /absolute/path/snapshot.json for checked document coordinates. Select one knowledge file or one or more document snapshots. The client can read every loaded document. The five tools search, read a passage, compare entries, suggest relations and report status over standard input/output. Returned source text is untrusted content. See client configuration, schemas and limits and the trust boundary.

AIRust is also listed in the Glama MCP directory. There you can browse its tools, check its quality score and try it with the MCP Inspector before installing it.

Try the complete reference workflow

The source checkout includes an application example that imports Markdown, saves immutable snapshots, returns citations and serves the same collection over MCP:

export AIRUST_DEMO_DIR="$(mktemp -d /tmp/airust-reference.XXXXXX)"
cargo run --locked --features mcp --example reference_workspace -- build tests/fixtures/reference-v1/sources "$AIRUST_DEMO_DIR/workspace" manuals
cargo run --locked --features mcp --example reference_workspace -- query "$AIRUST_DEMO_DIR/workspace" "Welche Bytepositionen verwendet TextSpan?"
cargo run --locked --features mcp --example reference_workspace -- serve "$AIRUST_DEMO_DIR/workspace"

The serve command runs until its MCP client closes standard input. Use a new output directory for each import. The saved collection retains its original text if input files later change. Queries return at most six passages with checked source coordinates and a complete 64 KiB JSON bound. Nonempty results leave answerability unassessed. Workflow, accepted inputs and failure behavior.

Choose optional capabilities

Default Cargo features are empty. Enable only the capabilities used by the application.

Task

Features

Guide

Exact document revisions and positions

documents

Documents

Compact excerpts, explicit question preparation and citation checks

retrieval

Retrieval

Phrases and German word forms

advanced-search

Text search

Application-supplied embeddings and rank fusion

embeddings, hybrid

Semantic, hybrid

A bounded second ranking stage

reranking

Reranking

Local ONNX model adapters

local-embeddings, local-reranking

Local embeddings, local reranking

Original-record persistence or SQLite full-text search

storage, sqlite-storage, disk-index

Storage, disk index

Consistent concurrent search/vector/source readers

snapshots

Snapshots

Versioned records with expected-revision checks and bounded history

versioning

Versioning

Memory records with provenance, declared claims, conflict policies, reported retention and source freshness

memory

Memory lifecycle

Relationships, provenance, feedback or explicit rules

Select the corresponding module

Complete feature and support matrix

The provider-neutral library supports Rust 1.89. Local ONNX adapters require Rust 1.92 and explicitly supplied assets. Builds do not download model weights or ONNX Runtime binaries. Historical Agent, KnowledgeBase and dashboard interfaces remain compatibility paths; start new record-search integrations with Engine and Retriever.

Evaluate the chosen workload

The reference application declares its use case and acceptance thresholds. Its dataset contains 150 explicitly authored questions over frozen documentation, with development and evaluation source families separated. The reference report retains configuration costs and individual regressions. These reference results do not establish customer adoption or general retrieval superiority.

The historical 0.4.4 comparison found no general hybrid-quality or token-saving advantage over SQLite plus the same embeddings. It remains historical evidence. Larger synthetic capacity and prior performance campaigns retain their original scope in the benchmark guide and change history.

Recent releases

AIRust 0.6.11 keeps float values in snapshots exact: 0.6.10 parsed floats in metadata approximately, so values such as 1.0 / 11.0 could come back one unit in the last place off and a reloaded snapshot was no longer byte-identical. The process pool keeps a healthy worker after a request it rejected before sending, the web terminal lists every user table and answers unknown paths only for GET and HEAD, and the start guides now work when followed as written. The README gives Linux figures for binary size and idle memory. See the changelog and the validation record.

AIRust 0.6.10 makes remember with claims faster: the conflict search reads the claims of earlier records from its index, and the 0.6.4 cost criterion (at most 20 µs p95 with four claims) is now met on the Linux host with 16.52 µs. Snapshot writes can be bounded by the load limit, so a store fails when it saves instead of when it restarts, and safe_purge_horizon tells how far deleted history can be purged. The process pool replaces an idle worker whose process has exited, and the reference pilot recovers from a dead isolated worker. See the changelog and the validation record.

AIRust 0.6.9 adds an opt-in bound on the IDs a versioned index or memory store tracks: deleted IDs can be purged and new IDs limited, which keeps a store that receives new IDs from growing without bound. In the web terminal, knowledge added through the API or from approved bot data is now stored and survives a restart. The crate ships without measurement data. See the changelog and the validation record.

AIRust 0.6.8 normalizes non-ASCII text faster without changing a result, which shortens index construction for such text; the gain was measured on synthetic corpora (validation record).

AIRust 0.6.7 made relate, fuzzy matching, exact semantic search and the vector search of the web interface faster without changing a result (validation record).

AIRust 0.6.6 re-evaluated a memory supersession marker when its superseding record is removed or stops conflicting, and initialized a new web database in one transaction, which shortens the first start on a slow disk (validation record).

AIRust 0.6.5 replaced the web dashboard with a DOS-style terminal and enforced the web Content Security Policy.

AIRust 0.6.4 added an optional memory lifecycle: per-record provenance, caller-declared claims with explicit conflict policies, reported retention and source freshness in search results. Read scope and criteria and release validation.

AIRust 0.6.3 added operational robustness for the process worker: an optional bounded ProcessPool, fault-injection soak validation (passed on a host without foreign load; two earlier loaded runs failed the latency-drift criterion and remain recorded), a Linux native CI job, and security fixes (admin mode requires a token, reduced worker environment, optional runtime identity, web size limits). Read scope and release validation.

AIRust 0.6.2 added an opt-in native-model process owner for predictable repeated MiniLM unload/reload, plus review fixes and resource-aware test control. Read scope, migration and release validation and open limits. AIRust 0.6.1 added bounded reranking batch/candidate settings, offline profile-check, shared training snapshots, bounded file/diagnostic costs and optional verified native file loading (scope, migration, configuration ownership).

The bounded local pilot and explicit live search profiles introduced in 0.6.0 remain compatible. Actual local answer attempts and retained measurements precede these changes; the final-source confirmation records costs and regressions. Native models still exceed 1 GiB here, and independently reviewed retrieval quality remains unestablished. Engineering validation is separate from those product-readiness gates.

The published 0.5.3 baseline provides the reference workflow, frozen evaluation and measured maintenance improvements used for comparison. Its release verification remains reproducible. The published 0.5.2 baseline remains reproducible.

The 0.6.2 process owner requires a matching trusted worker and a verified private file snapshot. It keeps unloaded-parent memory stable across repeated load/drop, but its warm-recovery latency tail is not established within 10 % of direct loading: that gate failed in 4 of 11 serial comparisons. See the before/after evidence and latency regressions.

Build and validate

./test.sh

This checks the default library, optional features, complete examples, real CLI/MCP boundaries, Clippy, documentation and package contents. Native-model evaluation is a separate explicit operation. Read contribution requirements, platform support, startup and tools, and the roadmap.

AIRust is MIT-licensed. The optional maintained PDF backend preserves its own upstream licenses and notices; its maintenance contract is described in PDF maintenance.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      B
      maintenance
      Local-first agent-memory MCP server with a why() tool: recall a fact together with its connected subgraph (multi-hop), so linked memories surface even when they share no words with the query. remember/recall/relate/forget/why over one fused vector + graph + columnar engine a single offline Rust binary.
      8
      105
      -
    • A
      license
      A
      quality
      B
      maintenance
      Local-first agent memory & knowledge service (v2.4.4): hybrid retrieval (vector + BM25) + offline CSV/Excel row-level Q&A without LLM; REST + MCP dual protocol (13 tools incl. list/delete documents); memory governance; Python.
      13
      53 PyPI
      5
      Apache 2.0
    • A
      license
      A
      quality
      C
      maintenance
      Local deterministic BM25 memory for AI agents — offline-first, no API key, SHA-256 content-addressed shards, stdio MCP transport. Same query always returns the same ranked result.
      11
      197 npm
      MIT