Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
bb5fa90
docs: add design doc for chat history RAG, nightly summarization, and…
claude Mar 14, 2026
8e823d7
docs: add implementation plan for chat history RAG, summarization, an…
claude Mar 14, 2026
2343327
docs: add design doc for LLM streaming and RAG query rewriting
claude Mar 15, 2026
9d03f91
docs: add implementation plan for streaming and query rewriting (Task…
claude Mar 15, 2026
2db54f9
feat(memory): add is_summarized migration, conversation-scoped search…
claude Mar 15, 2026
8313692
feat(rag): auto-inject semantically relevant past messages into syste…
claude Mar 15, 2026
edc5c21
feat(summarizer): nightly LLM-based conversation summarization via cr…
claude Mar 15, 2026
4bc97cc
feat(memory): add summarizer helpers and LlmClient Clone derive
claude Mar 15, 2026
92fe022
feat(tool-notifier): add ToolCallNotifier struct and ToolEvent channe…
claude Mar 15, 2026
5780661
feat(telegram): add /verbose command for tool call UI, wire ToolCallN…
claude Mar 15, 2026
5a7afa9
feat(telegram): add /verbose command for tool call UI, wire ToolCallN…
claude Mar 15, 2026
7fa3f58
feat(query-rewriter): add rewrite_for_rag() to disambiguate follow-up…
claude Mar 15, 2026
78ad176
feat(rag): wire query rewriter into auto_retrieve_context — rewrites …
claude Mar 15, 2026
57a5c41
feat(llm): add chat_stream() with SSE parsing for token-by-token stre…
claude Mar 15, 2026
c7001e4
feat(llm): add chat_stream() with SSE parsing for token-by-token stre…
claude Mar 15, 2026
3829807
feat(agent): add stream_token_tx to process_message — streams final r…
claude Mar 15, 2026
59e7639
test(telegram): add test_should_split_stream_at_4000_chars for stream…
claude Mar 15, 2026
78ab38d
feat(telegram): add streaming receiver task — progressively edits Tel…
claude Mar 15, 2026
4d74cb1
docs: add plan for fixing Telegram streaming no-response bug
claude Mar 15, 2026
8fc0ac6
test: failing test documents zero-width-space placeholder bug
claude Mar 15, 2026
8754115
fix: replace zero-width-space placeholder with lazy first-send in str…
claude Mar 15, 2026
8fe9d01
fix(tool-notifier): persist tool summary instead of deleting status m…
claude Mar 15, 2026
b71bb12
Merge remote-tracking branch 'origin/main' into claude/chat-history-r…
chinkan Mar 17, 2026
1a83664
test(tool_notifier): add failing tests for multibyte UTF-8 truncation
chinkan Mar 17, 2026
e6dcad5
test(tool_notifier): clarify test names and comments for UTF-8 trunca…
chinkan Mar 17, 2026
f57f9a9
fix(tool_notifier): use char-safe truncation to prevent UTF-8 boundar…
chinkan Mar 17, 2026
be44a36
docs(README): document streaming, RAG, summarization, query rewriter,…
chinkan Mar 17, 2026
57a52ce
refactor(utils): extract truncate_chars to shared src/utils/str.rs
chinkan Mar 17, 2026
202bd21
fix(rag): replace byte-slice with truncate_chars to prevent UTF-8 panic
chinkan Mar 17, 2026
8290dd6
fix(query_rewriter): replace byte-slice with truncate_chars to preven…
chinkan Mar 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tokio = { version = "1", features = ["full"] }
teloxide = { version = "0.17", features = ["macros"] }

# HTTP client for OpenRouter
reqwest = { version = "0.12", features = ["json"] }
reqwest = { version = "0.12", features = ["json", "stream"] }

# Serialization
serde = { version = "1", features = ["derive"] }
Expand All @@ -32,6 +32,7 @@ anyhow = "1"

# Async utilities
futures = "0.3"
futures-util = "0.3"

# Async trait support
async-trait = "0.1"
Expand Down
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ A self-hosted, agentic Telegram AI assistant written in Rust, powered by OpenRou
- **Agents Layer** — Isolated agentic mini-loops in `agents/` with their own model, tool whitelist, and `AGENT.md` instructions; invoked via `invoke_agent`, with `read_agent_file`/`write_agent_file` for file I/O and `reload_agents` for hot-reloading
- **Plan Tools** — `plan_create`, `plan_update`, `plan_view` built-in tools let the agent create and manage structured execution plans stored in the sandbox; power the `problem-solver` subagent skill
- **Bundled Subagent Skills** — `code-interpreter` (executes and iterates code snippets) and `problem-solver` (orchestrates multi-step reasoning with plan tools) ship out of the box
- **Streaming Responses** — LLM tokens streamed progressively; Telegram message is live-edited as the response arrives
- **Chat History RAG** — Semantically relevant past messages are auto-injected into each turn's system prompt using vector search
- **RAG Query Rewriting** — Ambiguous follow-up questions are rewritten before vector search for more accurate retrieval
- **Nightly Summarization** — LLM-based cron job summarizes long conversations overnight to keep memory efficient
- **Verbose Tool UI** — `/verbose` command toggles a live Telegram status message showing tool calls as they run
- **Agentic Loop** — Automatic multi-step tool calling until task completion (max iterations configurable, default 25)
- **Per-user Conversations** — Independent conversation history per user

Expand Down Expand Up @@ -207,6 +212,7 @@ Tools from MCP servers are automatically namespaced as `mcp_<server-name>_<tool-
| `/start` | Show welcome message |
| `/clear` | Clear conversation history |
| `/tools` | List all available tools |
| `/verbose` | Toggle live tool call progress display |

## Architecture

Expand All @@ -218,7 +224,7 @@ src/
├── agent.rs # Agentic loop, tool dispatch, scheduling tools; agents/ layer
├── tools.rs # Built-in tools (file I/O, command execution, plan tools)
├── mcp.rs # MCP client manager for external tool servers
├── memory/ # SQLite persistence, vector embeddings
├── memory/ # SQLite persistence, vector embeddings, RAG, query rewriter, summarizer
├── scheduler/ # Cron/one-shot task scheduler with DB persistence
├── skills/ # Skill loader (auto-loads from skills/ directory)
└── platform/ # Telegram bot handler
Expand Down Expand Up @@ -250,6 +256,11 @@ skills/
- [x] Agents layer (`invoke_agent`, `read_agent_file`, `write_agent_file`, `reload_agents` — isolated agentic mini-loops in `agents/` with own model and tool whitelist)
- [x] Plan tools (`plan_create`, `plan_update`, `plan_view` — structured execution plans in the sandbox)
- [x] Bundled subagent skills: `code-interpreter` and `problem-solver`
- [x] LLM streaming (SSE token-by-token, live Telegram message edits)
- [x] Chat history RAG (auto-inject relevant past context per turn)
- [x] RAG query rewriting (disambiguates follow-up questions before vector search)
- [x] Nightly conversation summarization (LLM-based cron job)
- [x] Verbose tool UI (`/verbose` command — live tool call progress in Telegram)

### Planned

Expand Down
Loading
Loading