![]()
Urna
A vector database in one file, with citations that stay valid.
A .urna file holds the chunks, the embeddings, the source spans, the indices and the search contract. The rust runtime maps it into memory, checks its hashes, and answers with exact cosine scores and a urna://content_hash/chunk_id citation for every hit. It works offline and rebuilds byte for byte. Python builds the file, rust serves it.
Install
|
Then run setup once. It downloads the offline embedder, prepares a python env and checks the install:
Python only, no setup step needed:
Windows, docker, cargo binstall and how to verify a download are in the install reference.
In the terminal
urna setup shows the plan before it writes anything and ends on the doctor checks.
urna tui opens a corpus, validates it, and lets you ask it questions. Each hit shows its score, the stored text and its citation.
Quickstart
examples/quickstart/ has twelve short paragraphs and the spec that builds them. From a checkout:
ask prints the answer with its citation, retrieve prints json for another program, cite turns a citation back into the stored text, and validate checks every hash. To build from your own rows, see usage section 13.
What the file guarantees
| Property | How |
|---|---|
| Self-contained | The file is the whole database. Copy it like a sqlite file. |
| Verifiable | Sha-256 per section, per file and over the decoded content. urna cite resolves any citation. |
| Reproducible | Same chunks and same model give a byte-identical file on any machine. |
| Offline | The runtime never opens a socket. A query from the wrong model fails at the model_hash check. |
Python
=
=
=
=
# exact
# hnsw, then exact rerank
# bm25 + vectors, exact rerank
# chunk graph from the seeds
# one named multimodal space
assert is True
=
Each chunk is a dict with canonical_text, source_uri, byte_start, byte_end and embedding:
python examples/quickstart/quickstart.py runs the whole loop, build to cited hits, with no network.
CLI
The engine verbs take a file and a vector and never run python. The agent verbs (ask, retrieve, build) take text and use the offline embedder. setup and tui are the terminal ui. urna --help lists all three groups.
build reads one toml: the source (sqlite, csv, jsonl, an image dir), the media settings, and one or more embedding models from the registry (potion, clip-vit-b32, siglip2, wemm-2b, ...). Each model becomes a named vector space in the same file. The full spec is in usage section 13.
Benchmarks
100,000 x 384 rows, k=10, one thread, same machine for every store.
| Store | p50 (ms) | p99 (ms) | Cold open (ms) |
|---|---|---|---|
| hnswlib | 0.32 | 0.53 | 182 |
| usearch | 0.67 | 61.4 | 58 |
| urna hybrid | 0.72 | 1.02 | 356 |
| urna exact | 7.80 | 8.32 | 292 |
| lancedb | 16.7 | 19.4 | 612 |
| sqlite-vec | 19.8 | 24.8 | 50 |
Both urna rows return recall@10 = 1.000. Urna's cold open includes checking every section hash before the first answer. Urna does not do updates, filters or concurrent writers. Method and the full table: docs/benchmarks.md.
| Preset | Embeddings | Index | Size | Recall@10 |
|---|---|---|---|---|
exact |
float32 | 1.000 | 1.000 | |
compressed |
float16 | 0.339 | 1.000 | |
tiny |
int8 | hnsw | 0.256 | 0.992 |
micro |
mrl256-int8 | hnsw | 0.223 | 0.810 |
nano |
int4 | hnsw | 0.209 | 0.913 |
hybrid |
float32 | hnsw + bm25 | 0.609 | 1.000 |
Measured on a 30,725-chunk pt-br corpus. Recall here is rank stability under quantization, not real-query quality. Details in usage section 6.
| Profile | Media | File | Vs the jpeg source |
|---|---|---|---|
archive |
JPEG XL, byte-reversible | 3.61 GB | 1.10x |
stills |
AV1 all-intra crf35 | 1.37 GB | 2.89x |
retrieval |
AV1 all-intra crf50 | 533 MB | 7.46x |
Text-to-image hit@1 over every card: siglip2 0.750, wemm-2b 0.744, jina 0.336, clip 0.098. Code and data: mtg-urna-benchmark.
Reference
- docs/usage.md: every verb, presets, models, builds, install channels
- docs/benchmarks.md: how the numbers were measured
- docs/SECURITY.md: reporting, hardening, data governance
- docs/CHANGELOG: releases with measured numbers
- docs/arc/arc.toml: the architecture map
- AGENTS.md: notes for contributors and agents
The crates are urna-format (the container), urna-runtime (search), urna (the binary) and urna-python (the bridge).
Renamed from
nestafter 0.4.0. A.nestfile written by 0.4.0 still opens.
License
MIT, see docs/LICENSE. Hoff Research
Made it simple, but significant (∂μfμν = jν)
Author: Brenner Cruvinel