By Paolo MessinaPublished
MethodCompany memory

Three retrieval problems, solved on LanceDB. A free database that keeps every version.

We ran into these three problems on client projects: legal archives, invoice matching, supplier analysis. Here each demo runs on sample data in LanceDB, a free open-source database that needs no server.

What we built3 working demos · open-source LanceDB · one normal PC

Three problems from client projects, solved with working demos.

Why the open-source version

€0FreeApache 2.0 licence. No monthly bill.
▢No serverThe whole database is a folder of files.
↺Every change keptAutomatic versions: open or restore any past state.
⌂Data stays yoursRuns on your own machine or your own cloud storage.
Fig. 01Metadata added after embedding

The documents are already embedded. Weeks later we need the judge, the amount and the dates.

Input3 court judgments (2 from the Italian tax court, 1 from the EU Court of Justice), cut into 13 chunks and embedded. Later, 6 variables are added per judgment.
What happensThe variables are added as columns, with one write per judgment. Every chunk from that judgment receives them. Nothing is re-embedded.
OutputSearch by meaning and by the new variables together: “late VAT penalty, amount over €10,000, in force since 2025”.
Today: 3 judgments → 13 chunks embedded. Each chunk keeps only its document ID. No judge, no amount, no dates.

IT-TAX-001Italian tax court

IT-TAX-001#1Appeal against a VAT assessment for 2019.Dr. Rossi · €48,500 · in force 2025-06-10
IT-TAX-001#2The tax office claimed late VAT payment and applied penalties.Dr. Rossi · €48,500 · in force 2025-06-10
IT-TAX-001#3The company argued the delay was not intentional.Dr. Rossi · €48,500 · in force 2025-06-10
IT-TAX-001#4The court rejected the appeal and confirmed the penalty.Dr. Rossi · €48,500 · in force 2025-06-10
IT-TAX-001#5Legal costs charged to the company.Dr. Rossi · €48,500 · in force 2025-06-10

IT-TAX-002Italian tax court

IT-TAX-002#1Corporate income tax on transfer pricing.Dr. Bianchi · €7,200 · in force 2025-02-03
IT-TAX-002#2The tax office recalculated intercompany prices.Dr. Bianchi · €7,200 · in force 2025-02-03
IT-TAX-002#3The court partially accepted the appeal.Dr. Bianchi · €7,200 · in force 2025-02-03
IT-TAX-002#4Interest due from the original assessment.Dr. Bianchi · €7,200 · in force 2025-02-03

EU-CJEU-001European Court of Justice

EU-CJEU-001#1Preliminary ruling on the VAT Directive.Chamber 3 · €0 · in force 2025-01-23
EU-CJEU-001#2Right to deduct input VAT with a non-compliant supplier.Chamber 3 · €0 · in force 2025-01-23
EU-CJEU-001#3Deduction cannot be refused without proof of fraud.Chamber 3 · €0 · in force 2025-01-23
EU-CJEU-001#4Authorities must respect fiscal neutrality.Chamber 3 · €0 · in force 2025-01-23
doc_idjudgeoutcomeamount dueissuedin forcecourt
IT-TAX-001Dr. Rossiappeal rejected€48,5002025-03-122025-06-10CGT Milano
IT-TAX-002Dr. Bianchipartially accepted€7,2002024-11-052025-02-03CGT Roma
EU-CJEU-001Chamber 3deduction allowed€02025-01-232025-01-23CJEU

In Pinecone the labels are stored in each vector. Adding one later means finding and rewriting every vector of that document. Here each chunk is a table row, and one update covers all the rows of a document. The only requirement upfront is to store the document ID on each chunk.

Fig. 02Hybrid search: exact code plus meaning

A VAT number must match exactly. A description only has to mean the same thing.

Input47 bank and card payments. Search: VAT LU26375245 + “cloud hosting servers” + outgoing payments since August.
What happensAn exact keyword search and a semantic search run in the same query, with the SQL filter applied first, and the results are merged.
Output5 payments: 4 to AWS found by the exact VAT number, 1 to Contabo found by meaning.
Exact code: finds every payment with VAT number LU26375245, all to AWS. It cannot find a supplier by meaning.

Exact keywordVAT LU26375245

TX0017AWS · Aug
TX0025AWS · Sep
TX0033AWS · Oct
TX0041AWS · Nov
TX0018Contabo · Aug
TX0019HeyGen · Aug
TX0022Google Workspace · Aug
TX0031Uber · Sep

Meaning“cloud hosting servers”

TX0017AWS · Aug
TX0025AWS · Sep
TX0033AWS · Oct
TX0041AWS · Nov
TX0018Contabo · Aug
TX0019HeyGen · Aug
TX0022Google Workspace · Aug
TX0031Uber · Sep

Resultmerged · since Aug · outgoing

TX0041AWS · Nov
TX0033AWS · Oct
TX0017AWS · Aug
TX0025AWS · Sep
TX0018Contabo · Aug
Fig. 03A supplier profile that keeps every version

The AI checks the supplier profile every month. Only changes that last 3 months trigger an update, and every version is kept.

Input12 months of invoices from one supplier, summarised in 6 dimensions: volume, price per kg, material, invoices per month, cost centre, payment days.
What happensEach month the AI compares the invoices with the profile. A difference that lasts 3 months in a row changes the profile and creates a new version. A shorter difference is logged as an outlier.
OutputA profile that follows trends and ignores one-offs, with past states that show why each invoice was booked that way.
Dec 2025profile version 1
DecJanFebMarAprMayJunJulAugSepOctNovVolume / monthPrice per kgMain materialInvoices / monthCost centrePayment days
matches the profileoutlier, logged only3 months in a row: profile changed
Dec 2025: all 6 dimensions match the profile. Nothing to do.
DimensionProfile valueSinceSet by
Volume / month€20,000Dec 2025human
Price per kg€1.10Dec 2025human
Main materialsteel S235Dec 2025human
Invoices / month2Dec 2025human
Cost centreProductionDec 2025human
Payment days60Dec 2025human
Booked with the March profile (version 1): steel S235 at €1.10/kg, cost centre Production. Today’s profile (version 3) says steel S355 at €1.38/kg. Both versions are kept automatically, so you can still check which profile the March booking used.
Fig. 04Comparison

LanceDB vs pgvector vs Pinecone: a feature comparison.

PineconePostgres + pgvectorLanceDB (open source)
Add a label after embeddingRewrite each vectorYes, one SQL updateYes, one update
Exact code + meaning in one queryPartlyYes, with setupYes, built in
Every version kept, with no extra designNoYou build history tablesYes, automatic
Server neededCloud service, paidYes, a database serverNo, a folder of files
CostMonthly billFree softwareFree (Apache 2.0)

Postgres with pgvector also solves the problems in Fig. 01 and Fig. 02. What LanceDB adds: every version of the data is kept automatically (Fig. 03), and the whole database is a folder of files, with no server.

The three demos run on a normal PC with free software. Sample data only.

More on the method: four levels of AI autonomy · one AI answer, shown two ways.

Book a 30-minute call