Overview
Junkie’s team consists of specialized agents, each with unique capabilities. The team leader delegates tasks to these agents based on the request.Code Agent
Execute Python code, run shell commands, web scraping with Firecrawl
Perplexity Sonar Pro
Real-time web search with source attribution
Groq Compound
Fast code execution and calculations
Context Q&A Agent
Answer questions about chat history and users
MCP Agent
Extensible tool integrations via MCP protocol
Agent Definitions
All agents are defined inagent_factory.py:179-305.
1. Code Agent
Purpose: Complex code execution, file operations, web scrapingagent_factory.py:183-232
Key Features:
- E2B sandbox for secure code execution
- Firecrawl integration for web scraping (if API key provided)
- Context7 MCP tools
- Exa advanced search
- No content policy enforcement
2. Perplexity Sonar Pro Agent
Purpose: Real-time web research with source attributionagent_factory.py:234-245
Key Features:
- Live web data access
- Source-backed information
- Competitive analysis
- Research queries
3. Groq Compound Agent
Purpose: Fast code execution and calculationsagent_factory.py:248-260
Key Features:
- Groq’s Compound model (fast inference)
- Math and calculations
- Code debugging
- 8000 token output limit
4. Context Q&A Agent
Purpose: Answer questions about chat history and usersagent_factory.py:264-290
Key Features:
- Long-context model (e.g., Gemini 1.5 Pro, Claude 3 Opus)
- HistoryTools for reading chat history
- BioTools for user profile management
- Low temperature (0.3) for accuracy
- Fetches minimum 5000 messages
read_chat_history to access messages from PostgreSQL:
- “What did @user say about topic X?”
- “Summarize the last discussion about Y”
- “When did we last talk about Z?“
5. MCP Agent (Optional)
Purpose: Handle custom MCP-based tool integrationsagent_factory.py:293-305
Key Features:
- Dynamic tool loading from
tools_factory.py - Only created if MCP tools are configured
- Extends agent capabilities without code changes
Model Configuration
All agents share common configuration helpers:agent_factory.py:103-124
Agent Selection
The team leader selects agents based on:- Task Type - Code execution → Code Agent, Research → Perplexity
- Speed Requirements - Fast math → Compound Agent
- Context Needs - History questions → Context Q&A Agent
- Tool Requirements - Specific MCP tools → MCP Agent
Common Agent Properties
All agents share:Configuration Variables
PROVIDER- Base URL for model providerMODEL_NAME- Default model IDMODEL_TEMPERATURE- Creativity level (0.0-1.0)MODEL_TOP_P- Nucleus sampling parameterGROQ_API_KEY- Groq API key for fast modelsCUSTOM_PROVIDER_API_KEY- Custom provider API keyCONTEXT_AGENT_MODEL- Model for Context Q&A agentFIRECRAWL_API_KEY- API key for Firecrawl (optional)