Open Source · Self-hosted · AI-Native

An AI-native vault that grows with you

A self-hosted, private knowledge vault where conversations and sources become durable, searchable memory — and every AI assistant grounds on what you built. One command to run, never locked to a single vendor.

Apache-2.0Next.js 16React 19TypeScript 5Node 20+
~/next-wiki — zsh

$ git clone https://github.com/hugogu/next-wiki.git

$ cd next-wiki && cp .env.example .env

$ docker compose up -d --build

# Seeds itself on first run

✓ ready — http://localhost:3000

MCP tools online — Claude / Cursor can ground on this wiki

1 command

docker compose up to launch

MCP-native

every AI client reads the same store

100%

every save is an immutable revision

3 spaces

raw → generated → public memory model

// Why next-wiki

Not a wiki with an AI button — a wiki built around AI

Most wikis store pages; most AI assistants answer questions. next-wiki joins the two into a governed knowledge loop — with ownership, evidence, and revisions always visible.

Build your wiki by talking

A persistent Wiki AI chat, grounded in hybrid keyword + semantic retrieval with visible citations, drafts pages, restructures the tree, translates, and curates through dialogue — with live tool-call status and durable chat sessions.

A long-term AI memory

LLM Wiki mode keeps append-only raw evidence (text plus original bytes: PDF, HTML, logs) separate from AI-generated concepts and the curated public wiki — knowledge grows instead of decaying, and outlives any single AI vendor.

AI that acts, with boundaries

A built-in MCP-compatible toolset lets AI read, draft, and organize over the same permission-checked services as the web UI — with risk policies, admin proposal review, tool evidence, and audit events.

One store, every client

Web UI, REST API, the packaged MCP server (Claude Code, Cursor, OpenCode, OpenClaw), and Feishu all resolve through one permission model — what you write is exactly what every assistant grounds on.

Everything is versioned

Every save creates an immutable revision; deletion is soft by default; diffs between any two revisions are always available — the audit trail for both humans and agents.

Git-backed portability

Published content can sync one-way to a Git repository with scheduled reconciliation and sync-on-publish; versioned ZIP export and Wiki.js migration are built in.

Open standards, any provider

REST + OpenAPI content API, Markdown + frontmatter export, and a provider registry spanning OpenAI-compatible, OpenRouter, Anthropic, Kimi, Z.ai, and more.

Optional Feishu integration

Bind your Wiki account, ask grounded questions, and receive event notifications inside Feishu. An in-process module that stays inert until configured.

// AI-Native architecture

A governed knowledge loop, not a chat box

Conversations and sources become append-only raw evidence; AI retrieves, synthesizes, and drafts; humans review and publish — durable, searchable wiki memory with every boundary visible.

The knowledge loop

Conversation / source / command output
Raw, append-only evidence
AI retrieval, synthesis & drafts
Human review & publication
Durable, searchable wiki memory

Web UI

Editor · AI side pane · Admin

Permission-scoped memory store

raw evidence · generated concepts · public wiki

MCP Server

MCP & Skill · 26 tools · proposals

Works with:ClaudeCursorMCP-compatible clientsFuture AI assistants

Two writing modes, switch anytime

Copilot

Conventional wiki

Humans and AI collaborate in the default wiki space — drafts and publication remain the primary workflow.

LLM Wiki

Evidence-first memory

raw stores append-only source material with original bytes, generated stores AI-produced concepts with provenance, and default stays the curated public wiki — publish concepts via soft links.

Mode switches run as a transactional migration: content is read-only while pending, path conflicts get deterministic suffixes and are reported in the admin UI.

// Tech stack

Modern, restrained, all open source

Only the necessary dependencies — every layer is a mainstream, replaceable open-source choice.

App framework

  • Next.js 16 · App Router
  • React 19
  • TypeScript 5
  • Tailwind CSS
  • next-intl (en/zh)

Data & jobs

  • PostgreSQL 16 + pgvector
  • Drizzle ORM
  • pg-boss jobs
  • Local / S3 content backends
  • Git sync (one-way)

AI & rendering

  • Built-in MCP tool runtime
  • @next-wiki/mcp-server
  • remark / rehype + KaTeX + Mermaid
  • OpenRouter · Anthropic · Kimi · Z.ai
  • OpenAPI public API

Engineering

  • Turborepo Monorepo
  • pnpm
  • Docker Compose
  • Vitest + Playwright
  • Caddy + Cloudflare

// Quick start

Four steps to your own knowledge vault

01

Clone the repo

All you need is Docker with Docker Compose.

02

Configure env

Copy .env.example; adjust ports and the encryption key as needed.

03

One-command launch

First run migrates the database and seeds itself automatically.

04

Start writing

Open localhost:3000 and pick a writing mode — done.

terminal

$ git clone https://github.com/hugogu/next-wiki.git

$ cd next-wiki

$ cp .env.example .env

$ docker compose up -d --build

# Open your browser

→ http://localhost:3000

An AI memory you can run, inspect, and export

Apache-2.0 licensed. Stars, issues, and contributions are welcome.

Visit GitHub