$ show KeaBase/kea-research
KEA Research is a full-stack multi-provider AI research chat application. The backend is a FastAPI service backed by SQLite/SQLAlchemy, exposing chat, admin, health, user, and TTS endpoints. The frontend is an Astro + TypeScript single-page app that stores chat history and pipeline data in IndexedDB, with a Bootstrap-based UI. Deployment is containerized via Docker Compose with nginx handling TLS and SSE-friendly proxying. The core product logic is a four-step research pipeline: initial multi-provider responses, Mixture-of-Agents refinement, peer evaluation, and a final KEA synthesis with facts, consensus, flagged claims, rankings, and confidence scores. A web admin panel manages providers, models, provider sets, users, and app settings, while the frontend supports research layers, bookmarks, notes, drafts, export, attachment ingestion, and text-to-speech via a Kokoro ONNX model.
The LLM identified 4 files worth highlighting for reuse:
Generic OpenAI-compatible provider adapter supporting base URL configuration, model selection, streaming and non-streaming calls. It is cleanly abstracted and can be dropped into any multi-provider LLM orchestration system to add compatibility with OpenAI-compatible APIs.
Self-contained utilities for repairing malformed LLM JSON, normalizing string lists, stripping code fences, and extracting text fallbacks. Directly portable to any project that consumes raw LLM output and needs defensive parsing.
TTS service with lazy ONNX model loading, voice and audio caching with LRU eviction, and streaming WAV synthesis. It is isolated enough to be extracted into a standalone TTS microservice with minimal modification.
Versioned database seeding system with deletion tracking and environment-based provider configuration. It solves the recurring problem of keeping seed data synchronized across application upgrades and is reusable for any SQLAlchemy-based project.