Skip to main content

llama-index-hypergraph

LlamaIndex retriever and chat memory backed by the Temporal Hypergraph Engine.

pip install llama-index-hypergraph
docker run -d -p 50051:50051 ghcr.io/divyansh151005/temporal-hypergraph-server

For development from a clone: pip install -e integrations/python-client -e integrations/llamaindex.

from llama_index_hypergraph import TemporalHypergraph

memory = TemporalHypergraph(api_key="your_key")  # a TemporalHypergraphChatMemory on session "default"
memory = TemporalHypergraph(api_key="your_key", session_id="user-42")

The server address comes from endpoint= or $HYPERGRAPH_ENDPOINT (default localhost:50051).

Retriever

from llama_index.core.query_engine import RetrieverQueryEngine
from llama_index_hypergraph import TemporalHypergraphRetriever

retriever = TemporalHypergraphRetriever(
    known_entities=["org:acme", "org:beta"],  # default linker: label match in the query
    k_hops=3,
    as_of=1700000000,                        # facts valid at this instant (default now)
)
engine = RetrieverQueryEngine.from_args(retriever, llm=llm)
  • Seeds come from entity_linker(query) (pass your own callable for NER or fuzzy matching), plus seed_entities and session:<session_id>.
  • embed_model (a LlamaIndex BaseEmbedding or LangChain-style embedder) re-ranks results by similarity; with no seeds the retriever falls back to global similarity search.
  • Each TextNode carries event_type, entities, valid_from, valid_to and hyperedge_id metadata.

Chat memory

TemporalHypergraphChatMemory is a BaseMemory. get(input=...) returns the recent history (history_limit=), preceded by a system message listing relevant facts reached within k_hops of the session. It uses the same storage scheme as langchain-hypergraph, so either framework can read a session written by the other.

Tests

cargo build --release -p grpc-server   # for the live tests; they skip otherwise
pytest integrations/llamaindex

Metadata

Release files for llama-index-hypergraph 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-index-hypergraph 2.0.0
File Size Uploaded Provenance Actions
llama_index_hypergraph-2.0.0.tar.gz 9.0 kB Without provenance Details for llama_index_hypergraph-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-hypergraph 2.0.0
File Interpreter ABI Platform Actions
llama_index_hypergraph-2.0.0-py3-none-any.whl Python 3 none any Details for llama_index_hypergraph-2.0.0-py3-none-any.whl

Total release size: 16.7 kB

Release files / llama_index_hypergraph-2.0.0.tar.gz

Download URL llama_index_hypergraph-2.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a9e09b5d7bf40646109f956426df969cc46b3a3de3b04ef172a0cf382daba452
BLAKE2b-256 checksum
How to use checksums
6f2f16efce65470c15c32682e3fe50c27004716b021fdca61cb0672a65270b8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.13

Release files / llama_index_hypergraph-2.0.0-py3-none-any.whl

Download URL llama_index_hypergraph-2.0.0-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1413242d9c3998ec1cef68201076f83137f79c9d30ac6b5401292e3a90160d65
BLAKE2b-256 checksum
How to use checksums
78fc996bb02c46ac46e77d56b3ae6cc1003fa0bd186b62796478d0afd015cb4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.13

Security for llama-index-hypergraph 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page