AI chat where every conversation is versioned, branchable, and searchable — powered by AgentStateGraph.
SvelteKit + FastAPI + Rust · Self-host in 60 seconds
Features
Every message is a branch point. Click to fork and explore "what if I'd asked differently?" without losing the original thread. Branches are O(1) — instant creation, instant discard. Compare approaches side by side, then commit the winner.
Every message exchange is a versioned commit with intent, reasoning, and confidence metadata. Query by "why," not just "what." Blame any value to see who changed it, when, and with what reasoning. Powered by AgentStateGraph.
Code blocks with syntax highlighting, tables, headings, lists, links, blockquotes — all rendered inline. Paste images, drop files. Works with Claude, GPT, Gemini, Grok, and local models via Ollama.
Connect MCP servers with one click — filesystem, GitHub, SQLite, web search, and 100+ more. The AI reads files, runs commands, and queries databases. Full agentic loop with automatic tool dispatch and result integration. Opt-in human-in-the-loop approval gates any tool that could have side effects.
src/. The project has a standard SvelteKit structure.Branching is only half the story. Open /compare to see any two branches side-by-side with word-level inline diff — every added, removed, and unchanged word lit up. Turn on merge mode, tick the messages you want from either side, and commit them to a new branch with both parents recorded. Nothing destructive happens to the originals.
Platform
Record via the mic, Whisper transcribes into the textarea. Speaker button on every assistant message uses the browser's TTS — zero deps, offline.
Public read-only URL per conversation. Recipient doesn't need an account. Rotatable, revocable token.
Per-message, per-conversation, and windowed stats (Today / 7d / 30d). Pricing overrides for any model you add.
Drop a Python file in backend/hooks/ or ship a pip package. Four kinds: inlet, outlet, stream, tool.
Markdown, JSON, and PDF for every conversation and for the notebook. PDF is lazy-loaded so the bundle stays lean.
Reusable (system prompt, provider, model) presets. New chat from a template seeds the conversation instantly.
⌘K search, ⌘N new chat, ⌘B sidebar, ⌘⇧C compare, ⌘/ for help.
Flip one env var and every visitor pastes their own key. Keys live in their browser; conversations are per-session with a TTL sweep.
Hardening
Three passes of threat modeling and remediation — envelope integrity on every tool call, secrets encrypted at rest, session isolation for multi-tenant demos, and a reproducible dep graph.
Provider keys and secrets in threadweaver_config.json wrapped with Fernet + PBKDF2-HMAC-SHA256 (600k iterations). Master key via env var or OS keychain — never on disk in plaintext.
Every demo-mode visitor gets their own conversation space, pinned by an X-Demo-Session header. Idle sessions expire on a background TTL sweep so state cardinality stays bounded.
Every tool invocation carries a signed envelope with a trust-taxonomy tag. Replayed envelopes and oversized content payloads are rejected at the boundary before the agentic loop sees them.
backend/requirements.txt uses exact-version pins on every top-level dep; bumps are intentional and reviewed. Capture a full lockfile with pip freeze when determinism matters.
Bring Your Own Key
Architecture
Comparison
| Feature | Typical AI Chat | ThreadWeaver |
|---|---|---|
| Branching | ✗ Linear scroll only | ✓ Fork from any message |
| Compare branches | ✗ Copy/paste into a doc | ✓ Side-by-side view with word-level diff |
| Merge branches | ✗ Manual only | ✓ Cherry-pick messages into a new branch |
| Provenance | ✗ No history metadata | ✓ Intent, reasoning, confidence per commit |
| Search | ✗ Ctrl+F at best | ✓ Full-text across all conversations |
| Notebook | ✗ Copy-paste | ✓ Tag, comment, branch, export md/JSON/PDF |
| Tool calling | ✗ Chat only | ✓ MCP servers + agentic loop + HITL approval |
| Voice | ✗ Rarely | ✓ Whisper dictation + TTS on every reply |
| Sharing | ✗ Screenshot | ✓ Public read-only link, revocable |
| Cost visibility | ✗ Guess | ✓ Per-message + time-windowed stats |
| Projects | ✗ Flat list | ✓ Group related chats with shared context |
| Multimodal | ✓ Some providers | ✓ All providers + paste / drop / file picker |
| Extensibility | ✗ Fork the app | ✓ Native Python hooks: inlet / outlet / stream / tool |
| Self-hosted | ✗ Cloud only | ✓ Docker + auto-HTTPS overlay, ARM64 |
| BYOK | ✗ Subscription required | ✓ Bring your own API keys (demo mode: per-visitor) |
Get Started
docker compose up -d
Backend + frontend, one command
docker compose -f ... up -d
Add local models (Llama, Mistral, Qwen)
pip install && npm run dev
ARM64 / Jetson / PicoClaw ready
Powered By
Tamper-evident epoch — every commit hashed, the chain verifiable offline