How ggxj-php/taffy-agent works
Taffy is a tool-using conversational agent with terminal and web interfaces. A user message enters the agent loop, which streams model output, dispatches requested tools, and returns the resulting answer; the web app exposes that same agent through SSE. Major branches include web research, sandboxed coding and file work, specialist computing tools, and a local hybrid-search knowledge base. The web product also provides context management, session archives, stickers, and administration. Some web and knowledge-base internals were not sampled, so only documented or evidenced links are shown.
Main entry points: __init__.py Tool registry · core.py Agent loop · app.py Web API · admin.py Admin console
Components 27
Conversation runtime
- Terminal entry
agent.py - Agent loop
taffy/core.py - Context compression
taffy/context.py - Runtime settings
taffy/settings.py
Knowledge retrieval
- Knowledge search tool
taffy/tools/kb.py - Hybrid KB index
taffy/kb/index.py - Document loader
taffy/kb/loader.py - Query translation
taffy/kb/translate.py - Vector embeddings
taffy/kb/embed.py
Agent tools
- Tool registry
taffy/tools/__init__.py - Web research
taffy/tools/search.py - Workspace guard
taffy/sandbox.py - File operations
taffy/tools/files.py - Code runner
taffy/tools/runner.py - Digital forensics
taffy/tools/forensics.py - 8086 simulator
taffy/tools/asm86.py - Computing tools
taffy/tools/calc.py
Web experience
- Browser client
taffy/web/static/app.js - Web API
taffy/web/app.py - Session archives
taffy/web/sessions_store.py - Sticker library
taffy/web/stickers.py
Management
- Admin console
taffy/web/admin.py - Content management
taffy/web/content.py - Update service
taffy/web/update.py
Other components
- User
- Chat model API
- Host system
Connections 30
- User → Terminal entry: runs
- Terminal entry → Agent loop: starts
agent.py - User → Browser client: chats
- Browser client → Web API: sends messages
- Web API → Agent loop: streams events
taffy/web/app.py - Agent loop → Chat model API: requests completions
- Agent loop → Tool registry: dispatches tools
taffy/core.py - Agent loop → Context compression: compresses history
taffy/core.py - Context compression → Chat model API: summarizes via
taffy/context.py - Agent loop → Runtime settings: loads persona
taffy/core.py - Tool registry → Web research: registers
taffy/tools/__init__.py - Tool registry → File operations: registers
taffy/tools/__init__.py - Tool registry → Code runner: registers
taffy/tools/__init__.py - Tool registry → Digital forensics: registers
taffy/tools/__init__.py - Tool registry → 8086 simulator: registers
taffy/tools/__init__.py - Tool registry → Computing tools: registers
taffy/tools/__init__.py - Tool registry → Knowledge search tool: registers
taffy/tools/__init__.py - File operations → Workspace guard: checks paths
taffy/tools/files.py - Code runner → Workspace guard: checks paths
taffy/tools/runner.py - Knowledge search tool → Hybrid KB index: searches
- Hybrid KB index → Document loader: parses documents
taffy/kb/index.py - Hybrid KB index → Query translation: translates queries
taffy/kb/index.py - Hybrid KB index → Vector embeddings: embeds chunks
taffy/kb/index.py - Web API → Session archives: saves and imports
taffy/web/app.py - Web API → Sticker library: lists stickers
taffy/web/app.py - Web API → Admin console: mounts admin
taffy/web/app.py - Admin console → Runtime settings: updates configuration
taffy/web/admin.py - Admin console → Update service: checks updates
taffy/web/admin.py - Admin console → Content management: manages content
taffy/web/content.py - Admin console → Host system: reads metrics