This is a Python monorepo for an AI agentic backend workflow. The backend provides a basic scaffolding built with FastAPI, mimicking an agent-based architecture with routing capabilities based on generated model decisions.
agentic-monorepo/
├── backend/
│ ├── server/ # FastAPI server code (main.py)
│ ├── agent/ # Gemini agent logic (gemini_agent.py)
│ ├── router/ # Model router (model_router.py)
│ ├── adapters/ # Model adapters (veo, nanobanana, lyria)
│ ├── schemas/ # Pydantic models (agent_output.py, prompt_request.py)
│ └── utils/ # Logging, helpers, config (logger.py, config.py)
- Modular monorepo architecture
- Agent-based decision making
- Dynamic routing to multiple AI providers
- Pluggable adapter design
- Async FastAPI backend
- Clean separation of concerns
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables in
.env:GEMINI_API_KEY: Your Google Gemini API keyREDIS_URL: Your Redis Cloud connection URL (e.g.,redis://username:password@host:port)
-
Run the FastAPI application from the project root directory (
agentic-monorepo):python -m backend.server.main
Or use
uvicorn:uvicorn backend.server.main:app --reload
-
Test the POST
/promptendpoint:curl -X POST "http://localhost:8000/prompt" \ -H "Content-Type: application/json" \ -d '{"user_prompt": "I want to generate a video."}'
-
Get conversation history:
curl "http://localhost:8000/conversations/{session_id}"