Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

API Reference (docs.rs)

The exhaustive, type-level API reference is the generated rustdoc — this book covers the how and why; rustdoc covers every type, trait, method, and signature.

  • Online (per release): https://docs.rs/lunaris-memory (the umbrella crate is published as lunaris-memory; its library name is lunaris) — built from cargo doc with the documentation feature set (see each crate’s [package.metadata.docs.rs]).
  • Locally: cargo doc --workspace --no-deps --open (or make docs-rust).

The lunaris umbrella crate

lunaris re-exports the surface you normally touch. For the common subset, glob-import the prelude:

use lunaris::{EpisodeBuilder, ForgetTarget, Graph, Hit, Keyword, Lunaris, Query, Scope, ScopeSpec, Tree, Vector};
async fn demo() -> Result<(), lunaris::LunarisError> {
use lunaris::prelude::*;
// → Lunaris, ScopedLunaris, Scope, EpisodeBuilder, Query, Hit,
//   Vector, Keyword, Graph, Tree, RetrievalBuilder, ForgetTarget, ScopeSpec,
//   LunarisError, Embedder, HlcClock,
//   Reranker/NoopReranker, Extractor/NoopExtractor,
//   Verifier/NoopVerifier, Consolidator/NoopConsolidator
Ok(())
}

The prelude is intentionally small. Reach into the full re-export list (or the member crates directly) for everything else — extractor/verifier backend structs, the storage concrete (MoonStorage), the recipe types, init_logging, the pipeline handles, etc.

Crate map

CrateRole
lunarisUmbrella: Lunaris / ScopedLunaris handles, open() URL dispatcher, the ingest hot path, re-exports, prelude
lunaris-coreShared primitives (Episode/Chunk/Entity/Fact/Relation/Community), StoragePort trait, HLC clock, Scope newtype, keyspace, error taxonomy, circuit breaker
lunaris-ingestMarkdown chunker + batched embedder driver + the single atomic_write
lunaris-retrieveThe retrieval DSL (Vector/Keyword/Graph/Tree, combinators, RRF fusion, rerank, fallback), tower::Service-shaped
lunaris-extractEntity/relation/fact extractor (remote-only: Ollama / cloud-API providers) + validator
lunaris-consolidateACT-R consolidator (Anderson 1996; Leiden communities) — opt-in
lunaris-verifySlow-path arbitration verifier (remote-only providers) + MVCC supersede writer — opt-in
lunaris-llamacppEmbedder + Reranker impls — in-process llama.cpp (LlamaCppEmbedder: granite-r2 Q4_K_M GGUF; LlamaCppReranker: bge-reranker-v2-m3 Q5_K_M GGUF); default-enabled llamacpp feature on the umbrella
lunaris-embed-remoteEmbedder impl — Ollama HTTP escape hatch (--features embed-remote); resolves after the llama.cpp step
lunaris-rerankReranker trait + NoopReranker (the cross-encoder impl lives in lunaris-llamacpp)
lunaris-storage-moonStoragePort on a Redis-compatible substrate (native FT.*, GRAPH.QUERY, MQ, RRF)
lunaris-serverHTTP + SSE MemoryProtocol 0.1 server (axum)
lunaris-recipesRecipe primitives + conversational / documentary wrappers (see Cookbook)
lunaris-py / lunaris-tsPyO3 / napi-rs bindings (see SDKs)

lunaris-codegen, lunaris-conformance, and lunaris-bench are internal tooling crates — not part of the public API.

Publishing note. The umbrella crate is published as lunaris-memory (the bare lunaris name on crates.io is taken; the library name stays lunaris, so the import path is unchanged). lunaris-storage-moon depends on moondb from crates.io (version-pinned), so the workspace is crates.io-publishable; the [package.metadata.docs.rs] blocks are wired so docs.rs builds the right feature set.