AgenticBot is a sophisticated multi-agent AI assistant built with Google's Agent Development Kit (ADK) foundations and enhanced with Google Generative AI SDK, featuring coordinated agents for web search, content extraction, deep research, and image generation capabilities using Firecrawl and Gemini models.
- π€ Multi-Agent Architecture: Coordinated system with specialized agents for different tasks
- π Web Search: Real-time information retrieval using Firecrawl
- π Web Content Extraction: Scrape and analyze web pages
- π Deep Research: Comprehensive topic research with multiple sources
- π¨ Image Generation: Create images using Gemini's Imagen model
- π¬ Interactive CLI: User-friendly command-line interface
- π₯οΈ Modern Web UI: Beautiful Streamlit interface with real-time agentic logging
- π Agentic Activity Monitoring: Real-time visualization of agent workflow and tool execution
- π Safety First: Built-in content filtering and safety guidelines
- Python 3.11 or higher
- Conda (recommended) or pip
- Google API Key
- Firecrawl API Key
# Clone the repository
git clone https://github.com/nerdy1texan/AgenticBot.git
cd AgenticBot
# Create and activate conda environment
conda env create -f environment.yml
conda activate agenticbot
# Or use pip
pip install -r app/requirements.txt- Go to Google AI Studio
- Create a new API key
- Copy the key
- Go to Firecrawl
- Sign up and get your API key
- Copy the key
# Navigate to app directory
cd app
# Create .env file
cp .env.template .env
# Edit .env file with your API keys
GOOGLE_API_KEY=your_google_api_key_here
FIRECRAWL_API_KEY=your_firecrawl_api_key_here# Start the CLI interface
python main.py
# Or start the Streamlit web interface
streamlit run streamlit_app.pyOnce the application is running, try these example queries:
π¬ You: Who was Marie Curie?
π¬ You: search for latest developments in quantum computing
π¬ You: What's the weather in London right now?
π¬ You: Latest news on AI developments
π¬ You: Current stock market trends
π¬ You: scrape https://github.com/trending
π¬ You: research quantum computing advances in 2024
π¬ You: generate image of a robot playing piano
- Primary Role: Central orchestrator and decision maker
- Responsibilities:
- Receives and analyzes user queries
- Determines appropriate specialized agent for delegation
- Coordinates responses from multiple agents
- Handles general conversation and knowledge queries
- Ensures safety and ethical guidelines compliance
- Formats and presents final responses to users
- Tools: None (delegates to specialized agents)
- Decision Logic: Intent analysis, keyword detection, context understanding
- Primary Role: Real-time web information retrieval
- Responsibilities:
- Execute web searches for current events and real-time data
- Handle weather, news, sports, and trending topic queries
- Filter and rank search results for relevance
- Format search results with proper attribution
- Detect and handle search-related queries automatically
- Tools:
web_search(query)via Firecrawl API - Triggers: Explicit "search for" commands, current info keywords (weather, news, latest, now, current, today's)
- Primary Role: Structured web content extraction and analysis
- Responsibilities:
- Extract content from specific URLs provided by users
- Parse and structure webpage content (HTML, markdown, text)
- Extract metadata (titles, descriptions, links)
- Handle various content formats and website structures
- Provide content summaries and key insights
- Tools:
scrape_webpage(url, format)via Firecrawl API - Triggers: Explicit "scrape" commands with URLs
- Primary Role: Comprehensive multi-source research and analysis
- Responsibilities:
- Conduct in-depth research on complex topics
- Gather information from multiple authoritative sources
- Synthesize findings into coherent summaries
- Provide source attribution and credibility assessment
- Handle academic and professional research queries
- Tools:
deep_research(topic, max_depth, time_limit)via Firecrawl API - Triggers: Explicit "research" commands for complex topics
- Primary Role: Text-to-image generation and creative visualization
- Responsibilities:
- Generate images from textual descriptions
- Interpret creative prompts and artistic instructions
- Handle various image styles and formats
- Process and optimize generated image data
- Provide image descriptions and generation feedback
- Tools:
generate_image(prompt)via Google Gemini Imagen API - Triggers: Explicit "generate image" commands
flowchart TD
User["π€ User Input"] -->|"Query"| RootAgent["π€ Root Agent<br/>(Central Coordinator)"]
RootAgent -->|"Intent Analysis"| Decision{"π― Query Classification"}
Decision -->|"Current Info<br/>Keywords Detected"| SearchAgent["π Search Agent"]
Decision -->|"URL Provided"| WebAgent["π Web Extraction Agent"]
Decision -->|"Research Request"| ResearchAgent["π¬ Research Agent"]
Decision -->|"Image Request"| ImageAgent["π¨ Image Generation Agent"]
Decision -->|"General Knowledge"| RootAgent
SearchAgent -->|"Web Search Results"| RootAgent
WebAgent -->|"Extracted Content"| RootAgent
ResearchAgent -->|"Research Summary"| RootAgent
ImageAgent -->|"Generated Image"| RootAgent
RootAgent -->|"Formatted Response"| User
style RootAgent fill:#e1f5fe
style SearchAgent fill:#f3e5f5
style WebAgent fill:#e8f5e8
style ResearchAgent fill:#fff3e0
style ImageAgent fill:#fce4ec
sequenceDiagram
participant U as π€ User
participant R as π€ Root Agent
participant S as π Search Agent
participant W as π Web Agent
participant Re as π¬ Research Agent
participant I as π¨ Image Agent
participant API as π External APIs
U->>R: User Query
R->>R: Analyze Intent & Context
alt Search Query
R->>S: Delegate to Search Agent
S->>API: Firecrawl Search API
API-->>S: Search Results
S->>S: Filter & Format Results
S-->>R: Processed Results
else URL Scraping
R->>W: Delegate to Web Agent
W->>API: Firecrawl Scrape API
API-->>W: Webpage Content
W->>W: Parse & Structure Content
W-->>R: Extracted Content
else Research Request
R->>Re: Delegate to Research Agent
Re->>API: Firecrawl Deep Research API
API-->>Re: Multi-source Data
Re->>Re: Synthesize Findings
Re-->>R: Research Summary
else Image Generation
R->>I: Delegate to Image Agent
I->>API: Google Gemini Imagen API
API-->>I: Generated Image
I->>I: Process Image Data
I-->>R: Image + Metadata
else General Query
R->>API: Google Gemini Text API
API-->>R: Generated Response
end
R->>R: Format Final Response
R-->>U: Complete Answer
The application now features real-time agentic activity logging that shows:
flowchart LR
A["π¨ Query Received"] --> B["π Intent Analysis"]
B --> C["π― Agent Selection"]
C --> D["π§ Tool Preparation"]
D --> E["π API Execution"]
E --> F["π Result Processing"]
F --> G["π Response Formatting"]
G --> H["π Task Completion"]
style A fill:#e3f2fd
style B fill:#f3e5f5
style C fill:#e8f5e8
style D fill:#fff3e0
style E fill:#fce4ec
style F fill:#f1f8e9
style G fill:#ede7f6
style H fill:#e0f2f1
flowchart TB
subgraph "User Interface Layer"
CLI["π₯οΈ CLI Interface<br/>(main.py)"]
WEB["π Web Interface<br/>(streamlit_app.py)"]
end
subgraph "Agent Orchestration Layer"
ROOT["π€ Root Agent<br/>(Central Coordinator)"]
INTENT["π― Intent Analysis<br/>(Query Classification)"]
end
subgraph "Specialized Agent Layer"
SEARCH["π Search Agent<br/>(Real-time Info)"]
SCRAPE["π Web Extraction Agent<br/>(Content Analysis)"]
RESEARCH["π¬ Research Agent<br/>(Deep Analysis)"]
IMAGE["π¨ Image Generation Agent<br/>(Creative AI)"]
end
subgraph "Tool & API Layer"
FC_SEARCH["π Firecrawl Search API"]
FC_SCRAPE["πΈοΈ Firecrawl Scrape API"]
FC_RESEARCH["π¬ Firecrawl Research API"]
GEMINI_TEXT["π§ Google Gemini Text API"]
GEMINI_IMAGE["π¨ Google Imagen API"]
end
subgraph "Data Storage Layer"
SESSION["πΎ Session State"]
LOGS["π Activity Logs"]
HISTORY["π Chat History"]
end
CLI --> ROOT
WEB --> ROOT
ROOT --> INTENT
INTENT --> SEARCH
INTENT --> SCRAPE
INTENT --> RESEARCH
INTENT --> IMAGE
SEARCH --> FC_SEARCH
SCRAPE --> FC_SCRAPE
RESEARCH --> FC_RESEARCH
IMAGE --> GEMINI_IMAGE
ROOT --> GEMINI_TEXT
FC_SEARCH --> SESSION
FC_SCRAPE --> SESSION
FC_RESEARCH --> SESSION
GEMINI_TEXT --> SESSION
GEMINI_IMAGE --> SESSION
SESSION --> LOGS
SESSION --> HISTORY
style ROOT fill:#e1f5fe,stroke:#01579b
style SEARCH fill:#f3e5f5,stroke:#4a148c
style SCRAPE fill:#e8f5e8,stroke:#1b5e20
style RESEARCH fill:#fff3e0,stroke:#e65100
style IMAGE fill:#fce4ec,stroke:#880e4f
The application implements several key architectural patterns:
- Root Agent acts as a central dispatcher
- Specialized agents handle domain-specific tasks
- Clear separation of concerns and responsibilities
- Each agent is equipped with specific tools for their domain
- Tools are abstracted as functions with standardized interfaces
- Agents focus on coordination while tools handle execution
- Automatic query classification and routing
- Multiple triggers for agent selection (explicit commands, keyword detection)
- Fallback to general conversation handling
- Built-in safety instructions for all agents
- Content filtering and ethical guidelines
- Source attribution and transparency
| Tool Function | Purpose | API Integration | Response Format |
|---|---|---|---|
web_search(query) |
Real-time web search | Firecrawl Search | JSON with results array |
scrape_webpage(url, format) |
Content extraction | Firecrawl Scrape | JSON with content + metadata |
deep_research(topic, depth, time) |
Multi-source research | Firecrawl Research | JSON with summary + sources |
generate_image(prompt) |
Text-to-image generation | Google Imagen | JSON with base64 image data |
AgenticBot/
βββ environment.yml # Conda environment configuration
βββ pyproject.toml # Project configuration
βββ README.md # This comprehensive documentation
βββ requirements.txt # Python dependencies
βββ app/
βββ main.py # CLI application entry point
βββ streamlit_app.py # Web UI with agentic activity monitoring
βββ requirements.txt # App-specific Python dependencies
βββ .env.template # Environment variables template
βββ README.md # App-specific documentation
βββ tests/ # Test files directory
β βββ test_direct_agent.py # Direct agent testing
β βββ test_explicit_agent.py # Explicit agent testing
β βββ [other test files] # Various testing approaches
βββ chatgpt_agentic_clone/
βββ __init__.py # Package initialization
βββ agent.py # Multi-agent system implementation
| Variable | Description | Required | Default |
|---|---|---|---|
GOOGLE_API_KEY |
Google AI API key for Gemini models | β | None |
FIRECRAWL_API_KEY |
Firecrawl API key for web search/scraping | β | None |
The application uses these Google AI models:
- Text Generation:
gemini-2.0-flash-exp(Latest experimental model) - Image Generation:
imagen-3.0-generate-001(Advanced image synthesis)
Each agent can be customized with:
- Instructions: Behavior and safety guidelines
- Tools: Available functions and APIs
- Model: Specific Gemini model to use
- Sub-agents: Hierarchical agent relationships
| Layer | Technology / API | Version | Purpose |
|---|---|---|---|
| Language | Python | 3.11+ | Core application development |
| AI Framework | Google Generative AI SDK | Latest | Direct model integration |
| Agent Development | Google ADK Foundations | Conceptual | Multi-agent architecture design |
| AI Models | Google Gemini 2.0 Flash | Experimental | Text generation and reasoning |
| Image AI | Google Imagen 3.0 | Latest | High-quality image generation |
| Web Intelligence | Firecrawl | Latest | Web search, scraping, research |
| Web Framework | Streamlit | Latest | Interactive web frontend |
| CLI Framework | Rich + Prompt Toolkit | Latest | Beautiful command-line interface |
| Environment | Conda, pip | Latest | Dependency and environment management |
| Configuration | python-dotenv | Latest | Environment variable management |
| Data Handling | Base64, JSON | Built-in | Image and structured data processing |
AgenticBot was originally conceived and started using Google's Agent Development Kit (ADK), which provided the foundational concepts and architecture for multi-agent systems:
- Agent Architecture Design: Multi-agent coordination patterns
- Tool Integration Framework: Standardized tool-agent binding approach
- Safety Guidelines: Built-in ethical AI practices
- Session Management: Conversation state and context handling
During development, we encountered several challenges with the ADK Runner:
- API Compatibility Issues: Message formatting validation errors
- Model Integration Complexity: Complex model name handling requirements
- Session Management Overhead: Additional abstraction layers
flowchart LR
subgraph "Development Evolution"
ADK["ποΈ Google ADK<br/>(Architecture Foundation)"] --> CONCEPTS["π Design Patterns<br/>& Concepts"]
CONCEPTS --> DIRECT["π― Direct Integration<br/>(Google GenAI SDK)"]
end
subgraph "Retained ADK Elements"
MULTI["π€ Multi-Agent Design"]
TOOLS["π§ Tool Integration"]
SAFETY["π Safety Guidelines"]
COORD["π― Agent Coordination"]
end
subgraph "Enhanced Implementation"
STREAMLIT["π Streamlit UI"]
LOGGING["π Activity Monitoring"]
DIRECT_API["β‘ Direct API Calls"]
end
CONCEPTS --> MULTI
CONCEPTS --> TOOLS
CONCEPTS --> SAFETY
CONCEPTS --> COORD
DIRECT --> STREAMLIT
DIRECT --> LOGGING
DIRECT --> DIRECT_API
style ADK fill:#e3f2fd
style DIRECT fill:#e8f5e8
style CONCEPTS fill:#fff3e0
- ADK Design Principles: Robust multi-agent architecture
- Direct SDK Integration: Simplified API interaction
- Enhanced Flexibility: Custom UI and monitoring capabilities
- Better Performance: Reduced abstraction overhead
The Streamlit interface provides unprecedented visibility into the agent workflow:
- π€ Agent Steps: High-level agent coordination and decision making
- π§ Tool Execution: Preparation and setup of specialized tools
- π API Calls: External service integration and data retrieval
- π Result Processing: Data analysis and response formatting
- Glassmorphism Effects: Modern translucent design elements
- Color-Coded Agents: Visual distinction between different agent types
- Real-Time Updates: Live streaming of agent activity
- Expandable Sections: Organized information display
- Dark Mode Optimized: Professional appearance with excellent readability
cd app
streamlit run streamlit_app.pyFeatures include:
- π¬ Interactive chat interface
- π Real-time agentic workflow visualization
- π§ Tool execution monitoring
- π Response formatting display
- π¨ Image generation and display
- π± Responsive design for mobile and desktop
- Define Agent Role:
new_specialist_agent = Agent(
name="new_specialist",
model=MODEL_GEMINI_2_0_FLASH,
instruction="Your specialized role and guidelines...",
tools=[new_tool_function],
)- Add to Root Agent:
root_agent = Agent(
# ... existing configuration
sub_agents=[
# ... existing agents
new_specialist_agent,
],
)- Update Intent Detection:
- Add trigger keywords or patterns
- Update routing logic in main application
- Define Tool Function:
def custom_tool(parameter: str) -> Dict:
"""Custom tool for specific functionality."""
try:
# Implementation logic
result = process_parameter(parameter)
return {"status": "success", "data": result}
except Exception as e:
return {"status": "error", "error_message": str(e)}- Add Logging Integration:
def custom_tool_with_logging(parameter: str) -> Dict:
print(f"--- Tool: custom_tool called for: {parameter} ---")
# ... implementation- Bind to Agent:
agent = Agent(
tools=[custom_tool, other_tools...]
)Agents can be fine-tuned by modifying their instruction parameters:
instruction="""
You are a [ROLE] specialist. Your responsibilities include:
1. [Primary responsibility]
2. [Secondary responsibility]
3. [Safety guidelines]
IMPORTANT GUIDELINES:
- [Specific guideline 1]
- [Specific guideline 2]
- [Safety consideration]
"""-
Agent-Level Safety:
- Individual agent instructions include safety guidelines
- Role-specific ethical considerations
- Built-in refusal mechanisms for harmful requests
-
Tool-Level Safety:
- Input validation and sanitization
- Error handling and graceful failures
- Rate limiting and resource management
-
System-Level Safety:
- Content filtering at integration points
- Source attribution and transparency
- User activity monitoring and logging
- Transparency: Clear indication of AI-generated content
- Attribution: Source citation for web-sourced information
- Privacy: No storage of sensitive user information
- Accountability: Comprehensive activity logging
- Bias Mitigation: Diverse source integration for research
# Issue: "Model not found" error
# Solution: Ensure correct model name format
β
Correct: "gemini-2.0-flash-exp"
β Incorrect: "models/gemini-2.0-flash-exp"# Issue: "API key not configured"
# Solution: Check environment variable setup
export FIRECRAWL_API_KEY="your_key_here"
# Or ensure .env file is properly configured# Issue: Agents not responding correctly
# Solutions:
1. Check agent instructions for clarity
2. Verify tool function implementations
3. Review error logs for specific issues
4. Test individual tools separately# Issue: Interface not loading correctly
# Solutions:
1. Clear browser cache
2. Restart Streamlit server
3. Check console for JavaScript errors
4. Verify all dependencies are installedEnable detailed logging by setting environment variable:
export DEBUG_MODE=trueThis provides:
- Detailed API request/response logging
- Agent decision-making process details
- Tool execution step-by-step breakdown
- Performance timing information
# Production Dependencies
google-generativeai: "Latest" # Direct Google AI integration
firecrawl-py: "Latest" # Web intelligence platform
streamlit: "Latest" # Web interface framework
python-dotenv: "Latest" # Environment management
google-adk: "Latest" # Agent architecture foundations
# Development Dependencies
pytest: "Latest" # Testing framework
black: "Latest" # Code formatting
flake8: "Latest" # Code linting
mypy: "Latest" # Type checking- Python: 3.11 or higher
- Memory: 4GB RAM minimum, 8GB recommended
- Storage: 2GB free space
- Network: Stable internet connection for API calls
- Browser: Modern browser for Streamlit interface
- Fork and Clone:
git fork https://github.com/nerdy1texan/AgenticBot.git
git clone your-fork-url
cd AgenticBot- Create Feature Branch:
git checkout -b feature/your-feature-name- Development Setup:
conda env create -f environment.yml
conda activate agenticbot
cd app && cp .env.template .env
# Add your API keys to .env- Testing:
python -m pytest app/tests/- Submit Pull Request:
- Ensure all tests pass
- Include comprehensive documentation
- Follow existing code style and patterns
- π Enhanced agent coordination algorithms
- π― Additional specialized agents (data analysis, code generation)
- π Extended API integrations
- π Advanced analytics and monitoring
- π¨ UI/UX improvements and accessibility
- π Enhanced security and privacy features
- Documentation: Review this comprehensive README
- Console Logs: Check terminal output for detailed error information
- Testing: Run individual components to isolate issues
- Community: Join discussions and contribute to improvements
When reporting issues, please include:
- Python version and operating system
- Complete error messages and stack traces
- Steps to reproduce the issue
- Environment configuration (API keys status, dependencies)
- Expected vs actual behavior
This project is licensed under the MIT License - see the LICENSE file for details.
- ποΈ Google ADK Team: For the foundational multi-agent architecture concepts and design patterns
- π§ Google Gemini: For state-of-the-art language and image generation models
- π₯ Firecrawl: For comprehensive web intelligence and data extraction capabilities
- π Streamlit: For the intuitive web application framework
- π€ Open Source Community: For continuous inspiration and collaborative development
- π Research Community: For advancing the field of multi-agent AI systems
This project demonstrates the evolution from using Google ADK as a foundation to implementing a production-ready system with direct API integration, showcasing the practical application of agentic AI principles in real-world scenarios.
π Ready to explore the future of multi-agent AI? Start your AgenticBot journey today!
Built with β€οΈ by the open source community, powered by cutting-edge AI technologies.