Applications
Sage: Answer Engine
This example shows how to build Sage, a Perplexity-like Answer Engine that intelligently determines whether to perform a web search or conduct a deep analysis using ExaTools based on the user’s query.
Sage:
- Uses real-time web search (DuckDuckGo) and deep contextual analysis (ExaTools) to provide comprehensive answers
- Intelligently selects tools based on query complexity
- Provides an interactive Streamlit UI with session management and chat history export
- Supports multiple LLM providers (OpenAI, Anthropic, Google, Groq)
Key capabilities
- Natural language query understanding and processing
- Real-time web search integration with DuckDuckGo
- Deep contextual analysis using ExaTools
- Multiple LLM provider support
- Session management using SQLite
- Chat history export
- Interactive Streamlit UI
Simple queries to try
- “Tell me about the tariffs the US is imposing in 2025”
- “Which is a better reasoning model: o3-mini or DeepSeek R1?”
- “Tell me about Agno”
- “What are the latest trends in renewable energy?”
Advanced analysis queries
- “Evaluate how emerging AI regulations could influence innovation”
- “Compare the environmental impact of electric vs hydrogen vehicles”
- “Analyze the global semiconductor supply chain challenges”
- “Explain the implications of quantum computing on cryptography”
Code
The complete code is available in the Agno repository.
Usage
1
Clone the repository
2
Create virtual environment
3
Install dependencies
4
Set up API keys
We recommend using gpt-4o for optimal performance.
5
Launch the app
Open localhost:8501 to start using Sage.
Model Selection
The application supports multiple model providers:
- OpenAI (o3-mini, gpt-4o)
- Anthropic (claude-3-5-sonnet)
- Google (gemini-2.0-flash-exp)
- Groq (llama-3.3-70b-versatile)
Agent Configuration
The agent configuration is in agents.py
and the prompts are in prompts.py
:
- To modify prompts, update the
prompts.py
file - To add new tools or models, update the
agents.py
file
Support
Need help? Join our Discourse community for support!