How thamilarasan777/trip-planner-using-crewai works
Project type and purpose
• This is a Python-based, AI-powered “Trip Planner” application combining three interfaces:
• A command-line interface (cli_app.py)
• A REST API (api_app.py using FastAPI/uvicorn)
• A web UI (streamlit_app.py using Streamlit)
• Under the hood it uses the CrewAI framework (trip_agents.py + trip_tasks.py + tools/*) to orchestrate LLM-driven agents and tools (e.g., browser automation, web search, calculator).
File structure
• Top-level interfaces:
• cli_app.py
• api_app.py
• streamlit_app.py
• Core orchestration:
• trip_agents.py (agent creation & management)
• trip_tasks.py (task definitions and prompts)
• tools/ (browser_tools.py, search_tools.py, calculator_tools.py)
• Config & docs:
• .streamlit/config.toml & secrets.toml (for API keys)
• requirements.txt, .env.example, README.md, flow_diagram.txt
Key insights from the README
• Users supply trip parameters (origin, destination, dates, preferences).
• CrewAI agents coordinate via defined tasks to build an itinerary.
• External dependencies:
• LLM providers (OpenAI/Gemini, Ollama)
• Browserless (for headless browsing)
• Serper.dev (for web search)
Main components
• CLI Client (cli_app.py)
• REST API (api_app.py + uvicorn)
• Streamlit UI (streamlit_app.py)
• TripAgents module
• TripTasks definitions
• Tools library (browser, search, calculator)
• LLM Providers (Gemini/OpenAI API or Ollama local server)
• Browserless.io
• Serper.dev
d. Infrastructure / Platform
• Python runtime & dependencies
Relationships & Data Flows
• “User input: trip params”
• From Task Engine / Tool Executor → External Services
• LLM API calls
• Browserless sessions
• Serper search requests
• Responses flow back upstream, culminating in “Itinerary result” → UI / CLI / API response.
Architectural patterns & design principles
• Layered architecture:
• Presentation layer (CLI, API, Web UI)
• Business logic layer (CrewAI orchestration)
• Integration layer (tools + external services)
• Separation of concerns: each interface is thin; all planning logic lives in TripAgents + tasks + tools.
• Extensibility: new tools/agents can be dropped into tools/ or trip_tasks.py.
Technology callouts
• Python 3.x
• Streamlit for web front end
• FastAPI + uvicorn for REST API
• CrewAI SDK for agent orchestration
• OpenAI/Gemini or Ollama for LLM calls
• Browserless.io + Serper.dev as specialty tool backends