On the morning of 13 August 2007, Chiara Poggi, 26, was killed in her family's house on via Pascoli in Garlasco, a small town in the province of Pavia. Her boyfriend, Alberto Stasi, found the body. In December 2015 Italy's Supreme Court confirmed his conviction and a sixteen-year sentence. In 2025 a new investigation focused on another man, Andrea Sempio, and in November 2026 the Pavia prosecutor's office asked for him to be indicted as the sole perpetrator of the murder; a preliminary hearing is scheduled for 25 February 2027. A parallel inquiry examines the archiving of an earlier investigation.
I am not going to argue any of that here, that's out of scope1. What matters right here is the paper trail the case has produced over nineteen years, and what it does to a particular AI-managed software that tries to hold it.
That software is an investigation wiki maintained by a language model, and it is public, so you can browse what it has become while you read. This first part is about how it started, from the idea and the design to the way a single document actually makes its way into it, and about the point where that first design began to break.
1. A case that does not fit in one head
When I think about Chiara Poggi’s murder, I cannot help but be reminded of a short novel by Leonardo Sciascia, Una storia semplice. Not only because the two stories bear astonishingly unsettling similarities — a connection that anyone following the case who has also read Sciascia’s work might well recognize — but also because both are, contrary to the title of the Sicilian author’s work, extraordinarily complex affairs. The Garlasco case is still open, and its record is large and adversarial. It includes five judgments and their motivations, expert reports, hearing transcripts, wiretaps, police filings, photographs, and continuous coverage from national and local press. It includes the same hour told two ways, the same footprint read differently by successive experts, a DNA sample consumed by testing in 2014 so that it can never be re-tested, a crime scene contaminated before it was secured, shoes seized nineteen hours late, and a computer whose clock is itself evidence. It includes names spelled inconsistently, witnesses who change their account, and a second investigation that disputes the first on time, dynamics, and motive.
A person can follow one thread at a time, and a language model, although it reads much faster, cannot hold all of it at once either. On top of that, the usual architecture for "chatting with your documents" helps less than it seems: retrieval-augmented generation (RAG) picks the chunks that look most relevant to each question and asks the model to rebuild the answer from them, which is fine for a single lookup, but with a case like this one it means reconstructing the same context (the same people, the same chronology, the same competing accounts of the same morning) every single time, without anything being kept from one question to the next.
So one day I found myself wondering: "What if I tried to have an LLM organize all the textual material related to the case? How much autonomy could it achieve?" and then: "How would it extract the information? Could I query the AI agent to get answers to complex questions in a matter of seconds? Could it even produce estimates of the protagonists' likelihood of being guilty?". What I had in mind, really, was a kind of memory, a case file that would become more structured with every document added to it, and that would keep its contradictions instead of smoothing them over. To be honest, though, the idea of an artificial mind suggesting ideas and proposing solutions was tempting.
2. Not RAG: the pattern behind the project
The starting point was an idea file by Andrej Karpathy, published as a gist titled llm-wiki2 and deliberately written to be pasted into an agent harness such as Claude Code, Codex or OpenCode. Its argument is simple, and once you have run into the problem yourself it feels almost obvious:
Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation.
The alternative it proposes is to let the model maintain a wiki, that is, a directory of interlinked markdown files sitting between the raw sources and the questions. Whenever a new source arrives, the model reads it, extracts what matters, updates the pages of the people and places it mentions, puts the dated events in the right place, flags where the new material contradicts the old, and writes down what it did in a log, so that the knowledge is compiled once and then kept up to date instead of being rediscovered every time.
Karpathy's gist describes three layers (the immutable raw sources, the wiki maintained by the LLM, and a schema document such as AGENTS.md that tells the model how the wiki is structured and which workflows to follow) and three operations: ingest, query and lint. It also contains the sentence that made the whole thing click for me:
Obsidian3 is the IDE; the LLM is the programmer; the wiki is the codebase.
In one line, it describes how the work is split: the human curates the sources, sets the direction and judges the result, while the model takes care of the bookkeeping that people usually give up on. Karpathy then explains why wikis tend to die, and I want to quote this part carefully, because the failure I describe later on started right here:
Humans abandon wikis because the maintenance burden grows faster than the value. LLMs don't get bored, don't forget to update a cross-reference, and can touch 15 files in one pass. The wiki stays maintained because the cost of maintenance is near zero.
I would argue that last statement is rather naive — or, perhaps more accurately, conveniently superficial. The cost may well be close to zero for a single edit, but across a whole corpus the arithmetic stops working, and the gap between those two scales turned out to be the real engineering problem of the project.
The gist is abstract on purpose: it says that the directory structure, the page formats and the schema conventions depend on the domain, and that the right way to use it is to hand it to an agent and build a version that fits. For a criminal case, building that version turned out to be most of the work.
3. Writing my own idea file
Before creating a single folder, I rewrote the gist for the job I had in mind, and the result is a document called LLM Investigation Wiki.md. It is still an idea file, meant to be pasted into an agent and describing a pattern rather than an implementation, but every paragraph of it is bent towards this one case, as its opening makes clear:
When a new source is added, the LLM should not merely index it for later retrieval. It should read it, extract relevant facts, identify entities, connect it to existing events, update the case timeline, revise suspect or witness pages, add or refine hypotheses, and explicitly mark contradictions, uncertainty, and open questions. The resulting wiki is not a general knowledge base. It is a living case file.
A personal wiki can afford to be a bit loose: if a page about a book you read is slightly wrong, you fix it whenever you notice. A case file cannot, because the difference between "a witness said X" and "X is true" is precisely what it is there for, and that is why the document spends most of its length on discipline. It sets out eight principles, four of which carry most of the design:
- Raw sources are immutable. Original files are never edited by the LLM. They are the source record.
- Every important claim should be traceable. Wiki pages should cite the source documents or source excerpts they depend on.
- Facts, claims, and hypotheses must be distinct. A witness statement is not the same as a verified event. A theory is not the same as evidence.
- Contradictions should be preserved, not flattened. If two sources disagree, the wiki should represent that disagreement explicitly.
It then asks that every meaningful statement fall into one of five categories (what a source says, what the evidence directly supports, what is inferred, what is only a hypothesis, and what is unknown), and that pages make that category visible instead of "collapsing everything into a single narrative voice". And since the subject is a homicide involving real people, it closes with a few rules of conduct:
- Never invent evidence, names, dates, motives, or relationships.
- Preserve conflicting versions instead of force-fitting them into a single story.
- Prefer "insufficient evidence," "unclear," or "unverified" over unsupported certainty.
- Avoid turning analytical suspicion into factual accusation.
What the file leaves out is just as deliberate, since there are no fixed templates, no final folder layout and no tooling in it: all of that was meant to come out of a conversation with the agent. So I pasted it into Claude Code, and together we turned it into a design specification, whose first paragraph names the audience I was really designing for:
The primary audience is LLMs: the wiki must enable them to organize sources, extract relevant data, traverse connections, formulate hypotheses, and provide investigative direction. Human investigators use the same vault for browsing and visual analysis.
The specification became an implementation plan, carried out one task at a time: the directory layout, the operating manual, the templates, the indexes. The idea file, the specification and the plan went into the repository together, and the first source followed the same day.
If you want to try this on a subject of your own, I would keep the same order, because the idea file is where you decide what the wiki is for: everything the agent builds afterwards inherits those decisions, and arguing about a principle in a text file is much cheaper than arguing about a convention that has already spread across four hundred pages.
4. From idea file to vault
The vault that came out of that first day is made of three layers, plus a few files that tell the model how to work on them.
flowchart TB
subgraph RAW["raw/ — immutable"]
direction LR
A1[articles]
A2[documents]
A3[transcripts]
A4[datasets and media]
end
subgraph SCHEMA["operating schema"]
direction LR
S1[AGENTS.md]
S2[workflow files]
S3[templates/]
end
subgraph WIKI["wiki/ — LLM-maintained"]
direction LR
W1[sources]
W2[people and locations]
W3[evidence and events]
W4[hypotheses and contradictions]
W5[leads and reports]
W6[overview and timeline]
end
RAW -->|ingest| WIKI
SCHEMA -->|governs every session| WIKI
WIKI -->|query| R[report]
R -->|filed back| WIKIraw/ mirrors the source material by type (articles, court documents, transcripts, datasets, media) and works as a sort of evidence locker, since nothing in it is ever edited. wiki/ is where the synthesis happens, with one directory per page type, while the schema is made of AGENTS.md, the first file every session reads, plus a template for each page type and one workflow file for each operation: ingest, query and audit.

Two decisions taken in the specification ended up shaping everything else. The first was to use two languages on purpose: frontmatter keys and values are in English, while the body text and the section headings are in Italian. The sources are Italian, the case is Italian, and so was the reader I had in mind, but keeping the metadata in English meant that scripts, filters and any future tooling would not have to deal with accents and translations.
The second was to make the wiki a git repository, so that every ingest is a commit, every page has a history, and the state of the case at any point in time can be reconstructed exactly. For something meant to support an investigation, that property is part of the argument, and it is also the reason why in this article I can quote the wiki as it was at the very beginning: everything below comes from the repository's history.
5. Anatomy of a page
The wiki is organized around the kind of question each page is supposed to answer.
| Page type | The question it answers |
|---|---|
| Case overview | What is the state of the case, in one narrative? |
| Timeline | When did it happen, and in what order? |
| Person | Who is this, and what did they do or say? |
| Location | Where, and why does it matter? |
| Evidence | What is this object, where does it come from, what does it show? |
| Event | What happened on this occasion? |
| Hypothesis | Which explanation does the evidence support, and what would break it? |
| Contradiction | Where exactly do two sources disagree? |
| Lead | What is still unknown, and what would resolve it? |
| Source | What does this document actually say, and how reliable is it? |
| Report | What did we conclude from a question, and on what basis? |
Each type has its own template, and the templates matter more than they seem, because they are the contract that makes the wiki readable by a machine. This is the person template exactly as it was committed on the first day (the <% … %> tag belongs to Templater, the Obsidian plugin that fills in today's date when a human creates a page by hand):
The block between the two --- lines is data, which Obsidian shows as a panel of properties and scripts read as YAML. The headings below it (profile, role in the case, actions and appearances in the timeline, attributed statements, associated evidence, open questions, reliability notes) are fixed, and the same goes for every other page type. I preferred pages that all look alike to pages that are pleasant to read, because when every evidence page has the same shape, a model can find the chain-of-custody section without being told where it is.

Confidence shows up twice, once as a field and once inside the text. The confidence field takes one of five values: verified (directly supported by a primary source), claimed (stated by a witness, an article or a party, attributed but not confirmed), inferred (reasoned from multiple facts), speculative (an explicit hypothesis) and unknown (a gap). Source pages also carry a second scale, reliability, which is independent from the first and rates the article itself, since even a careful outlet can pass along a witness's unconfirmed claim.
Inside the text, the five categories from the idea file became inline labels: [FATTO] (fact), [DICHIARAZIONE] (statement), [INFERENZA] (inference), [IPOTESI] (hypothesis) and [SCONOSCIUTO] (unknown). They are not pretty to look at, but I think they are the most useful convention in the whole project, because they force every sentence that looks like a fact to declare what kind of fact it really is. Here is part of Alberto Stasi's page as the first ingest wrote it:
His statements, that he found the body and walked through blood-stained corridors and that he spent the morning working on his thesis, are labelled as statements, while the computer's activity from 9:35 to 12:20, established by forensic analysis, is labelled as a fact. And then there is [CONTESTATO] ("contested"), used for the shoes without blood and for the bicycle pedals: a perfectly reasonable label, except that it is not in the schema, because on the very first ingest the model made up a sixth category when none of the five seemed to fit. Looking back, that small improvisation already contained most of what this article is about. The page has grown a lot since then, and you can read its current version on the public wiki.
Contradictions get pages of their own. When two sources disagree, the disagreement is written down in a separate file with a fixed shape: a description of the conflict, version A, version B, the possible explanations and a resolution status. The first ingest produced four of them. The one on the time of death sets the original autopsy estimate, between 10:30 and 13:00, against the window used by the courts that convicted Stasi, between 9:12 and 9:35, that is between the last time the house alarm was switched off and the moment Stasi's computer started being used continuously. It also notes that the morgue had no scale, so the body was never weighed, lists three possible explanations, and leaves the question open, which is the only honest status it can have.
The timeline is what holds everything together. It has its own entry format, which works like a small version of the case model, since every entry names its participants, its place, its sources, its confidence and any conflict it is involved in. This is one of the thirty-two entries written by the first ingest:
The ~ marks an approximate time and the slash a range, the confidence is inferred, and the note explains why: it is an estimate built on indirect data, and the autopsy contradicts it. The double brackets are Obsidian links, so every entry also adds a few edges to the graph. A timeline that could not express approximation and disagreement would flatten a case like this one into a simple story, which is exactly what it is not.
6. Following one source in
The first document I gave the wiki was the Italian Wikipedia article on the case, a secondary source covering everything from 2007 to late 2025. I started there because I wanted a rough map before going into the details: the encyclopedia provided the cast, the disputed objects and the overall shape of the chronology, and everything that came after would replace, correct or contradict it.
That one article produced thirty-three new pages and touched a dozen more:
flowchart LR
S["Wikipedia article<br/>1 source page"]
S --> P["9 people"]
S --> L["2 locations"]
S --> E["2 events"]
S --> V["9 evidence items"]
S --> H["2 hypotheses"]
S --> C["4 contradictions"]
S --> Q["4 leads,<br/>13 open questions"]
S --> T["32 timeline entries"]
S --> X["overview, index,<br/>9 category files, log"]This ratio is really what the pattern is about, since the model did not store the article away for later retrieval but used it to update the case. The source page keeps track of what was done, and its frontmatter lists every page the article changed:
Have a look at provenance. It was supposed to hold the path of our own archived copy in raw/, but the model put the original web address there instead, and since nothing was checking it, the habit spread to sixty-eight source pages over the following weeks. It took four cleanup scripts to untangle, and the vault's own bug history lists it as the most expensive kind of error in the repository. A schema that nothing enforces is little more than a suggestion, although it took me quite a while to really learn that.
Over the following few days came the primary record, that is the five judgments, from the preliminary hearing ruling in Vigevano through the Milan appeal, the Supreme Court annulment, the second appeal conviction and the definitive Supreme Court ruling. Each of them was ingested as a primary document, with its own source page and its own consequences for the timeline, and after them the wiki stopped being a summary of the case and started to look more like a structured argument about it.
Every ingest followed the same numbered procedure, written down in workflow-ingest.md, which in its final form had twelve steps, numbered from zero to eleven:
- check that the source has not already been ingested;
- read it, and extract facts, claims, entities, dates, and quotations;
- create its source page;
- update the case overview if the picture changed;
- create or update every relevant person, place, event, evidence, and hypothesis page, inserting each dated entry in chronological order;
- add its entries to the master timeline;
- flag contradictions;
- add open questions and leads;
- update the category indexes;
- write the log entry;
- check the work;
- commit.
The log entry for the Wikipedia ingest gives a fair idea of what a single pass meant: the source, thirty-three pages created, thirteen updated, four contradictions found, thirteen open questions added, and the commit message, in Italian of course.
Step ten deserves a closer look. About a month in, I added a checklist that the model had to run on its own work before committing (every touched page indexed, no empty relationship arrays, no empty headings, no bare-integer tags, frontmatter matching the template), and it read pretty much like a code review:
Frontmatter matches the template — for every page type (source, person, event, evidence, location, etc.), compare the frontmatter keys against the corresponding template in
templates/:
- No made-up keys — fields not present in the template (e.g.
source_typeinstead ofsource_class, adding a key that has no template counterpart)- No missing required keys — every key from the template must be present (e.g.
reliabilityon a source page,provenanceon a source page,evidence_typeon an evidence page). Missing keys are errors even if you think they are optional.
It did help, but it was carried out by the same model that had just done the work, in the same context, so in the end it was exactly as reliable as the work it was supposed to check.
When several sources arrived together, the workflow prescribed one subagent per source, run one after the other and never in parallel. The reason was the wiki's shared state: the log, the category indexes and the master timeline would have ended up in merge conflicts if two subagents had written them at the same time, and, as the workflow put it, "the next subagent must start from a wiki that already contains the previous ingest." That shared state, more than anything else, is what eventually pushed the architecture to its limits.
The other two operations were simpler, at least on paper. A query started from index.md, opened the relevant pages, followed their links and answered with citations to the source pages, while an audit looked for broken links, empty relationship arrays, contradictions not yet recorded and outdated summaries. In practice I spent almost all my time on ingest and audit, by my own choice: I barely used queries and never filed a single report, even though the design said that any useful analysis should be filed back into the wiki.
7. Finding your way around
A wiki maintained by a model has to be navigable by a model that remembers nothing from one session to the next, and two kinds of file took care of that. index.md is the catalog, with the state of the case in two or three sentences, the list of categories and the links to the reference pages, while categories/*.md are indexes by page type, one line per page, because the idea file had already warned that a single index would not stay within a few hundred lines. The rule was that a new session had to be able to find its way around in at most four reads: AGENTS.md, index.md, the case overview and the relevant category index.
log.md was the memory of what had been done, an append-only record of every ingest, query, audit and structural change. It served two purposes: it gave me a history of the investigation, and it gave the model a way to avoid ingesting the same article twice, since the duplicate check was, quite literally, "read the last twenty entries".
The human side of the wiki lives in Obsidian, where the plugins only shape the interface and the data stays plain markdown: Templater fills in the templates, Pretty Properties renders the frontmatter as cards, Notebook Navigator gives a folder-first sidebar, obsidian-git syncs the repository, Omnisearch searches the PDFs in raw/, and Dataview builds live tables for me. The model never uses Dataview and reads the same plain markdown I see, which is also why the navigation files are plain text in the first place.

8. What worked
Most of what worked is not particularly exciting: sources that are never modified, a page type for every kind of question, contradictions treated as proper objects instead of footnotes, a timeline that can say "approximately" and "disputed", templates strict enough to be parsed and consistent enough to be trusted, a log that keeps track of what changed, and a starting path short enough that a new session becomes useful after four reads. None of these are tricks specific to LLMs, they are simply the good habits of any serious case file, and they are the reason why the output was worth reading at all.
The pattern itself held up too, since a single article really did turn into thirty-three cross-linked pages in one pass, with its disagreements brought to the surface and its uncertainties labelled. A person doing the same thing by hand for a few hundred sources would have given up long before the end, which is exactly Karpathy's point.
9. Where it broke
By the time I stopped working on the first design, the wiki held 448 source pages and 143 people pages4:
| After the first source | Before the rewrite | |
|---|---|---|
| Source pages | 1 | 448 |
| People pages | 9 | 143 |
| Timeline entries | 32 | 354 |
| Evidence pages | 9 | 33 |
| Contradiction pages | 4 | 13 |
| Raw articles on disk | 1 | 1,106 |
Bear in mind that these numbers were limited only by the amount of free time I had available to dedicate to the project (namely, finding the sources and converting them to Markdown) and, at times, by the usage limits of my Claude and OpenCode subscription plans. It took 422 ingests and 59 audits to get there. By the end, the ingesting had started to slow down and become problematic.
The chart below shows how it grew: the bars are the articles waiting on disk, and the line is the source pages that were actually ingested.
xychart-beta
title "Raw articles on disk (bars) vs. ingested sources (line)"
x-axis ["22/4", "29/4", "6/5", "13/5", "20/5", "27/5", "3/6", "10/6", "17/6", "24/6", "2/7"]
y-axis "files" 0 --> 1200
bar [1, 1, 1, 709, 709, 709, 709, 709, 709, 709, 1106]
line [3, 6, 6, 44, 146, 207, 247, 284, 334, 391, 448]Looking back, the costs of the system came from three places, and only one of them was the model.
The first was reading. The raw corpus was made of PDFs of judgments, long magazine features, transcripts and scanned material, so long sources had to be split into chunks and delegated, with an explicit instruction to keep the context window below forty percent. Reading was the most visible cost, and the easiest one to measure.
The second was maintenance. Every ingest had to update the pages it touched, the timeline, the category indexes and the log, and every update had to preserve chronology, cross-references and frontmatter. The median article touched seven wiki files, and the largest ingest touched thirty-six. This was exactly the cost the pattern promised to eliminate, and it did eliminate the human share of it, but not the work itself, which simply moved into the model's context, where it had to be worked out again from the instructions in every session, and into the schema, which kept growing longer as the failure modes piled up.
The third was sourcing. Finding the articles, converting them to markdown, naming them consistently and filing them in the right directory was all manual work, and it took a large share of the project's time before the agent ever saw a file. The corpus grew in bursts (the two steps in the chart are the archive of La Provincia Pavese, the local paper, and later a batch of articles from Panorama and Libero), and every burst made the queue longer, until it was clear that the backlog was growing faster than I could ingest it.
In the meantime, the files that held the shared state had grown to a size that was starting to work against them:
| Artifact | What it had become | Why it hurt |
|---|---|---|
master-timeline.md | 537 KB, 4,121 lines, 303 entries | read in full on every ingest just to find the insertion point |
log.md | 1 MB, 9,211 lines | verbose entries duplicated page content; append-only made it worse |
case-overview.md | 200 KB, 93% of it a changelog | about 50,000 tokens to read at every cold start |
| Source frontmatter | ~40 distinct keys against 10 in the template | each period of ingests had drifted into its own style |
provenance vs url | conflated on 68 source pages | four cleanup scripts; in 3 of 27 collisions the two were swapped |
tags | bare year integers | Obsidian type mismatch on every affected page |
| Duplicate check | "read the last 20 log entries" | useless against a backlog of 700 articles ingested out of order |
And the distinctions the idea file cared about the most were precisely the ones nothing enforced. An audit found two source pages where a reliability value (high, medium or low) had been written into the confidence field: two different scales, and nothing in the system preventing a model from using one in place of the other, so the mistake had gone unnoticed for seven weeks.
The moment I realized it was a small one. An audit noticed that an ingest had updated the wiki without ever writing its log entry, and rebuilt the entry from the commit. Nothing had failed in any visible way, the work had simply not been done, and the only guarantee that it had been was the word of the same model that did the work and then judged the result.
That was the blind spot of the first design. All of its failures were, in one way or another, the same mistake, which was to use prose as the place where the data lives: indexes, chronologies and timeline entries maintained by hand, and a checklist run by the same hand that had written them. Each of these choices was reasonable with one source and unsustainable with four hundred. In the end Karpathy's sentence holds for a single edit but not for a whole corpus, because the model does not get bored, that is true, but it does run out of context, and keeping hundreds of pages consistent is a problem of the system as a whole, not something you can fix by asking the model to be more careful.
So the first wiki worked better as a case file than as a database, and Part 2 is about turning it into a database without losing what made it a good case file.