Skip to main content

LlamaIndex vector store for mnestic — embedded graph + vector + full-text store with one-call hybrid retrieval.

Project description

llama-index-vector-stores-mnestic

A LlamaIndex vector store backed by mnestic — an embedded graph + vector + full-text database (a maintained fork of CozoDB). Retrieval is hybrid: dense (HNSW) + keyword (full-text) fused with Reciprocal Rank Fusion, in one call.

mnestic is a maintained fork of CozoDB; it is not the official CozoDB. Original design credit belongs to Ziyang Hu and the Cozo Project Authors.

pip install llama-index-vector-stores-mnestic
from llama_index.core import VectorStoreIndex, StorageContext, Document
from llama_index.vector_stores.mnestic import MnesticVectorStore

vector_store = MnesticVectorStore(dim=1536, engine="sqlite", path="mydocs.db")
storage_context = StorageContext.from_defaults(vector_store=vector_store)

index = VectorStoreIndex.from_documents(
    [Document(text="the cat sat on the mat")],
    storage_context=storage_context,
)
nodes = index.as_retriever(similarity_top_k=4).retrieve("feline")

dim must match your embedding model's dimension. query runs hybrid search when the query carries text (the usual index path), otherwise vector-only.

Engine pass-through: graph legs and more

Extra keyword arguments flow from the retriever to the engine's hybrid query via vector_store_kwargs. That includes graph_legs — fuse graph proximity into the ranking alongside the dense and keyword legs, in the same single call:

retriever = index.as_retriever(
    similarity_top_k=4,
    vector_store_kwargs={"graph_legs": [{
        "edge_relation": "links", "from_col": "src", "to_col": "dst",
        "seeds": ["doc-1"], "max_hops": 2, "label": "graph",
    }]},
)

MnesticRetriever(..., search_kwargs={...}) forwards the same way, and so do extra_lists, vector_k, fts_k, rrf_k, and future engine keys — no adapter release needed when the engine grows new knobs.

License

Mozilla Public License 2.0.

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

llama_index_vector_stores_mnestic-0.2.0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file llama_index_vector_stores_mnestic-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_vector_stores_mnestic-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e14978bae8870af9e8bb6353290147d31a6f7b2bcca1cc22bc165a4ae4a693c6
MD5 29fd876c4736cd65f8b543104c31e714
BLAKE2b-256 ca75999e7ae69eba2ad4fddfe555cde057b6bb9e1f98b2a54230b955fcb20748

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_vector_stores_mnestic-0.2.0.tar.gz:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file llama_index_vector_stores_mnestic-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_vector_stores_mnestic-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8be0c83f422da139494151f4f851a2e25e04117b466c9dd1d648107a2715f2d2
MD5 e90bd1dd8036fe64d32ae8db94f81a11
BLAKE2b-256 aca8c02e734bd0ca221578391aca70584687f0e410c9aad6c21b938529481962

See more details on using hashes here.

Provenance

The following attestation bundles were made for llama_index_vector_stores_mnestic-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on shuruheel/mnestic

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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