Graphite Python SDK
Native Python bindings for the Graphite embedded GraphRAG engine
Graphite DB combines Knowledge Graphs, SIMD AVX2 Vector Search, BM25 Lexical Indexing, and Token-Budgeted Context Synthesis into a single-file
.graphitedatabase with zero-copy memory mapping.
Installation
pip install graphite-db
Quickstart
import graphite_db as graphite
# 1. Open or create an embedded database
db = graphite.open("knowledge.graphite", dim=384, max_tokens=400)
# 2. Insert entities and create connections
id_auth = db.insert("AuthService", entity_type="Module", description="Validates JWT tokens")
id_db = db.insert("UsersDB", entity_type="Database", description="PostgreSQL primary cluster")
db.connect("AuthService", "UsersDB", relation="CONNECTS_TO", weight=0.95)
db.flush()
# 3. Query GraphRAG context with automatic local FastEmbed embedding
result = db.query("How does authentication connect to the database?")
print(f"Retrieved {result.token_count} tokens:")
print(result.markdown)
In-Memory Ephemeral Storage
import graphite_db as graphite
with graphite.in_memory(dim=384) as db:
db.remember("User prefers concise Portuguese responses.", category="UserPreference")
result = db.query("What language does the user prefer?")
print(result.markdown)
Direct Vector Operations & Custom Embeddings
import graphite_db as graphite
# Generate 384-dimensional vector locally on CPU
vector = graphite.embed("How does authentication work?")
db = graphite.in_memory(dim=384)
result = db.retrieve_context(vector, query_text="authentication", max_tokens=300)
print(result.markdown)
License
Dual-licensed under MIT or Apache-2.0.
Metadata
Release files for graphite-rag 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| graphite_rag-0.1.0.tar.gz | 113.1 kB | Without provenance | Details for graphite_rag-0.1.0.tar.gz |
Release files / graphite_rag-0.1.0.tar.gz
| Download URL | graphite_rag-0.1.0.tar.gz |
|---|---|
| Size | 113.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4629e455d1facd127d39278ad43b16c1b8bcca7db20f13d0dfcdf98cccd8a9ca
|
|
BLAKE2b-256 checksum How to use checksums |
76fa2d690e0e4e34ed34b6aaf7a61643e455f145312831ea6f404d0e749d5ddf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Security for graphite-rag 0.1.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.