Overview
The Agentic Chat Service, known as Zarna AI, provides a natural language interface to query and interact with CRM data using a multi-agent AI system with persistent agent pools. Zarna AI is the intelligent chatbot that understands your questions and retrieves relevant CRM data. Location:scripts/agentic_chat/
Architecture
Directory Structure
Agent Types
Manager Agent
Role: Coordinates other agents and routes queries Capabilities:- Parse user queries
- Determine which agents to invoke
- Aggregate results from multiple agents
- Format final response
Data Retrieval Agent
Role: Fetch data from CRM database Capabilities:- Translate natural language to SQL
- Execute database queries
- Return structured data
- Handle complex joins
Analysis Agent
Role: Perform calculations and analytics Capabilities:- Calculate metrics (growth rates, averages, etc.)
- Compare data points
- Identify trends
- Generate insights
Web Search Agent
Role: Research using external sources Capabilities:- Search the web with Exa
- Find company information
- Research industries
- Gather market intelligence
Multi-Agent Orchestration
Sequential Execution
Parallel Execution
Agent Pool System
Why Agent Pools?
Problem: Creating agents has 5-11s overhead Solution: Maintain pool of warm, pre-initialized agents Benefits:- Zero cold start: Agents ready immediately
- Consistent performance: Predictable response times
- Better resource usage: Reuse connections
- Scalability: Handle concurrent requests
Pool Management
Agent Pool Details
Deep dive into agent pool architecture
Tool System
Available Tools
Tool Execution
Conversation Memory
Context Management
Context-Aware Queries
Error Handling
Graceful Degradation
Query Clarification
Performance Metrics
Typical Query Times
| Query Type | Cold Start | Warm Pool |
|---|---|---|
| Simple data retrieval | 12-15s | 3-4s |
| Complex analytics | 20-25s | 8-10s |
| Multi-step queries | 30-40s | 15-18s |
| With web search | 40-50s | 20-25s |
Optimization Impact
- Cold start elimination: 5-11s saved per query
- Connection reuse: 1-2s saved on DB queries
- Parallel execution: 3-5s saved on multi-step queries
- Total improvement: 15-20s per query (20-25%)
