How copilotkit/opentag works
OpenTag is a self-hosted knowledge-work agent for Slack and Microsoft Teams. A user starts work in a channel thread or with a slash command; the Channels runtime forwards the request to the Python LangGraph agent, which can research, use connected apps, or perform coding work. Results return as thread replies and generative UI. Mutating connected-app actions can pause for human approval and resume. The README documents the major capabilities; some subsystem links below rely on that documentation because their implementation was not sampled.
Main entry points: agent.py Knowledge agent · tools.py Composio tools · repository_tools.py Repository tools · runtime-host.ts Node runtime
Components 22
Channel Experience
- Channel lifecycle
app/channel.tsx - Slash commands
app/commands/index.ts - Node runtime
app/runtime-host.ts
Agent Workflow
- Agent API
agent/main.py - Knowledge agent
agent/agent.py - Web research
agent/prompts/web_search.py - Internal sources
agent/internal_sources.py
Connected Capabilities
- Coding agent
agent/coding/subagent.py - Repository tools
agent/coding/repository_tools.py - Coding sandbox
agent/coding/sandbox.py - Composio tools
agent/composio_tools/tools.py - Actor identity
agent/composio_tools/state.py - Composio sessions
agent/composio_tools/sessions.py - Arcade tools
agent/arcade_tools/tools.py
Human Interaction
- Write approval gate
agent/write_confirmation.py - Approval UI
app/human-in-the-loop/confirm-write.tsx - Generative UI
app/tools/block-catalog.tsx
Other components
- Channel user
- Slack / Teams
- Web search provider
- Connected app services
- GitHub
Connections 24
- Channel user → Slack / Teams: messages in
- Slack / Teams → Channel lifecycle: delivers events
- Channel lifecycle → Node runtime: runs channel
- Channel user → Slash commands: invokes command
app/commands/index.ts - Slash commands → Node runtime: starts agent run
app/commands/index.ts - Node runtime → Agent API: forwards run
- Agent API → Knowledge agent: serves graph
agent/main.py - Knowledge agent → Web research: uses research tools
agent/agent.py - Web research → Web search provider: searches web
- Knowledge agent → Internal sources: uses source tools
agent/agent.py - Knowledge agent → Coding agent: delegates coding
agent/agent.py - Coding agent → Repository tools: uses repository tools
agent/coding/repository_tools.py - Repository tools → Coding sandbox: executes in
agent/coding/repository_tools.py - Knowledge agent → Composio tools: registers tools
agent/agent.py - Knowledge agent → Arcade tools: registers tools
agent/agent.py - Composio tools → Actor identity: reads actor
agent/composio_tools/tools.py - Composio tools → Composio sessions: uses sessions
agent/composio_tools/sessions.py - Composio tools → Connected app services: executes actions
- Arcade tools → Connected app services: executes actions
- Knowledge agent → Write approval gate: gates writes
agent/write_confirmation.py - Write approval gate → Approval UI: requests confirmation
- Approval UI → Knowledge agent: resumes run
- Knowledge agent → Generative UI: returns native UI
- Repository tools → GitHub: publishes changes
agent/coding/repository_tools.py