The AI agents system consists of three specialized agents that work together to provide comprehensive assistance across different domains. Each agent is designed with specific expertise and uses RAG (Retrieval Augmented Generation) to provide accurate, contextual responses based on the processed document collections.
agents/
├── hr_policies_agent.py # HR Policies specialist
├── labor_rules_agent.py # Labor Rules specialist
├── product_manual_agent.py # Product Manual specialist
├── __init__.py # Package initialization
└── README.md # This documentation
Collection: hr_policies
Expertise: Company policies, employee procedures, benefits, HR guidelines
- Employee handbook questions
- Policy interpretation and clarification
- Benefits and compensation inquiries
- Procedure guidance (leave, performance reviews, etc.)
- Company culture and values information
- Onboarding and training procedures
✅ "What's our vacation policy?"
✅ "How do I request parental leave?"
✅ "What are the performance review procedures?"
✅ "What benefits are available to employees?"
✅ "How does the remote work policy work?"
- Clear and helpful tone
- References specific policy sections
- Professional and supportive approach
- Asks for clarification when policies are ambiguous
Collection: labor_rules
Expertise: Employment law, worker rights, legal compliance, labor regulations
- Employment law interpretation
- Worker rights and employer obligations
- Workplace safety and health requirements
- Wage and hour law compliance
- Discrimination and harassment policies
- Union relations and collective bargaining
- Legal compliance requirements
✅ "What are the overtime regulations in Brazil?"
✅ "What are the legal requirements for termination?"
✅ "How do workplace safety regulations apply?"
✅ "What are the minimum wage requirements?"
✅ "What are the legal obligations for employee breaks?"
- Accurate legal information
- References specific legal codes and statutes
- Distinguishes between federal, state, and local requirements
- Emphasizes compliance importance
- Recommends legal counsel for complex interpretations
- Includes educational disclaimers
Collection: product_manual
Expertise: Product documentation, technical support, installation guides, troubleshooting
- Product features and specifications
- Installation and setup instructions
- Troubleshooting and problem resolution
- Maintenance and care procedures
- Safety guidelines and warnings
- Technical specifications and compatibility
- Software configuration and settings
✅ "How do I install the new software?"
✅ "What are the system requirements?"
✅ "How do I troubleshoot connection issues?"
✅ "What's the maintenance schedule?"
✅ "How do I configure the settings?"
- Clear step-by-step instructions
- References specific manual sections and page numbers
- Prioritizes safety information
- Uses technical language appropriately
- Organizes complex procedures into numbered steps
- Recommends professional service when appropriate
The agents work together through a coordinating team that:
- Analyzes Questions: Determines which specialist(s) can best help
- Routes Intelligently: Directs questions to appropriate agents
- Coordinates Responses: Combines expertise when multiple domains overlap
- Handles Scope: Politely declines out-of-scope questions
- Maintains Context: Shares conversation history between agents
- Agentic Context: Shared understanding across all agents
- Member Interactions: Agents can reference each other's responses
- History Management: Remembers last 5 interactions for context
- Datetime Awareness: All agents have current time context
- Streaming Responses: Real-time answer generation
Each agent uses the same technical foundation:
# Vector Database Connection
vector_db = PatchedQdrant(
collection=collection_name,
url=settings.QDRANT_URL,
embedder=OpenAIEmbedder(),
)
# Knowledge Base
knowledge_base = AgentKnowledge(
vector_db=vector_db,
num_documents=4
)
# Agent Creation
agent = Agent(
model=OpenAIChat(id="gpt-4o-mini"),
knowledge=knowledge_base,
add_references=True,
markdown=True,
instructions=specialized_instructions,
)- OpenAI Embedder: Uses text-embedding-ada-002 for query embeddings
- Qdrant Search: Performs vector similarity search
- AgnoDoc Compatibility: Custom document format for seamless integration
- Context Limiting: Returns top 4 most relevant documents
- Reference Tracking: Includes source attribution in responses
Each agent handles questions within their domain:
- HR Agent: Company policies, procedures, benefits
- Labor Agent: Employment law, regulations, compliance
- Product Agent: Technical documentation, troubleshooting
Questions outside all three domains are politely declined:
❌ "What's the weather today?"
❌ "Who won the football game?"
❌ "What's 2+2?"
Response: "I specialize in HR policies, labor laws, and product documentation.
Could you rephrase your question to relate to one of these areas?"
- Accuracy: High accuracy through specialized training
- Relevance: Vector search ensures contextual responses
- Completeness: Combines multiple document sources
- Attribution: Always includes source references
# Model Configuration
CHAT_MODEL_ID=gpt-4o-mini # OpenAI chat model
NUM_DOCUMENTS=4 # Documents per search
NUM_HISTORY_RUNS=5 # Conversation memory
# Display Configuration
ENABLE_STREAMING=true # Real-time responses
SHOW_MEMBERS_RESPONSES=true # Show agent coordination
DEBUG_MODE=false # Debug loggingEach agent can be customized by modifying:
- Instructions: Update the system prompt
- Knowledge Base: Change document limit or search parameters
- Model: Switch between OpenAI models
- References: Enable/disable source attribution
User: "What's our vacation policy?"
→ HR Policies Agent responds with policy details and references
User: "What are the legal requirements for our company vacation policy?"
→ Coordinator consults both HR Policies and Labor Rules agents
→ Combined response with policy details + legal requirements
User: "What's our vacation policy?"
Agent: [Provides vacation policy details]
User: "What if I need more time off?"
Agent: [References previous conversation, suggests additional leave options]
- Main System:
../../../README.md - Embedding Service:
../../../batch_embedder/app/embeddings/README.md - Chat CLI Service:
../../README.md - Agno Framework: Agno Documentation
- OpenAI Models: OpenAI Documentation