zht475706171/TaiSang
About
A private AI agent that learns your habits
AI & Machine LearningMeasured star growth
- in 24h
- 0
- in 7 days
- -1
- in 15 days
- -1
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README_EN.md
Original
๐ค TaiSang
็ฎไฝไธญๆ | English
Your private agent ยท Learns your habits
A personal AI agent that summarizes your habits โ reads and writes code, runs commands, calls tools, and learns your preferences and workflow along the way.
Status: v0.1 โ REPL + Web UI dual entry, with Skill system + multi-agent scheduling + MCP client + user profile
๐ Quick Start
Install
pip install -e ".[web,dev]"
Configure LLM
Supports any OpenAI-compatible endpoint (DeepSeek / Kimi / OpenAI / self-hosted ollama, etc.).
Option 1: ~/.taisang/settings.json
{"llm": {"base_url": "https://api.deepseek.com", "api_key": "sk-xxx", "model": "deepseek-chat"}}
Option 2: Environment variables
export TAISANG_LLM_BASE_URL=https://api.deepseek.com
export TAISANG_LLM_API_KEY=sk-xxx
export TAISANG_LLM_MODEL=deepseek-chat
Run
# Web UI (auto-opens browser)
taisang web
# Specify working directory
taisang web --repo ~/repos/my-project
# CLI REPL
taisang chat
taisang chat --repo ~/repos/my-project
First Run in 3 Steps
- Configure LLM key โ open the Web UI, click the โ๏ธ button in the top-right corner, fill in model / api_key / base_url, and save. Takes effect immediately.
- Import project โ click the
+button on the left of the input box โ "ๅฏผๅ ฅ้กน็ฎ" โ pick your repo in the system directory picker. It becomes the session's working directory. - Start chatting โ state your goal in natural language; the agent invokes tools on its own to read, edit, and run code.
๐ Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TaiSang โ
โ โ
โ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ CLI REPL โ โ Web UI โ โ
โ โ taisang chat โ โ Vue 3.5 + Vite + TDesign โ โ
โ โโโโโโโโฌโโโโโโโโ โ Sidebar / ChatView / ConfigModalโ โ
โ โ โโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ SSE (15 AgentEvent) โ
โ โ โ โ
โ โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ โ
โ โผ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Agent Core (main loop, per-iteration order) โ โ
โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ Context Management (3 gates, pre-LLM) โ โ โ
โ โ โ โข tool-result-budget โ spill large to disk โ โ โ
โ โ โ โข autocompact โ LLM summary compress โ โ โ
โ โ โ โข session memory โ long-term, zero inject โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โผ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โก LLM call (chat_stream) โ โ โ
โ โ โ โ produces text / reasoning / tool_calls โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โผ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โข Tool execution (ToolRegistry) โ โ โ
โ โ โ 6 built-in: Read/Grep/Glob/Edit/Write/Bash โ โ โ
โ โ โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโ โ โ โ
โ โ โ โ Skill โ โ Agent โ โ MCP โ โ 3 ext โ โ โ
โ โ โ โ Tool โ โ Tool โ โ Tool โ โ โ โ
โ โ โ โโโโโโฌโโโโโ โโโโโโฌโโโโโ โโโโโโฌโโโโโ โ โ โ
โ โ โ โ โ โ โ โ โ
โ โ โ โโโโโโผโโโโโ โโโโโผโโโโโโ โโโโโผโโโโโโโโโโโ โ โ โ
โ โ โ โ Skills โ โ Agents โ โ MCP Manager โ โ โ โ
โ โ โ โ 3-sourceโ โ 4 built โ โ stdio + sse โ โ โ โ
โ โ โ โโโโโโโโโโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ observation โ โ
โ โ โโโโโโโโ โ โ
โ โ โ next iter โ back to โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ โ
โ LLM Client (any OpenAI-compatible) โ
โ DeepSeek / Kimi / OpenAI / Ollama / MockLLM โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Personalization (injected across the loop) โ โ
โ โ โข user_profile โ learns your stack / style / comms / envโ โ
โ โ โข TodoWrite โ task tracking, sticky progress at top โ โ
โ โ โข Prompt mgr โ 4 core prompts, visual editing in UI โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โจ Features
Agent Core
- Main loop: LLM โ 6 tools loop until a final answer is produced
- Persistent shell: Bash
cdpersists across calls; dangerous commands blacklisted (rm -rf /,mkfs, force-push to main, fork bomb, etc.) - Streaming output: LLM response streams chunk-by-chunk (text + thinking reasoning) on both Web and CLI
- Instant abort: cancel signal propagates end-to-end โ UI feedback instant, HTTP connection truly closed, running Bash killed + restarted, millisecond latency
- Tool confirmation: Web pops a confirmation card before Edit/Write; CLI uses y/n prompt
- Permission model: first access to a new directory prompts for approval; approved subtrees are allowed
- TodoWrite task tracking: LLM proactively breaks down todos for complex tasks (3+ steps); sticky progress bar at top; rebuilt from jsonl on resume
Skill System (Progressive Disclosure)
SKILL.mddirectory format, frontmatter definesname/description/when_to_use/allowed_tools- Three sources:
project > user > systemproject:<repo>/.taisang/skills/user:~/.taisang/skills/system: built-incommitandreview
- Loaded fully at startup; SYSTEM_PROMPT injects only a lightweight listing (โค250 chars per entry, degrades gracefully)
- Web management:
/skillspage supports table, enable toggle, reload, import (MD / zip), delete
Multi-Agent Scheduling (M3)
Agent({subagent_type, prompt, run_in_background})spawns a sub-agent- 4 built-in agents:
general-purpose/explore(read-only) /plan(read-only) /verification(adversarial, async by default) - Two modes: with
subagent_typeโ Mode A (fresh context); without โ Mode B (fork parent messages) - Sync + async execution; async results inject into the main loop
AGENT.mddirectory format, three sources,/agentsmanagement page- Recursion guard: AgentTool physically unregistered for children +
is_fork_childflag blocks fork-in-fork
MCP Client
- Integrates third-party MCP servers; injects their tool / resource / prompt into the agent tool registry
- Two transports:
stdio(local subprocess) +sse(HTTP+SSE) - Each MCP tool registered as
mcp__<server>__<tool>; LLM calls go throughmanager.call_tool() /mcpmanagement page: CRUD, enable/disable, reconnect, 3 quick-add modes (CLI one-liner / JSON text / file upload, claude-codemcpServersformat compatible)
Personalization
- User profile: single-column markdown, segmented by
### ๆๆฏๆ / ไปฃ็ ้ฃๆ ผ / ๆฒ้ / ็ฏๅข / ็ฆๅฟ; agent auto-updates when discovering preferences - Zero cache waste: updates don't touch the current session; injected only at autocompact and new session startup
- History:
~/.taisang/profile_history.jsonlstores the last 5 snapshots; rollback supported /profilemanagement page: full edit + reset to default + rollback + history
Prompt Management
- 4 core prompts, visually editable in the UI, persisted to
~/.taisang/settings.json:system_prompt/autocompact_prompt/session_memory_template/session_memory_update_prompt
- Reset to default supported;
system_promptchanges broadcast to all active sessions instantly /promptsmanagement page
Web UI / CLI
- Web UI (Vue 3.5 + Vite + TDesign): multi-session sidebar, Claude-style unified input, Markdown + code highlight + collapsible tool cards, SSE real-time event stream
- CLI (
taisang chat): REPL with/exit//reset//debug
Observability
- Token usage: per-turn + session cumulative
- /debug mode: prints full messages + response + tool observations sent to the LLM
- 15 AgentEvent types: CLI and Web UI share the same rendering logic
๐บ๏ธ Roadmap
Ordered by priority:
High priority
- Slash Commands:
/commit,/reviewand other slash commands (previously reverted, to be redone) - Batch skill import: currently one skill per zip; extend to N
- Hooks: PreToolUse / PostToolUse / SessionStart and other hooks
- Plugin manifest + marketplace:
plugin.jsonparsing + plugin marketplace
Skill enhancements
- Runtime SKILL.md hot-reload (currently requires a new session)
- Advanced frontmatter fields (
version/model/context:fork/agent/paths/argument-hint) - Fork execution: run skills inside a sub-agent
Web UI
- Dark theme / theme switching
- Mobile responsiveness
- Auto-reconnect on EventSource drop
Agent behavior
- Image / multimodal input (text-only for now)
- Resume interrupted sessions (process death kills the session; todos already support resume)
Engineering
- i18n: UI text is currently hardcoded in Chinese
๐ Acknowledgements
Thanks to Claude Code and Trae for design inspiration, and to the MCP protocol for enabling a shared tool ecosystem.
If TaiSang helps you, please โญ Star to support it!
github.com/zht475706171/TaiSang
License
MIT
Explore related projects
Loadingโฆ