This template includes AI agent functionality with both Streamlit GUI and FastAPI backend options. The agents are built using a modular architecture with support for different agent engines, workflows, and tools.
First, install the project dependencies:
uv syncThen, create a .env file in the project root with your API key:
# Create .env file
echo "API_KEY=your_api_key_here" > .envReplace your_api_key_here with your actual API key for the LLM provider you're using.
To run the application with the Streamlit interface:
uv run streamlit run app/gui.pyThis will start the Streamlit development server, typically on http://localhost:8501.
To run the FastAPI backend server:
uv run fastapi dev app/main.py --port 8300This will start the FastAPI development server on port 8300 (avoiding the default 8000 port).
The agent system is organized into several key components:
- Agent Manager (
app/agent/agent_manager.py) - Central management of agent instances - Engines (
app/agent/engines/) - Different agent execution enginesreact_agent.py- ReAct (Reasoning and Acting) agent implementationguardrails.py- Safety and validation layerrouters.py- Request routing for agent modestranslators.py- Input/output translation layer
- Workflows (
app/agent/workflows/) - Agent workflow definitions - Tools (
app/agent/tools/) - Available tools and utilities - Prompts (
app/agent/prompts/) - Agent and worker prompt templates
- Modular Design: Easy to extend with new agent types and capabilities
- Tool Integration: Built-in tool registry and management system
- Workflow Support: Configurable agent workflows for different use cases
- Safety Layer: Guardrails for safe agent operation
- API Integration: RESTful API endpoints for agent interaction