Forgekit
What it is
Forgekit is an open-source Next.js 16 AI starter kit: a streaming AI chatbot with tool calling, five model providers including local Ollama, RAG on pgvector, an MCP endpoint, Better Auth and a Docker self-hosting path.
Forgekit is an open-source, MIT-licensed Next.js 16 AI starter kit. It gives developers a working AI chat app with streaming responses, tool calling, retrieval-augmented generation (RAG) over their own documents and a self-hosting deploy path from the first commit.
Result
Forgekit installs, typechecks, lints, passes its 15 unit tests and builds cleanly. It runs with one setup script, and the same app deploys to Docker, Coolify or Vercel. Read the full write-up: [Forgekit: An Open-Source Next.js AI Starter Kit](/blog/nextjs-ai-starter-kit).
The problem
Most AI templates make the first streamed reply easy, then leave the hard parts to you: saved conversations, auth, per-user document scoping, rate limits, token usage, local models and a container that migrates its own database.
What it does
- Streaming chat with saved threads on the Vercel AI SDK, and a model picker across OpenAI, Anthropic, Gemini, xAI and local Ollama
- Tool calling with weather, web fetch and calculator tools rendered as cards
- RAG over PDF, Markdown and text uploads on PostgreSQL with pgvector (HNSW cosine index) and numbered citations
- Better Auth email and GitHub sign-in, per-user rate limiting and token usage per model
- An MCP (Model Context Protocol) endpoint that exposes
search_knowledgeto AI agents behind hashedfk_API keys
How it's built
- Next.js 16, TypeScript, the AI SDK, PostgreSQL with pgvector and Drizzle ORM
- A multi-stage Docker image (284 MB measured) that applies Drizzle migrations on boot
- Vitest, Playwright and ESLint for testing and linting
