AIRust
A Rust library for finding records and returning inspectable source evidence. Start with lexical search. Add document revisions, bounded excerpts, embeddings or an agent transport when your application needs them.
AIRust 0.5.3 adds a complete reference workflow, a frozen evaluation and measured maintenance improvements. Read release scope, upgrade instructions and release verification. The published 0.5.2 baseline remains reproducible.
Search application records
Use Rust 1.89 or newer. Add the published library:
[]
= { = "=0.5.3", = false }
use ;
From a source checkout, 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.
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
Install the published read-only MCP executable:
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.
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:
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 |
| 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.
Build and validate
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.