Nexus platform
About
Open-stack reference RAG skeleton: ingestion, Gemini embeddings stored in Postgres with pgvector, cosine retrieval, and citation-aware answers returned as structured JSON usable from the REST API and MCP.
Runtime models (env overrides)
- Chat / JSON generation
gemini-2.5-flash- Vision OCR (PDF / image)
gemini-2.0-flash- Embeddings
gemini-embedding-001· 768-dim vector column
Values shown reflect your environment at request time. Defaults live in lib/ai.ts when env vars are unset.
Chat response envelope
Version nexus.chat.v1 objects include:
textplain language stringmarkdownrich Markdown (GFM, KaTeX) with optional[[S1]]cite markerssources[]chunk ids, filenames, similarity, excerptshallucination_flagwhen retrieval gate fails
Legacy fields answer and citations mirror text and sources for older clients.
Application stack
- Next.js 14 App Router, TypeScript, Tailwind CSS
- Prisma ORM on PostgreSQL with pgvector (IVFFlat cosine index via init route)
- Google AI Studio: Gemini JSON chat, multimodal OCR, REST embedContent
- Client rendering: react-markdown, remark-gfm, remark-math, rehype-katex
- Optional MCP JSON-RPC surface at
/api/mcp