Every AI answer, with a receipt.
The receipt says which documents the answer used and who was allowed to see them, for every chunk, vector and answer, kept in your own PostgreSQL. Withdraw a source, restrict access, or erase a person, and every copy follows.
For platform, data and compliance teams running RAG and agents.
PostgreSQL 16 or 17 with pgvectorNothing hosted by usAny model, and search without one
See it work
Withdraw a source. Every copy follows.
ReceiptDB links every chunk, vector and answer to what it was derived from, so a withdrawal reaches every copy, and labels such as a source's readers flow down to everything built from it.
The Globex MSA is amended. One call handles everything built from it, in a single transaction, and names the people whose answers it invalidates. Preview it, then run it →
A preview first: nothing has changed yet.
The graph as text: the source msa-2025 has one part, p.11 v3, cut into three chunks, §14.2, §14.3 and §15.1. Each chunk has an embedding, and a summary is built from §14.3 and §15.1. Answer 5d9b0a, asked by dana@acme.com, used §14.2 and §14.3; answer a81f0c, asked by priya@acme.com, used the summary and §15.1. Every record inherits the source's readers, group:legal.
source msa-2025 active
- Readers
- group:legal, its own
- Derived from
- nothing: it is a source
- Built from it
- 8 records, 2 answers
Hover, tap or tab to a record to trace its lineage. Labels flow down: everything below the source inherits group:legal.
See it work
Erase a person. Prove it.
Erasure reaches every chunk, vector, summary and answer built from a person's data, and either completes everywhere or changes nothing. Only unreadable fingerprints stay behind, and the certificate can be checked against the database afterwards.
Jane Doe asks to be erased. Preview it, then run it →
A preview first: nothing has been erased yet.
b62852a5-f080-44df-a851-d8e8a8d4d41b- Reason
- DSR-2291
- Records
- 2 sources · 4 chunks · 5 embeddings · 1 summary · 2 answers
- Answers given
- 2 already given had used this data
- Held back
- none
- Digest
ed452b447c34b047ba2ef237af9edd78ccf0465060f24031f2ff83338587abf1- Verified
- not yet erased
Runs on the PostgreSQL you already have
- PostgreSQL 16 · 17
- pgvector
- Amazon RDS
- Google Cloud SQL
- Azure Database
- Docker
- Kubernetes
How it works
One lineage graph under your RAG pipeline.
Every record is identified by its content and linked to what it was derived from and the versioned transform that produced it. Labels flow down that graph and fail closed: a derived record is never more trusted, or less restricted, than its riskiest input.
Ingest
A file, a page, a row. Re-running ingest is safe: unchanged sources are no-ops, a changed one supersedes its old version.
Derive
Chunks, vectors, summaries and agent memories, each with a receipt naming its inputs and the transform, such as ingest:paragraphs@1.
Search and ask
Vector, keyword or hybrid. Who is asking, which licence, how much trust, where the content may be sent: all applied inside the query, so a withheld passage is never ranked.
Receipt
The answer records every passage the model was shown, the model, who asked, and whether each sentence is supported. It inherits the strictest labels of its sources.
Because the graph is kept, the operations that matter later reach every copy: retract a source, erase a person, revoke a group, swap the embedding model. Each applies in a single transaction, and a retraction or an erasure can be previewed first. Trace a graph and run a retract above ↑
Install
Three steps to your first receipt.
About ten minutes. You need Python 3.12 or later and Docker. The Docker line matches ReceiptDB's default connection string, so there is nothing to configure.
Install the package
python3 -m venv .venv && . .venv/bin/activatepip install "receiptdb[live,server,client,pdf,office]==1.0.0rc1"receipt --version
live adds the local embedding model and the Anthropic SDK; pdf and office add PDF, Word and PowerPoint. For the Python library alone, pip install receiptdb==1.0.0rc1 is enough.
Start PostgreSQL
docker run -d --name receiptdb-postgres --shm-size=1g -p 127.0.0.1:54329:5432 -e POSTGRES_USER=receipt -e POSTGRES_PASSWORD=receipt -e POSTGRES_DB=receipt pgvector/pgvector:pg17
Your own database works too: set RECEIPTDB_DSN. Any PostgreSQL 16 or 17 with the pgvector extension, managed or self-run.
Ingest, then ask
receipt ingest ./my-docs --trust verified --license internal# ask answers with Claude by default; RECEIPTDB_MODEL=ollama:… needs no key; search needs noneexport ANTHROPIC_API_KEY=…receipt ask "What does our travel policy say about upgrades?"
ask prints the answer, the sources it used and the answer's receipt. receipt explain <id> shows the full lineage, as in the terminal at the top of the page.
Supported files: Word, PowerPoint, PDF (the text layer), Markdown, text, reStructuredText, CSV, JSON, HTML, XML and YAML. For services in other languages, or a shared deployment, deploy/quickstart runs the HTTP API with its database under Docker Compose. The full getting-started guide →
What the receipt guarantees
Every guarantee reaches every copy.
One document becomes chunks, vectors, memories, summaries and answers. Because ReceiptDB records where each one came from, access, withdrawal, erasure and audit reach all of them.
Access that follows the data
Every derived record inherits access from every input, so a summary or an answer is never readable by someone who couldn't read its sources. Revoke a group's access to a source and it's revoked on everything built from it.
receipt ingest … --readers group:legal
Withdraw a source everywhere
One call retracts a source and everything built from it, in a single transaction, and names the people whose answers it invalidates. ReceiptDB blocks new derivations from retracted data and refuses to re-ingest a retracted source.
receipt impact <uri> · receipt retract <uri> --reason …
Erasure you can verify
Tag sources with the people they're about. Erase a person across chunks, vectors, memories and answers; only unreadable fingerprints stay. A certificate lists what went, and a separate command checks the database against it.
receipt erase --subject person:… · receipt verify-erasure
Versioned re-ingestion
Re-index on every run. A changed source, or with page-level versioning just the changed page, supersedes its previous version and everything derived from it, answers already given included. Only text that changed is re-embedded.
receipt ingest ./docs --prune · receipt follow-up
Grounding on every answer
By default, each answer the API or the CLI records says in its receipt whether its claims are supported by the passages it cites: a score, the unsupported sentences, and the checker, offline word overlap or a model of your choice. Export one receipt per answer as JSON Lines. Check any receipt later: one command re-hashes it against the database, down to every source.
receipt audit --since 2026-01-01
Suspect content, quarantined
Scanners hold flagged sources and everything derived from them out of retrieval until someone reviews them. Built-in heuristics, built-in personal-data detection or Microsoft Presidio, Meta's Prompt Guard 2 run locally, Lakera Guard, or your own classifier over HTTP.
RECEIPTDB_SCAN=pii,heuristics,prompt-guard
Why not a vector database
A metadata filter guards one chunk. Lineage guards everything built from it.
A filter is attached to the chunk it guards; nothing carries it to what was built from that chunk. ReceiptDB stores the vectors too, and serves search with your policies enforced.
| When | With a metadata filter | With ReceiptDB |
|---|---|---|
| A legal-only contract is summarised | The summary is readable by anyone the filter misses | The summary is readable only by those who may read every source |
| A document is withdrawn | Its chunks and answers keep serving until someone rebuilds the index | One call retracts everything built from it and lists the answers it affected |
| A person asks to be erased | Someone hunts for every copy by hand | Erased from every chunk, vector, memory and answer, with a certificate |
| "Which sources did this answer use?" | Nothing records it | Every answer has a receipt |
Compliance
The evidence your auditors ask for, built from the records.
Requests from OneTrust or Transcend are answered with an erasure certificate, and stay open while a legal hold keeps records. In Enterprise, report templates for the EU AI Act and FINRA are built from the same receipts. Your privacy team starts ahead, with a DPIA template that sets out what ReceiptDB stores and where its data flows, and article-by-article mappings for GDPR and the EU AI Act, each naming the tests that show it; ask for them.
Record-keeping for AI systems
Each answer is stored with its inputs, model, asker and time, and period reports are built from those records.
Right to erasure
Erase a person from every chunk, vector, memory and answer derived from their data, with a certificate of what was removed.
Supervising AI output
An audit export per answer: what it said, who asked, and every source it relied on.
EU AI Act record-keeping report (Art. 12)
System: Credit-operations assistant (sample) · Provider/deployer: Acme Bank (fictional)
Period: 2026-01-01T00:00:00+00:00 to 2026-04-01T00:00:00+00:00 · Generated: 2026-10-12T20:21:36.182127+00:00
1. Outputs recorded
- 7 answers were recorded with full provenance (inputs, sources, model, asker, time).
- 4 of them are no longer valid, because a source was retracted, superseded or erased since.
- 1 relied on low-trust content, 0 on non-commercial or restricted content, and 1 involved personal data.
2. Input data: in the full sample, not this excerpt
3. Outputs invalidated in the period
Outputs whose inputs were later retracted, superseded, erased or quarantined.
| When | Asked by | Question | Status | Reason |
|---|---|---|---|---|
| 2026-03-02T09:05:00 | a.dubois@bank.example | What's the current personal loan rate? | quarantined | quarantine: rates changed on 1 March: out of date |
| 2026-03-04T08:30:00 | l.fischer@bank.example | What's the maximum debt-to-income for a personal loan? | superseded | the March 2026 lending policy |
| 2026-03-04T08:30:00 | s.romano@bank.example | Can we go above 40% DTI for a strong applicant? | superseded | the March 2026 lending policy |
| 2026-03-18T17:45:00 | erased | GDPR Art. 17 request #418 |
GenAI supervision report (FINRA RN 24-09)
System: Advisor assist (sample) · Provider/deployer: Acme Securities (fictional)
Period: 2026-01-01T00:00:00+00:00 to 2026-04-01T00:00:00+00:00 · Generated: 2026-10-12T20:21:36.464531+00:00
1. Outputs recorded
- 6 answers were recorded with full provenance (inputs, sources, model, asker, time).
- 4 of them are no longer valid, because a source was retracted, superseded or erased since.
- 1 relied on low-trust content, 0 on non-commercial or restricted content, and 0 involved personal data.
2. Input data: in the full sample, not this excerpt
3. Answers requiring follow-up
Each answer below was given to a user and later lost its basis. Supervisors should review whether the user needs a correction.
| When | Asked by | Question | Status | Reason |
|---|---|---|---|---|
| 2026-02-23T09:40:00 | j.patel@acme-securities.example | Can I share the Q1 income deck with retirees? | quarantined | quarantine: pending principal approval (FINRA Rule 2210) |
| 2026-03-09T08:10:00 | j.patel@acme-securities.example | Is the Global Income Fund suitable for a conservative retiree? | superseded | the March factsheet: risk rating raised to high |
| 2026-03-09T08:10:00 | a.morgan@acme-securities.example | Will the Global Income Fund keep paying 6%? | superseded | the March factsheet: risk rating raised to high |
| 2026-03-16T08:45:00 | a.morgan@acme-securities.example | What's our advisory fee on a 2M USD account? | superseded | the April 2026 fee schedule |
The last row is an answer built on a loan applicant's data, erased under their GDPR request: its question and asker went with it, and the record that an answer existed stays.
ReceiptDB gives you the evidence; how you use it determines compliance.
Use it from
A small change to the app you already have.
ReceiptDB is a vector store to LangChain and LlamaIndex, a memory store to LangGraph, a tool server to any MCP client, and an HTTP API with Python and TypeScript clients for everything else.
LangChain
Four changed lines move a RAG app from the in-memory store. Loaders already set metadata["source"], which ties each chunk to its source.
-from langchain_core.vectorstores import InMemoryVectorStore+from receiptdb.integrations.langchain import ReceiptVectorStore -store = InMemoryVectorStore(embeddings)+store = ReceiptVectorStore(embeddings, source_labels=source_labels()) answer = next(b.text for b in response.content if b.type == "text")+ store.record_answer(question, answer, docs, transform=f"agent:{response.model}@p1", asked_by=user) return answer
MCP: Claude, Cursor, any agent
The API serves an MCP server at /mcp. The agent's identity is fixed by the operator, never chosen by the model, and destructive tools are off by default.
# Claude Codeclaude mcp add --transport http receiptdb http://127.0.0.1:8321/mcp --header "Authorization: Bearer <your key>" # Cursor: .cursor/mcp.json{"mcpServers": {"receiptdb": {"url": "http://127.0.0.1:8321/mcp", "headers": {"Authorization": "Bearer <your key>"}}}} # tools: search · explain · record_answer · impact_of_retracting
HTTP API
One command starts the API with its database. The reference is served at /docs; ReceiptClient (Python) and @receiptdb/client (TypeScript) wrap it.
cd deploy/quickstart./setup.sh # writes .env with a random API keydocker compose up -d --waitcurl -s http://127.0.0.1:8321/health # Pythonfrom receiptdb.client import ReceiptClientdb = ReceiptClient("http://127.0.0.1:8321", api_key=KEY)db.search(vector, model="my-model@1", # your embedder's vector for the question policy={"principals": ["user:dana@acme.com"]})
LlamaIndex plugs in through a StorageContext in six lines; LangGraph's ReceiptStore replaces InMemoryStore in two. Haystack and Semantic Kernel stores ship too. Every integration, with the diff →
Architecture
In your process or your cluster. Never in ours.
A library in your process, or a stateless API, in front of the PostgreSQL you already back up, monitor and secure. Nothing leaves your network unless you point it at a hosted model, and content labelled for local use never goes to one.
receipt CLI and Python library, or the stateless APIDocker Compose from deploy/quickstart, or Kubernetes with the Helm chart; scale by adding replicasSingle sign-on, the connectors that sync permissions from Google Drive, SharePoint, Slack, Confluence and cloud buckets, crypto-shredding with keys in your KMS and the tamper-evident audit log are Enterprise; they sit on the same database.
Run by your platform team. Works behind PgBouncer, serves again within about a second of the database coming back after a failover, and applies every lifecycle operation whole or not at all, with rate limits and zero-downtime key rotation.
Performance
Search at index speed, with every access check.
Every figure includes the access check, and how much a caller may read barely moves it.
median search on real embeddings, with trust and licence policies enforced
recall at one million chunks, policies enforced
searches per second through the API on one 32-vCPU server, each one access-checked
How we measured
3.3 ms: the median search over 18,891 SQuAD passages with real bge-small embeddings (384 dimensions), k = 10 through the HNSW index, trust and licence filters on every search, on tuned PostgreSQL on its own 8-vCPU server with the search on another.
99%: recall@10 on a synthetic million-chunk corpus, trust and licence filters on every search, on tuned PostgreSQL on its own 32-vCPU server with the search on another, with the 16-bit vectors stored today and the HNSW settings ReceiptDB picks at that size (m = 24, ef_construction = 256, ef_search = 400).
About 13,000/s: tuned PostgreSQL on its own 32-vCPU server, the API on a second 32-vCPU server and the load generator on a third, with the server's default worker pinning and search settings: 100,000 chunks, k = 10 through the HNSW index, trust and licence filters on every search, 8 concurrent clients per process. The medians: 13,605 searches/s with the Community edition alone and 13,233 with Enterprise installed (32 processes each).
On a million-chunk corpus on two 8-vCPU servers, a caller who can read half of it and one who can read a hundredth of a percent both search in 4 to 40 ms. Lineage and labels add 1 to 9 ms per search.
Works with
Fits the stack you already run.
Database
- PostgreSQL 16 · 17
- pgvector
- Amazon RDS
- Google Cloud SQL
- Azure Database for PostgreSQL
Models
- Anthropic
- OpenAI-compatible endpoints
- Ollama and local models
- AWS Bedrock
- Search with no model at all
Frameworks and agents
- LangChain
- LlamaIndex
- LangGraph
- Haystack
- Semantic Kernel
- Model Context Protocol
Import from
- Pinecone
- Weaviate
- Qdrant
- Chroma
- Elasticsearch
- OpenSearch
- plain pgvector
Content scanning
- Llama Prompt Guard 2
- Lakera Guard
- Microsoft Presidio
- Your own, over HTTP
Observability
- Langfuse
- Arize Phoenix
- OpenTelemetry
- Prometheus metrics
Privacy requests
- OneTrust
- Transcend
- Signed webhooks
Deployment
- Docker Compose
- Kubernetes
- Helm
Editions
Start with the core. Add what your auditors ask for.
ReceiptDB Community
For teams building RAG and agents
- Receipts, label inheritance and cascading retraction
- Permission-aware vector and hybrid search, with policies enforced
- Erasure across every derived record, legal holds and quarantine
- Personal-data detection, grounding checks and data-egress labels
- Answer audit export, re-answering and signed webhooks
- Any model; LangChain, LlamaIndex, LangGraph, Haystack, Semantic Kernel and MCP; importers from Pinecone, Weaviate, Qdrant, Chroma, Elasticsearch and OpenSearch
- Functional Source License: use, modify and redistribute it for any purpose but a Competing Use; each release becomes Apache-2.0 two years after it ships
ReceiptDB Enterprise
For regulated and multi-team deployments
- SSO (OIDC) and SCIM identity sync from Okta or Entra ID, with groups from SpiceDB or OpenFGA if you run one
- Connectors that sync content and permissions from Google Drive, SharePoint, Slack, Confluence, and S3, Google Cloud Storage or Azure Blob buckets; a revoked share in Drive or SharePoint applies about a minute after the source reports it, with an optional live check at the source
- Crypto-shredding of text and vectors, with keys in AWS KMS, Google Cloud KMS or Azure Key Vault and a separate key store for backups
- Signed erasure certificates and a tamper-evident audit log with anchors
- EU AI Act and FINRA report templates, provenance explorer
- Multi-tenancy: a directory, webhooks and audit export per tenant, tenants you can disable or remove, scoped API keys, usage metering and quotas
- A licence that never holds data hostage: after expiry, a grace period, then only new Enterprise value stops
FAQ
Questions people ask first.
Does it replace our vector database?
It can. ReceiptDB stores vectors in PostgreSQL with pgvector and serves search itself, with your policies enforced. It plugs into LangChain and LlamaIndex as a vector store, so adopting it is a small code change rather than a migration project. One command imports a collection from Pinecone, Weaviate, Qdrant, Chroma, Elasticsearch, OpenSearch or plain pgvector, labelled as unknown provenance until you say otherwise.
Do we need to run a new database?
No. ReceiptDB runs on PostgreSQL 16 or 17 with the pgvector extension, self-managed or managed. The lineage graph and the event log are ordinary tables, so your existing backups, monitoring and access controls apply.
Which models can we use?
Any. Answers and grounding checks run on Anthropic, any OpenAI-compatible endpoint including local models, or AWS Bedrock. Search works with no model key at all. Content labelled for local use never goes to a hosted model.
What is the licence?
The Community edition is under the Functional Source License (FSL-1.1-ALv2). Use, modify and redistribute it for any purpose but a Competing Use: offering it to others in a commercial product or service that substitutes for it or does substantially the same. Each release becomes Apache-2.0 two years after it ships. Enterprise is a separate commercial licence from Counterfoil Labs.
What does Community not include?
Single sign-on and SCIM, the connectors that sync content and permissions from Google Drive, SharePoint, Slack, Confluence and cloud buckets, crypto-shredding, signed certificates and the anchored audit log, the explorer and multi-tenancy. Those are Enterprise. Everything the receipt itself does, retraction, permission-aware search and erasure included, is in Community.