How sligter/deepgemini works
Project Type and Purpose
• DeepGemini is a multi-model orchestration API that integrates with various AI providers (such as OpenAI, DeepSeek, Claude, Gemini, Grok3, etc.).
• It supports flexible workflows like multi-role discussions, different discussion modes (brainstorming, debate, role-playing, SWOT analysis, etc.), and even real-time streaming responses.
• The application is built on FastAPI for the backend API layer, uses SQLAlchemy (with Alembic for database migrations) for data persistence (likely SQLite by default), and also features a web management UI (served from the app/static directory) for configuration and management.
File Structure Analysis & Architectural Patterns
• The project is organized as a monolithic FastAPI application with clearly separated modules:
• The “app” directory contains the core application logic.
• The “clients” folder encapsulates integrations with multiple external AI providers, each represented by individual client modules.
• The “meeting” module houses logic regarding AI meeting orchestration including agents, various meeting modes (e.g., brainstorming, debate, etc.) and meeting utilities.
• The “routers” and “routes” directories define API endpoints for different resources (meeting, discussion groups, roles, models, authentication, etc.).
• The “models” directory contains ORM models for database interactions.
• The “processors” directory provides processing functions (e.g., discussion and role processors) that likely manage business logic.
• The “static” directory holds assets for the web management UI.
• The “alembic” folder and corresponding configuration files indicate the use of Alembic for database migrations.
• Deployment and environment configuration files such as Dockerfile, docker-compose.yml, and .env.example indicate readiness for containerized deployment.
Main Components to be Represented
• API Gateway & Backend:
• FastAPI service (entry point: app/main.py) that handles HTTP requests.
• Routers and routes modules exposing RESTful endpoints (e.g., meeting, discussions, models, auth, configuration).
• Meeting Orchestration Module:
• “app/meeting” which houses components like agents, meeting modes, and logging specifically for multi-role discussions.
• Meeting modes sub-module showing different strategies (brainstorming, debate, role-playing, etc.).
• Processors working on discussion flows.
• Integration Layer for External AI Providers:
• “app/clients” and “app/adapters” that encapsulate interactions with external providers (OpenAI, Claude, Gemini, DeepSeek, etc.).
• Data Persistence:
• “app/models” (using SQLAlchemy) for ORM definitions.
• Database component (SQLite, based on instructions in README) along with Alembic migrations (alembic folder & alembic.ini).
• Web Management UI:
• Static files and front-end resources (HTML/JS/CSS) in “app/static” that provide a dashboard interface.
• Utility Components:
• Utility modules (e.g., auth, logging) that support core functionality system-wide.
Relationships and Interactions
• The client-facing API (using FastAPI) receives request calls that are routed via defined endpoints (routers/routes).
• Upon receiving a request, the application may call the appropriate meeting managers or processors (from the “meeting” and “processors” modules).
• These workflows might interact with one or more external AI provider clients through the “clients” and “adapters” components.
• The system accesses and updates persisted data through SQLAlchemy models, with Alembic handling any necessary migrations.
• The Web Dashboard (from app/static) could interact with these API endpoints for model configuration and monitoring.
• Configuration and environment settings (found in .env and associated files) ensure proper connectivity and behavior across these modules.