Skip to main content

Crate veclayer

Crate veclayer 

Source
Expand description

§VecLayer

Hierarchical vector indexing for documents with perspective-based memory.

VecLayer provides semantic search over documents with hierarchical context, a persistent memory layer for AI agents, and automatic knowledge aging — important knowledge stays, unused knowledge fades.

§Core Concepts

  • Hierarchical chunks: Documents are split into chunks organized at different levels (document, section, paragraph, fragment)
  • Perspectives: Different views of the same knowledge store (e.g., decisions, learnings, intentions)
  • Salience scoring: Retrieval blends semantic similarity, recency, access frequency, and reinforcement
  • Aging: Entries naturally decay unless accessed or reinforced

§Feature Flags

  • llm (default): Enables LLM-powered summarization and clustering
  • sync: Enables cross-store synchronization

Re-exports§

pub use blob_store::BlobStore;
pub use chunk::content_hash;
pub use chunk::relation;
pub use chunk::short_id;
pub use chunk::visibility;
pub use chunk::AccessProfile;
pub use chunk::ChunkLevel;
pub use chunk::ChunkRelation;
pub use chunk::ClusterMembership;
pub use chunk::EntryType;
pub use chunk::HierarchicalChunk;
pub use chunk::RecencyWindow;
pub use chunk::STANDARD_VISIBLE;
pub use config::Config;
pub use embedder::Embedder;
pub use entry::EmbeddingCache;
pub use entry::Entry;
pub use entry::StoredBlob;
pub use error::Error;
pub use error::Result;
pub use parser::DocumentParser;
pub use salience::SalienceWeights;
pub use search::HierarchicalSearch;
pub use search::HierarchicalSearchResult;
pub use search::SearchConfig;
pub use store::StoreBackend;
pub use store::VectorStore;

Modules§

access_profile
RRD-style access tracking for memory aging.
aging
Agent-configurable aging rules for automatic visibility degradation.
blob_store
Git-style content-addressed blob store.
chunk
Core domain types for VecLayer’s hierarchical chunk model.
config
Configuration with 12-factor layered resolution: ENV > TOML file > Defaults.
embedder
Embedding trait and backend implementations.
entry
Entry: the portable, serializable form of a HierarchicalChunk.
error
Error types for VecLayer operations.
identity
Identity: emergent self-model from memory structure.
parser
Document parsing traits and implementations.
perspective
Perspectives: named lenses over the same knowledge.
relations
Shared relation processing for CLI and MCP paths.
resolve
ID resolution and temporal parsing shared by CLI commands and MCP tools.
salience
Salience scoring: how “important” an entry is beyond access frequency.
search
Hierarchical search engine with blended salience scoring.
store
Vector store trait and backend implementations.

Macros§

arc_impl
Macro to implement traits for Arc where T implements the trait. This eliminates boilerplate Arc delegation code across trait modules.

Structs§

ClusterPipeline
Pipeline for RAPTOR-style clustering and summarization.
OllamaSummarizer
Summarizer using Ollama for local LLM inference. Free and runs locally - perfect for RAPTOR-style summarization.
SoftClusterer
Soft clusterer using K-Means with distance-based soft assignments.

Enums§

LlmBackend
Enum-based dispatch for LLM providers. Avoids trait objects while supporting multiple backends.

Traits§

LlmProvider
Trait for LLM text generation.
Summarizer
Trait for generating text summaries. Used to summarize clusters of related chunks.

Functions§

default_data_dir
Platform-appropriate default data directory for VecLayer.