Quickstart

Parseltongue is a formal reasoning library. Every claim traces back to source evidence. It works with LLM agents — they write the formal logic, you steer.

Install

pip install parseltongue-dsl

Get started

Claude Code / Cursor / Aider

Your agent has terminal access. Paste this prompt to bootstrap it with Parseltongue:

Run pip install parseltongue-dsl to install the Parseltongue formal reasoning library. It gives you a CLI called pg.

Run pg learn --help to see available learning paths, then run pg learn <name> for each one listed and read the full output carefully — these are your operational guides for working with Parseltongue. You need to read them fully despite them being quite long.

Once you've read them, tell me what you can now do and ask me what I'd like to work on. Prefer the notebooks feature (pg render) for visualizations. Present rendered HTML to me via open, and organize render results in a dedicated directory (e.g. renders/).

The agent installs the package, reads the learning scripts end-to-end, and starts a conversation with you about what to do next. It now knows how to start the bench daemon, index files, search for evidence, screen for consistency, generate visualizations, and write notebooks. Rendered notebooks and viz outputs go into a dedicated directory for easy browsing.

Claude with Sandboxes

Enable these two sandbox settings first:

Then paste this prompt:

Run pip install parseltongue-dsl to install the Parseltongue formal reasoning library. It gives you a CLI called pg.

Run pg learn --help to see available learning paths, then run pg learn <name> for each one listed and read the full output carefully — these are your operational guides for working with Parseltongue. You need to read them fully despite them being quite long.

Once you've read them, tell me what you can now do and ask me what I'd like to work on. I may upload documents for you to analyze — we can communicate files you can't download via me uploading them directly to the chat, and they will appear in the sandbox where you run pg. Prefer the notebooks feature (pg render) for visualizations you show me.

Same flow — the agent installs, reads the guides end-to-end, and asks what you need. Upload documents (PDF, DOCX, TXT) directly and the agent extracts text, loads them as ground truth, and builds formal analyses. Notebooks (.pgmd) are the best way to see results — the agent renders them to self-contained HTML with cards, layers, and graph views.

Explore it yourself

The package installs a CLI called pg (alias pg-bench). It includes learning scripts — operational guides originally written for LLM agents, but readable by humans too:

pg learn --help
Available skills:
  pg-bench learn kung-fu        # Bench mastery — inspection, search, lens, diagnosis
  pg-bench learn to-connect     # pgmd notebooks — prose wired through with truth

kung-fu covers the bench system: starting a persistent daemon, indexing documents, full-text search with an S-expression query language, consistency screening, and generating interactive HTML visualizations.

to-connect covers pgmd notebooks: literate documents where markdown prose references grounded Parseltongue computations, rendered to self-contained HTML with cards, layers, and graph views.

Read a script with pg learn kung-fu — it prints to stdout. To run a demo:

python parseltongue/core/demos/revenue_reports/demo.py

To start a bench daemon and inspect the core system:

pg-bench serve parseltongue/core/validation/core.pltg &
pg-bench wait
pg screen
pg find "engine"
pg eval '(fmt "viz" (scope lens (find ".*")))' > viz.html

After setup

The agent will ask what you want to work on. Here are some starting points:

Analyze a document

I've uploaded q3_report.pdf. Extract the text with pdftotext, load it into Parseltongue, and build a grounded analysis. Check whether the revenue growth claims are internally consistent.

Run a demo

Run the revenue_reports demo from parseltongue/core/demos/revenue_reports/demo.py and walk me through what happens at each phase — especially the consistency report and the diff.

Screen an existing project

Start a bench session on main.pltg with pg start main.pltg --user "Me" --assistant "Claude", then run pg screen and explain what the issues mean.

Write a notebook

I want to write a pgmd notebook analyzing this document. Create a project structure with main.pltg, extract facts with verified quotes, build derivations, and render it to HTML with pg render.

Learn more

For the human side — what Parseltongue is, why it exists, and why LLMs making ungrounded claims is an engineering problem — start with Construct. The Follow the White Rabbit scenario walks through the system from first principles.

For worked examples across different domains, see Demos.