Passage-level reading
Keep the explanation beside the passage.
Bhasya imports a public page into a document you can read by passage. Select a sentence, ask for an explanation, and return to the same thread with its source and citations still attached.
Staging preview. This staging demonstration uses an operator-provisioned account. Do not use sensitive material.
The reading problem
A chat window is not a reading surface.
Copying a passage into a general chat detaches the answer from the document. The answer has no stable address, so returning later means reconstructing the context by hand.
Bhasya treats the document as the primary object. Explanations, highlights, threads, evidence, and citations reference passages by stable identifiers, not a detached transcript.
The product
A passage, not a detached transcript.
The reading surface keeps the source in view while the explanation stays tied to the exact text you selected.
Import. Select. Explain. Reopen.
A public URL is fetched, normalized into a document node tree, and stored as an immutable version. Selecting text resolves an anchor with the passage, offsets, structural path, text hash, and context fingerprint.
The passage thread and highlight reference that anchor. A citation resolves back to the cited passage, so reopening the document restores the source context rather than a detached chat log.
What stays attached
The explanation keeps its source.
- Highlights
- Persisted highlights render as marked slices of passage text and appear in the reader's highlight list. An explanation creates the highlight for its anchor. The reader has no separate highlight-only control.
- Passage threads
- Each anchor has a passage-scoped thread. Messages are append-only, and follow-up turns stay with the same passage.
- Evidence and citations
- An assistant message records evidence for the exact passage, a citation with the passage locator, and up to two nearby evidence rows. Citations navigate back to the passage in the document.
- Reopening
- Threads reload with their messages and citations. A source without a version is shown as Not ready in the library.
Reading continuity
Return to the exact place.
Reading progress is saved for the authenticated user and the current document version. When a saved position exists and is not at the beginning, the reader offers Resume reading or Start from beginning.
It does not jump automatically before you choose. A new immutable version starts without a saved position.
Reading-session export
Keep the reading session.
Export produces the article plus a Bhasya Reading Session appendix. The export includes threads created by the caller and the messages recorded in those threads, together with their evidence and citations. Generation is synchronous in this version, and PDF work stays server-side.
The export is not a full visual facsimile. Figures and images from the original page are omitted, captions render as text, and oversized appendices are truncated with an explicit note.
Architecture and privacy
The document is the source of truth.
The canonical record is a document version with a passage tree. A chat transcript is not the source.
Canonical model
Source
└── DocumentVersion (immutable)
└── DocumentNode tree
└── Passage
└── Anchor
├── Highlight
└── Thread
└── Message
└── Evidence
└── Citation
Reading progress and exports are auxiliary records. They do not change the canonical chain.
Privacy boundary
- Identity comes from Better Auth; workspace and object access is enforced by API authorization and workspace-scoped SQL.
- Source HTML and export artifacts are stored through server-side storage adapters. Export downloads pass through the authorized API. The application does not mint public artifact URLs.
- Imported content is supplied as source material to the explanation workflow and is not executed by the application.
- Explanation uses the selected text, the full L0 passage, and up to three same-section passages. When there are no additional same-section passages, retrieval falls back to full-text matches elsewhere in the same document.
- Bhasya's application event log stores metadata rather than prompts, assistant response bodies, or the full document body. Source URLs and titles may still appear as metadata and can be sensitive. This statement does not describe external model-provider logging or retention.
What the current retrieval does
Explanations use the exact passage (L0) plus nearby same-section passages (L1), with a PostgreSQL full-text fallback. pgvector and an embeddings table are provisioned at the database layer, but the current explanation workflow does not generate embeddings or run vector similarity retrieval.
Current status
Staging, not a public launch.
- Environment
- Staging only. No production deployment is configured in this repository.
- Model
- The passage-thread screenshot shows an explanation labeled
gemini-3.1-flash-lite. The repository default isdev-grounded-1; the repository default does not establish the live Worker's configuration. - Accounts
- This staging demonstration uses an operator-provisioned account.
- Data
- Do not use staging for sensitive material.
Current limitations
- Vector retrieval is provisioned but not active in the explanation workflow.
- PDF export is synchronous and lossy: figures, images, author metadata, tables, and rich links are not preserved.
- Reading progress is per document version. A new version starts without a saved position.
- Ingestion accepts public HTML and text URLs. EPUB, Markdown, and DOCX conversion are deferred, and there is no upload UI.
- The web app is the only client. Browser extension, Tauri desktop, offline sync, collaborative editing, billing, and large-scale export are deferred.
- There is no self-serve account or source deletion flow.
Read the code. Try the staging build.