Quatzal — local-first vector + graph database with trust tiers, temporal edges, and claim verification. Zero-dependency Python client (MCP Streamable-HTTP).
Project description
quatzal (Python)
Zero-dependency, fully typed (py.typed) Python client for Quatzal —
a local-first vector + graph database that records who vouched for every fact and when it
stopped being true. Talks to a Quatzal server over the MCP Streamable-HTTP transport using
only the standard library; no third-party packages. Sync and asyncio clients with
identical surfaces.
pip install quatzal
from quatzal import UaceClient, Row
client = UaceClient("https://quatzal.example.com:8443", token="...",
ca_file="dev-root.pem", retries=2, project="prod-corpus")
# Bulk ingest — one WAL fsync per batch; chunking handled for you
client.insert_rows_chunked([Row(f"doc-{i}", scalars={"src": "web"}, vector=v)
for i, v in enumerate(vecs)])
# Search with the evidence contract
resp = client.search_vectors(10, query_vector=q, max_distance=0.5)
if resp.sufficient_evidence is False:
print(resp.message) # honest "no relevant rows" instead of junk hits
for hit in resp.results:
print(hit.key, hit.score, hit.trust_tier, hit.parent_key)
# Graph — search hits feed expansion directly
client.add_edge("doc-1", "doc-2", "cites", 1.0)
print(client.expand_graph(resp.results, hops=2, k=10))
Async (agent frameworks, high-concurrency services) — same surface, awaited:
from quatzal import AsyncUaceClient
async with AsyncUaceClient("https://quatzal.example.com:8443", token="...",
ca_file="dev-root.pem") as client:
resp = await client.search_vectors(10, query_vector=q)
neighbors = await client.expand_graph(resp.results, hops=2, k=10)
Notes that matter
- Auth: static bearer tokens and IdP-issued JWTs are sent identically. On 401,
AuthErrorexposes the parsed OAuth challenge:resource_metadata(RFC 9728 discovery URL) anderror_description(why a JWT was refused). - Multi-project servers: pass
project="name"to set theuace-projectheader (case-sensitive). Required when the credential is bound to several projects; ignored by single-project servers. - Retries:
retries=Napplies only to idempotent operations (reads, ping, metrics, delete) and only to transport-level failures, with exponential backoff. Writes are never retried; tool refusals and auth failures are never retried. - Vectors go over the wire as
vector_b64(base64 little-endianf32) automatically. scorepolarity flips: squared-Euclidean distance (lower is better) for vector queries, BM25/RRF (higher is better) oncequery_textis involved. The payload carries no discriminator, so the caller must know which query shape it sent.hit.stale is Nonemeans the row never declared an expiry — that is not the same asFalse.- Tool refusals raise
ToolError; bad credentialsAuthError; unknown toolsRpcError; partial bulk failuresPartialInsertError(with the durably-inserted count). - Thread/task safety: every request opens its own connection; use one client across threads or tasks freely.
- Self-signed deployments: pin the root cert via
ca_file=; the system trust store won't know it.
import uace and import quatzal are the same module surface — the class names keep
the Uace prefix, the project's original internal name; renaming the public API would
break every existing caller for no functional gain.
Status
Pre-release (0.1.0a1), tracking Quatzal 0.1.0. Quatzal's data formats are not yet stable; treat a store as reproducible from its source data rather than as an archive.
Links
- Documentation: https://www.quatzal.com/docs/index.html
- Source: https://github.com/logixrcorp/quatzal (
clients/python/) - Tests:
python -m unittest discover -s tests
License
Apache-2.0. Quatzal is open core — the separately licensed commercial modules are not part of this package, and nothing in the client depends on them.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quatzal-0.1.0a1.tar.gz.
File metadata
- Download URL: quatzal-0.1.0a1.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da5222f9074bdf025e35a52bf47fc359085b60c72726144f5fcad238f617a14c
|
|
| MD5 |
054030956829448f1d1c678c96598280
|
|
| BLAKE2b-256 |
f45567edf8210fc1d1935a4401902a5ae1272acdda7967738fdfc58ecadfc5ce
|
File details
Details for the file quatzal-0.1.0a1-py3-none-any.whl.
File metadata
- Download URL: quatzal-0.1.0a1-py3-none-any.whl
- Upload date:
- Size: 17.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.10.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d708ef65024d6855e9dbc1fbb3e46c98e36adbbdc68e3ba3d1b91d350a36855
|
|
| MD5 |
abb76b0a8bebbf8debf18052c9908782
|
|
| BLAKE2b-256 |
d68688a69055f83a9f0291e80f558f92639c09a39910efb1a8cb4c32a637f5eb
|