Wittgenstein Reader: An AI That Understands the Space Between the Propositions

A close reading of a hybrid Python and TypeScript pipeline that turns OCR noise into context-aware philosophical commentary, with a reader UI built to keep the argument moving.

10 min read • View on GitHub • More from EveryInc

A wide editorial scene of numbered proposition cards arranged in a long sequence, with one central card lit by neighboring cards on both sides. Thin threads connect the cards, and a small machine at the edge reads the sequence and outputs a commentary sheet. It explains the article’s thesis that the system understands each proposition through adjacency, not isolation.
The project’s central move is simple and unusual. It treats meaning as something that emerges from neighboring propositions, then builds the whole pipeline around that assumption.
Key Takeaways

Wittgenstein’s Philosophical Investigations resists ordinary reading. The book moves by numbered fragments, sudden turns, and recursive revisions of its own terms. A normal reader can lose the thread fast. This project answers with a simple but sharp idea: do not ask the model to explain a sentence in isolation. Ask it to read the sentence as part of a neighborhood.

The book becomes legible when the unit of reading gets smaller

That is the project’s real contribution. It does not try to flatten Wittgenstein into a tidy summary. It treats each proposition as a node in a chain, then uses the chain to shape the interpretation. The result is closer to scholarly annotation than chatbot Q&A.

Not only the objects of perception and thought but also the subject is a thing for us.

Max Braun, Creator · Wittgenstein 2022

The system’s most important idea is visual. The model is not reading one proposition. It is reading a sliding window of context.


The pipeline has to solve OCR before it can solve interpretation

Before any AI commentary appears, the text has to be cleaned and structured. The repository’s Python scripts handle the ugly part: OCR quirks, line breaks, proposition boundaries, and numbering errors such as mistaken characters that look like z. instead of 2.. That cleanup produces a proposition map the rest of the system can trust.

# Simplified example of the proposition cleanup logic
# Detect proposition starts, normalize OCR errors, and build a structured map

if line.startswith('z.'):
    line = line.replace('z.', '2.', 1)

match = re.match(r'^(\d+(?:\.\d+)*)\.', line)
if match:
    proposition_id = match.group(1)
    proposition_locations[proposition_id] = {
        'start_line': i,
        'text': line.strip()
    }

This matters because the model is only as good as the structure it receives. A philosophy book that behaves like a lattice needs a machine-readable lattice first. The extraction layer is not plumbing. It is part of the argument.

A close-up of a typesetting desk where raw OCR text is being sorted into clean proposition cards. One hand uses a magnifying glass over a malformed number, while another places a corrected card into a numbered stack. It explains how the project turns noisy source text into a structured reading system.
The hidden work happens before the reader ever sees an explanation. OCR errors have to be repaired before the system can think in propositions.

The prompt is built around adjacency, not trivia

The TypeScript side of the stack is where the project becomes editorial. In generateExplanations.ts, the prompt builder sends the current proposition plus the previous and next propositions to Claude. That choice changes the model’s job. It is no longer asked to translate a fragment. It is asked to infer the argument that lives between fragments.

That is why the output feels closer to scholarly synthesis than to generic summarization. The prompt can ask for sentence-by-sentence analysis, section headers, and markdown formatting, but the real constraint is contextual. Each explanation is anchored in the sequence around it.

That is the thing to remember. The project does not retrieve context as a convenience feature. It makes context the unit of interpretation.

Why this matters technically

Generic book chat tools often treat text like a pile of chunks. This system treats text like a path. That difference shows up everywhere: in the extraction pipeline, in the prompt builder, and in the reader UI. The app is not optimized for broad Q&A. It is optimized for reading forward.

ModeUnit of readingStrengthWeakness
Static readerPage or chapterFaithful to the sourceHard to navigate a fragmentary argument
Generic AI summarizerChunk or documentFast and broadFlattens the structure that gives the text meaning
Wittgenstein ReaderProposition clusterPreserves local context and interpretive flowNarrow by design, only as useful as the source structure

The interface behaves like a reading instrument

The front end is not just a skin over the text. It is a set of interaction rules that keep the user inside the argument. URL-synced proposition state makes specific passages shareable. Mobile navigation, thirds click zones, and force-touch style gestures make it easy to move through the text without breaking flow.

That sounds small until you compare it with the usual AI reading experience. Most tools invite detours. This one reduces friction around sequence. It wants you to continue from proposition to proposition, because the interpretation depends on what comes next.

What it is, and what it is not

This project is not a general-purpose AI library. It is not a semantic search demo. It is not trying to replace the text with a chat interface. It is a narrow reading machine built for one difficult book, and that narrowness is the point.

CategoryWhat it looks likeWhat it actually does
AI reading assistantAsk questions about a bookBuilds interpretation from adjacent propositions
Digital humanities archiveStore and browse source materialTurns OCR text into a structured commentary workflow
Generic book appSearch, highlight, and skimEncourages sequential, proposition-first reading

The competitive set makes the difference clearer. General reading assistants can summarize, search, and answer questions across many books. They are useful, but broad. Wittgenstein Reader is deliberately stranger. It cares about one text, one notation system, and one interpretive problem: how to make a fragmentary philosophical book readable without sanding off its structure.