Operations
Agent System
AI agent capabilities, how to use it, what it can and cannot do
What This Does
The AI Agent is an assistant that can query platform data, look up contacts and leads, check pipeline status, and answer questions about workspaces. It uses Claude (Anthropic) with tool-calling to access Supabase data.
How To Use It
- Go to Agent in the sidebar
- Type a question or command in the chat input
- The agent processes your request using available tools
- Results appear in the conversation thread
What It Can Do
- Look up contacts, leads, and campaign data by workspace
- Check pipeline status and counts
- Query the
pipeline_stats_cachetable for month-over-month comparisons - Search for specific leads by email or name
- Summarize workspace activity
What It Cannot Do
- Modify data (read-only access)
- Run pipeline stages or restart workers
- Access external APIs (Bison, Debounce) directly
- Perform SQL aggregations (COUNT, SUM) — PostgREST doesn't support SQL functions
- Access tables not listed in its system prompt
Important Limitations
- Token limits: Tool outputs are truncated to under 2K tokens to avoid context overflow
- Table awareness: The agent only knows about tables listed in its system prompt (
backend/app/tools/system_prompt.md). New tables must be added there. - Model: Uses Haiku 4.5 by default for cost efficiency (90% of Sonnet performance at 3x lower cost)
Common Issues
| Symptom | Cause | Fix |
|---|---|---|
| Agent says it doesn't have access to that table | Table not in system prompt | Add table to backend/app/tools/system_prompt.md |
| Prompt too long error | Previous tool results too large | Start a new conversation thread |
| Agent gives wrong numbers | Used name-based search instead of pipeline_stats_cache | Ask specifically: use pipeline_stats_cache to get X |
| Slow responses on beta | Nginx SSE timeout | Known issue — beta nginx needs proxy_read_timeout 300s |
Related Alerts
- Agent System module on Status Page shows: active threads, P95 latency, token usage, tool success rate