dhamma
guide
A local, private AI companion for Theravāda Buddhist practice — ask questions of your library, get cited answers.
Python · LanceDB · sentence-transformers · Claude
Try it →Full walkthrough — ask questions of your library, get cited answers
A local RAG tool for practitioners of Theravāda Buddhism. You populate a library with texts from the teachers you study — sutta collections, teacher commentaries, personal notes. When you ask a question, it retrieves the most relevant passages from your library, hands them to Claude as context, and returns a cited answer. Your books stay on your machine. The only data that leaves is your question and the retrieved passages.
I came to Dhamma as a young person, mostly out of necessity. I was struggling with mental health, with the ordinary agonies of attachment, and with a home life that wasn't always steady. Finding the teachings gave me a framework for understanding what I was experiencing — and, for the first time, a sense that there was a way through.
Since then I've been weaving Dhamma into my life in a mostly self-directed way, learning through reading, practice, and proximity to good teachers. Living in Ottawa, I've been fortunate to have Tisarana monastery close by — a Theravāda community in Ontario with deep roots in the Thai forest tradition. That proximity eventually led to extended stays there and at Birken Forest Monastery in British Columbia, where I got my first real taste of what sustained monastic practice feels like.
More recently, I became a caregiver for my father through a terminal illness that came on suddenly and without warning. That experience cracked things open. The teachings I'd been working with intellectually became something I needed in a much more immediate way — a way to meet grief, impermanence, and a quality of suffering I hadn't had to face before. Caregiving brought me back to Dhamma more seriously than anything else had.
This project came out of all of that.
This project grew out of a specific gap I kept running into. I spent time living and practicing at a monastery, and even there — surrounded by people with deep experience — getting direct answers to practice questions wasn't always easy. Monastic life involves a lot of silence and independent work. You read, you sit, you figure things out mostly on your own. When questions did come up, the answer was usually "go read this."
Back in lay life, that gap only widened. I wanted something that could meet me at the end of a sit and help me think through what came up — not as a replacement for a teacher or a sangha, but as a knowledgeable companion. Something like a well-read friend who has studied the same teachers I have and can point me toward the relevant passage, the right chapter, the talk that addresses what I'm circling around.
Forums like Reddit's r/theravada or Dhamma Wheel fill some of this role, and they're genuinely useful. But I wanted something conversational, immediate, and drawn specifically from sources I already trust — not a crowd of strangers with varying levels of understanding, but the books already on my shelf.
“It’s more like having a pen pal who has read everything you’ve read and can help you find your way back to the part that matters. A companion for the practice, not a substitute for it.”
dhammaguide is a retrieval-augmented generation (RAG) tool you run on your own machine. RAG means the AI doesn’t answer from memory — it first searches your library for relevant passages, then uses those as its source material. Open-book rather than closed-book.
Questions are converted into embeddings locally — nothing sent externally. The index returns the chunks most relevant in meaning, not just keyword matches.
Mention a sutta directly — "what does MN 10 say about mindfulness of the body?" — and chunks tagged with that reference are boosted automatically.
The model grounds every response in the retrieved passages and cites them inline. If a question wanders outside your corpus, it says so rather than confabulating.
When you add a book to your library, dhammaguide splits it into overlapping chunks of ~400 tokens. Each chunk is passed through a local sentence-transformers model — all-MiniLM-L6-v2 by default — which converts it into a 384-dimensional vector. Nothing leaves your machine at this stage.
Vectors and their source metadata (book title, page, canonical reference if present) are stored in a local LanceDB table — a columnar vector database that lives as a folder on disk. Fast to query, zero infrastructure, no server process running.
Your question is embedded with the same local model. The top-k most similar chunks are retrieved by cosine distance. If your question contains a canonical reference like "MN 10" or "SN 35.28", chunks tagged with that reference are boosted in the ranking.
The retrieved chunks are assembled into a prompt with instructions to ground every claim in the provided passages and cite them inline. That prompt — your question plus the retrieved text — is sent to the Anthropic API. Your full library never leaves your machine.
The tool ships with a curated SOURCES.md pointing to freely available texts from each teacher — most under CC or dana-based distribution. Supported formats: PDF, EPUB, plain text, and Markdown.
A browser interface is on the roadmap. For now, the terminal keeps things simple, local, and private — no account, no sync, no cloud storage of your practice questions. Your library is a folder on your machine. You own it.
Python · LanceDB · sentence-transformers · Claude · macOS & Linux
