Production-style starter:
frontend: React + Vite chat UI with streamingbackend: Bun API with modular retrieval pipeline
From project root:
bun installThen install workspace dependencies:
cd frontend && bun install
cd ../backend && bun installOpen two terminals:
Terminal 1:
cd backend
bun run devTerminal 2:
cd frontend
bun run devFrontend: http://localhost:5173
Backend: http://localhost:3001
GET /healthPOST /api/search(non-streaming)POST /api/chat/stream(SSE streaming)
- Search adapter: DuckDuckGo retrieval (
services/search/duckduckgo.ts) - Search adapter (premium): Tavily retrieval (
services/search/tavily.ts) - Ranking layer: simple relevance/trust scoring (
services/ranking.ts) - Answer composer: LLM-first with deterministic fallback
- Streaming layer: SSE deltas + done event
- Chat memory:
- Redis when
REDIS_URLis provided - in-memory fallback otherwise
- Redis when
OPENAI_API_KEYfor LLM summarizationREDIS_URLfor persistent chat memoryTAVILY_API_KEYfor higher-quality web retrievalSERPER_API_KEYfor Google-quality web retrieval (via Serper)SEARCH_PROVIDERasauto(default),serper,tavily, orduckduckgo