Production-ready AI DM agent system for Elova Event Design (luxury event design).
- FastAPI webhook + API
- Redis + Celery queue (message processing + follow-ups)
- PostgreSQL persistence (leads, messages, memory)
- Modular engines:
app/dm_listener/app/conversation_engine/app/lead_engine/app/crm_memory/app/conversion_engine/app/followup_engine/
Python requirement: use Python 3.11–3.13. Python 3.14 is not supported by pydantic-core/asyncpg yet and will fail to install.
- Create env file:
cp .env.example .env- Start Postgres + Redis:
docker compose up -d postgres redis- Install deps:
python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Run migrations:
alembic upgrade head- Run API:
uvicorn app.main:app --reload --port 8000- Run Celery worker + beat:
celery -A app.workers.celery_app.celery worker -l info
celery -A app.workers.celery_app.celery beat -l infoGET /healthGET /health/readyGET /webhooks/instagram(Meta webhook verification)POST /webhooks/instagram(incoming Instagram DM events)GET /admin/leads(bearer token)GET /admin/leads/{lead_id}(bearer token)GET /admin/leads/{lead_id}/messages(bearer token)
- Instagram Graph API setup is required (Page, App, permissions, webhook subscriptions).
- The API abstraction is in
app/instagram/client.pyso you can swap Meta Graph API vs. future browser automation. - Admin auth uses
X-API-Key: $ADMIN_API_KEY. - Default LLM is OpenAI. Configure
LLM_PROVIDER=openai+OPENAI_API_KEY(or switch to Gemini withLLM_PROVIDER=gemini+GEMINI_API_KEY). - Cost-optimized mode is
LLM_UNIFIED_MODE=true(single model call per inbound DM). - Render low-cost blueprint expects external
DATABASE_URLandREDIS_URL.