This repository contains a full-stack “marketing research agent” app.
Users create chat sessions (“projects”) via the FastAPI backend. For each session, the backend runs an OpenRouter/OpenAI-compatible LLM in a tool-using loop (e.g. web_search, get_content, simulate_behavior), streams progress as text/tool blocks to the frontend via Server-Sent Events (SSE), and persists the resulting blocks and project metadata in Supabase.
Use combined web search tool to access public data, social media and the internet for general information, and initiate sub-agents to simulate the behaviors of consumers of different profiles.
pip install -r requirements.txtThe backend reads API keys from the process environment (backend/credentials.py has no hardcoded defaults). Set these before starting the API:
| Variable | Purpose |
|---|---|
EXA_API_KEY |
Exa web search |
OPENROUTER_API_KEY |
LLM calls via OpenRouter |
SUPABASE_SECRET_KEY |
Supabase server client (service role / secret key) |
SUPABASE_PUBLIC_KEY |
Publishable key if your code paths need it |
Example:
export EXA_API_KEY="..."
export OPENROUTER_API_KEY="..."
export SUPABASE_SECRET_KEY="..."
export SUPABASE_PUBLIC_KEY="..."| Method | Path | Description |
|---|---|---|
| GET | /api/chats |
List recent chat sessions |
| GET | /api/work/{id} |
Get work process (blocks + metadata) for a chat |
| GET | /api/work/{id}/stream |
Stream work-process blocks via SSE |
| POST | /api/chats |
Create a new chat session |
- Backend:
cd backend && source run.txt - Frontend:
cd agent-app && npm run dev
marketing agent folder is a testing workspace, not part of the project in production