W W

Arquitetura

Six components, three layers, and one principle: what enters is validated, what leaves carries proof, and the record of what happened cannot be rewritten. This page explains each piece and how they fit.

1. The stack in one picture

Four layers. Each solves a problem the layer below does not.

LayerPackageQuestion it answersWhere it lives
Inputwinnex-ai-normalizeis the corpus usable?PyPI 1.4.6
Searchwinnex-madhavawhat was left out, and is it provable?PyPI 1.9.25
Recordwinnex-tracercan that record be rewritten?PyPI 1.1.4
Deliverytracer-med / jus / gap / govwhich domain is yours?licence per domain
Application — Liferay portlet · API REST · Kaggle notebookwinnex-tracerEd25519 signature · SHA3-256 chain · WORMpip install winnex-tracerwinnex-madhavaCauchy-Schwarz bound · exact post-filterpip install winnex-madhavawinnex-ai-normalize13 flags · quality gate · routing by proofpip install winnex-ai-normalizeembeddingbge-m3 · Qwen3 · any OpenAI-compatibleHTTP :8102downward arrow = what the layer above consumes
Four layers. The arrow points down — each layer consumes the one below.

2. The data flow

Text or vectors enter from the left and leave as a signed record on the right. No step is optional — removing any one breaks the guarantee.

normalize measures the corpus with the engine itself and returns the configuration that makes the proof work. madhava runs the search and produces, for every document not returned, the bound that proves its exclusion. tracer seals that set of facts. The WORM chains each record to the previous one.

Text / vectorsraw inputnormalizevalidates and routesmadhavaproves the exclusiontracersigns the recordWORMchains ittop-K + bound of every exclusionEd25519 record + previous hash
Text enters on the left, a signed record leaves on the right. The arrows run while the page is visible.

3. winnex-madhava — the engine

Deterministic vector search in C++20. The difference from HNSW, IVF or PQ is not speed: it knows why a document was left out.

AspectDetail
LanguageC++20, with a pybind11 binding
Distributionpip install winnex-madhava — manylinux wheel for cp310–cp312
Dependenciesnumpy only
Inputfloat32 corpus (d×n) and float32 query
Outputtop-K + indices + exact scores + the bound of every exclusion
Proof⟨v,q⟩ ≤ ⟨Pv,Pq⟩ + ‖v−PᵀPv‖·‖q−PᵀPq‖ (Cauchy-Schwarz)
Configurationbasis="pca_corpus" aligns the projection to the corpus — without it the bound excludes nothing
Measured limit20 to 100× slower than HNSW; competitive below ~50,000 vectors
The bound only excludes when the projection is aligned to the corpus. With a random projection the limit is loose and nothing is proven out — measured: 0 of 3,000. With aligned PCA: 97% exclusion with proof, zero violations.

4. How an exclusion is proven

The auditor asks why document D did not appear. The answer is not a claim by the system: it is a number they recompute themselves.

StepWhat happensWho verifies
1compute the exact score of the K-th result — the thresholdengine
2for every document not returned, compute the upper boundengine
3if the bound falls below the threshold, the exclusion is provenengine
4the certificate is signed with Ed25519tracer
5the auditor recomputes step 2 with their own vectorauditor
That is the difference between "the system did not return it" and "the document had a bound below the threshold, so it could not be in the top-K". Only the second sentence survives a challenge.
score 0score 1K-th threshold1234returned in the top-Kabcdefexcluded — each with a bound below the thresholdUB(v,q) < threshold → proof⟨v,q⟩ ≤ ⟨Pv,Pq⟩ + ‖v−PᵀPv‖·‖q−PᵀPq‖
Filled squares return in the top-K; the dashed ones were proven out, each with a bound below the threshold.

5. winnex-tracer — the record

A correct bound does not stop a compromised engine from signing a false number. The tracer closes that with a key that never lives inside the engine.

AspectDetail
Distributionpip install winnex-tracer — pure Python
SignatureEd25519 over canonical JSON (the exact form is what is signed)
ChainSHA3-256 of the previous record, written append-only
Size~4 KB per query — years of records fit on disk
Verificationverify_record(record, public_key) returns VALID or INVALID
Keyoutside the engine; in production from KMS/HSM, and the service is fail-closed without it
Changing the counter from 2,982 to 0 breaks the signature. Removing a record from the middle breaks the chain, and the verifier names the exact block.

6. The WORM chain

A per-record signature proves it was not altered. It does not prove it was not removed — which is why the records chain.

  • What it detects: removal of any record from the middle of the chain, with the exact position.
  • What it does not detect: removal of the last lines. That needs an external anchor — publish the daily hash, or timestamp it in another system.
  • Where it writes: append-only store on disk, one file per day, fsync on every write.
block 0hash cfcd20block 1hash c4ca42block 2hash c81e72removedblock 4hash a87ff6block 5hash e4da3beach block carries the SHA3-256 of the previous oneverifier: block 3 · expected_prev ≠ found_previntegrity: BROKEN · violations: 1
Six chained blocks. The fourth was removed — the verifier names block 3.

7. winnex-ai-normalize — the input gate

RAG quality is not decided at search time. It is decided before, in the quality of what enters the index. This package is where that gets measured.

FlagWhat it validatesSeverity
dataset.nanNaN or infinity in the corpusfail — blocks the build
dataset.degeneratezero variance, empty corpusfail — blocks the build
embedding.dim_shiftdeclared dimension differs from the arrayfail — blocks the build
embedding.resolutionsemantic separation between top-1 and top-Kwarn
embedding.provider_driftspace drift between batcheswarn / fail
dataset.not_certifiableconfiguration that cannot prove exclusionwarn
The gate also decides basis and k1_fraction by measuring the engine's own proof over your corpus. It is not a heuristic: it is the coverage it measured. On a weak-manifold corpus it routes to a random projection instead of PCA — because there PCA degrades recall.

9. winnex-nano — inference without CUDA

Native inference that runs where PyTorch does not: no CUDA, no framework, on CPU or integrated GPU. Not the focus of the audit stack — it is what lets the pipeline reach restricted environments.

AspectDetail
Distributionpip install winnex-nano — PyPI 0.1.47
What it doestokenizer, weight blending and bf16 inference with a streamed lm_head
Where it shinesedge, public sector, machines without a GPU
Measureddecode 1.4× faster than transformers; PPL 15.55171 against 15.55172 on the same weights
Statusfunctional, outside the critical path of the proof
A peripheral component. It takes no part in the exclusion proof — it exists for anyone who needs to run a model without CUDA and stay in the same ecosystem.

10. winnex-xfactor — manifold projection

A projector P = XXᵀ derived from the model weights, no training. It is the research that produced UB Width — the corpus-aligned PCA basis.

AspectDetail
Distributionpip install winnex-xfactor — PyPI 1.0.8
What it doesextracts the manifold basis from the weights, training nothing
Relation to the proofit is the origin of basis="pca_corpus" in madhava
Statusrefuted as a standalone product — survives as a technique inside UB Width
Declared refuted. The original hypothesis — that the manifold alone would solve retrieval — did not hold in the benchmarks. What survived was the projection technique, now embedded in winnex-madhava as a basis option. The packages stay published for reproducibility of the papers, not as a usage recommendation.

8. The four tracer domains

The same audit core, with each sector vocabulary and obligations.

DomainBuyerWhat changes
tracer-medinsurers, hospitals, EHR vendorsdenied claims, LGPD Art. 9, record retention
tracer-juse-Discovery, corporate legal, LegalTechdocument production, chain of custody
tracer-gapbanks, insurers, reconciliationreconciliation trail, closing evidence
tracer-govcourts of accounts, controladorias, prosecutorsLAI, public accountability — free under the Additional Use Grant

12. Installation, package by package

Each package installs independently. The engine ships as a manylinux wheel — no compiler needed. The rest is pure Python.

PackageCommandRequiresWheel
enginepip install winnex-madhavanumpymanylinux cp310–cp312
auditpip install winnex-tracerPyNaClpy3-none-any
gatepip install winnex-ai-normalizenumpy, httpxpy3-none-any
securitypip install winnex-madhava-secnumpypy3-none-any
inferencepip install winnex-nanonumpyper-platform
everythingpip install winnex-madhava winnex-tracer winnex-ai-normalize——
The three core packages are all a production deployment needs. madhava-sec, nano and xfactor are additive — the proof works without them.

Versions current at the time of writing: madhava 1.9.25 · tracer 1.1.4 · normalize 1.4.6 · madhava-sec 3.1.0 · nano 0.1.47.

11. What the architecture does not solve

These limits are structural, not roadmap items.

  • The proof covers the vector space, not the encoder. A poor embedding produces a correct proof and a useless answer. The gate measures and reports encoder quality; it does not fix it.
  • Latency trades against the proof. The audited path costs 20 to 100× more than HNSW. That is the price of the guarantee, and it is stated.
  • WORM without an external anchor does not protect the end of the chain. Publishing the daily hash fixes it; without that, truncation is invisible.
  • Scale validated to 100,000 vectors. 100M via mmap is documented, not publicly benchmarked.