DeepQuery is a full-stack AI research chat app for turning web context into structured, conversational answers. It combines authenticated conversations, live web search, streamed AI responses, and asynchronous research jobs powered by a Redis-backed worker queue.
I built it to make research feel like a focused workspace rather than a one-off chatbot: users can ask quick questions, continue earlier threads, and send longer research tasks into a background worker without leaving the chat.
- AI chat with streamed responses
- Web search context using Tavily
- Conversation history saved in Postgres
- Supabase authentication
- Research Mode with Redis + BullMQ background jobs
- Worker process for long-running research tasks
- Research job status polling and persisted results
- Optional webhook configuration for completed research jobs
- React frontend with dark mode and markdown rendering
- Prisma ORM with PostgreSQL
- Frontend: React, TypeScript, Tailwind CSS, Bun
- Backend: Bun, Express, TypeScript
- Database: PostgreSQL, Prisma
- Auth: Supabase
- AI: Google Gemini
- Search: Tavily
- Queue: Redis, BullMQ, ioredis
frontend/
React
Supabase login
Research Mode polling
backend/
Express API
Prisma database access
Tavily search
Gemini response generation
BullMQ queue producer
backend/worker.ts
BullMQ worker
Processes async research jobs
Saves completed results to chat history
Redis
Queue backend for BullMQ
Postgres
Users, conversations, messages, research jobs, webhook configs
Normal chat:
User message -> /ask -> Tavily search -> Gemini stream -> save conversationResearch Mode:
User message -> /research -> create ResearchJob -> BullMQ queue
Worker -> Tavily search -> Gemini answer -> save result -> frontend polls statusResearch Mode is currently an async/background research workflow. It is not yet a full autonomous multi-step research agent.
- Bun
- PostgreSQL database
- Redis
- Supabase project
- Tavily API key
- Google Gemini API key
git clone <url>
cd deepqueryInstall backend dependencies:
cd backend
bun installInstall frontend dependencies:
cd ../frontend
bun installCreate backend/.env:
DATABASE_URL="postgresql://USER:PASSWORD@HOST:PORT/DATABASE"
PUBLIC_SUPABASE_URL="https://your-project.supabase.co"
SECRET_KEY_BASE="your-supabase-service-role-or-secret-key"
GEMINI_API_KEY="your-gemini-api-key"
TAVILY_API_KEY="your-tavily-api-key"
REDIS_URL="redis://127.0.0.1:6379"Create frontend/.env:
BUN_PUBLIC_SUPABASE_URL="https://your-project.supabase.co"
BUN_PUBLIC_SUPABASE_PUBLISHABLE_KEY="your-supabase-anon-key"The frontend backend URL is currently configured in:
frontend/src/lib/config.tsDefault:
export const BACKEND_URL = "http://localhost:3001";From backend/:
bunx prisma generate
bunx prisma db pushUse migrations instead of db push if you prefer a migration-based workflow.
Using Docker:
docker run --name deepquery-redis -p 6379:6379 -d redis:7-alpineFrom backend/:
bun run startThe API runs on:
http://localhost:3001Open a second terminal:
cd backend
bun run workerThe worker must be running for Research Mode jobs to complete.
Open a third terminal:
cd frontend
bun run devDeepQuery is a production-minded research platform that delivers web-grounded answers, persistent conversation history, and scalable background research jobs, built for anyone who needs reliable, composable research workflows.
- Research Mode is async and queue-based, but not yet a true multi-step research agent.
- Multi-step research planning with generated subqueries
- Multiple Tavily searches per research job