baize icon

知天下万物
随问随答

Named after 白泽 (bái zé) — the all-knowing beast of Shānhǎijīng who spoke all tongues and answered every question.
A unified AI assistant across terminal, desktop, and WeChat. Pure Go. Local-first. No cloud required.

View on GitHub Quick Start

Everything you need,
nothing you don't

Pure Go. No cloud dependency. Just a single binary that turns your local machine into a personal AI knowledge hub with streaming chat, agent tools, and multi-session management.

Knowledge Base

Store and retrieve information using natural language. Supports text, images (with vision), and PDF documents. Auto-generated keywords with intelligent search scoring, per-project scoping, and debug tools to inspect retrieval plans.

Smart Reminders

Natural language scheduling: relative time ("2小时后")、daily recurring ("每天 09:00")、or absolute date/time. Multi-channel delivery across terminal, WeChat, and desktop with per-user targeting.

Multi-Interface

Terminal REPL for power users, native desktop app (Wails) with tray icon and session management, WeChat bridge with QR login and voice support. Streaming responses, chat export to Markdown, and multi-session switching across all surfaces.

AI-Powered Chat

Powered by OpenAI and Anthropic models with multi-profile management, encrypted API keys, and fine-grained tuning (temperature, top-p, penalties). Intent recognition auto-routes queries, with streaming output and structured option prompts.

Skills & Prompt Profiles

Extensible prompt-based skill packs with hot-loading and .zip import. Per-session skill activation influences routing and response style. Prompt profiles let you switch AI personas on the fly.

Local-First & Private

All data stays on your machine in local JSON/SQLite files. AES-encrypted API key storage, per-project data isolation, no cloud dependency, no telemetry. Your memories belong to you.

Three ways to think

Switch between modes to control how baize processes your queries — from direct AI chat to knowledge-grounded reasoning to autonomous tool use.

direct

Direct Mode

Questions go straight to the AI model without consulting the knowledge base. Best for general conversation, brainstorming, translation, and quick questions that don't need your personal context. Supports per-message override via @ai prefix.

knowledge

Knowledge Mode

Every query is enriched with relevant entries from your local knowledge base. The AI reviews, scores, and synthesizes your stored information before responding. Use @kb to trigger per-message, or /debug-search to inspect the retrieval plan.

agent

Agent Mode

Full tool-calling capability with 7 built-in tools (knowledge CRUD, reminder management) plus extensible external providers via MCP/NCP/ACP protocols. The AI autonomously decides next steps, calls tools, and synthesizes results.

Up and running in seconds

Clone, build, run. No complex setup, no external services required.

terminal
# Clone the repository
git clone https://github.com/xuzhougeng/baize.git
cd baize

# Build for your platform
make build-current

# Run the terminal REPL
./build/baize

# Or build the desktop app (requires Wails)
make build-desktop

# Cross-platform builds
make build-windows # Windows + NSIS installer
make build-macos # macOS + DMG
make build-linux # Linux
usage
# Remember something
/kb # Show current knowledge base
/kb remember The WiFi password for the office is quantum42fish

# Ask from your knowledge base
@kb What's the office WiFi password?

# Set a reminder
/notice 每天 09:00 Stand-up meeting
/notice 2小时后 喝水

# Switch knowledge base, profiles, and skills
/kb switch work # Change current knowledge base
/prompt use 1 # Switch AI persona
/skill load translate # Activate a skill

# Manage knowledge
/kb list # List all entries
/kb forget # Remove an entry
/kb append # Add to an existing entry

Clean & modular

Intentionally simple. Pure Go with zero database dependencies. Every component has a clear boundary and single responsibility.

internal/ai/
OpenAI & Anthropic integration, intent routing, search planning, agent step orchestration
internal/app/
Core service layer, conversation modes, tool provider registry (local/MCP/NCP/ACP), streaming
internal/knowledge/
Local JSON knowledge base with per-project scoping, keyword generation, search scoring
internal/reminder/
Cron-like scheduling, multi-channel delivery, natural language parsing (relative/absolute/recurring)
internal/modelconfig/
Multi-profile model management, AES-encrypted secrets, connection testing
internal/sessionstate/
Chat session snapshots: history, loaded skills, mode, prompt profile persistence
internal/skilllib/
Skill/prompt pack discovery, frontmatter parsing, hot-loading, .zip import
internal/weixin/
WeChat bridge: QR login, long-polling sync, text & voice handling, history scoping
internal/fileingest/
File processing pipeline: image vision (base64), PDF text extraction (go-fitz)
internal/promptlib/
Prompt profile storage, per-session persona switching, context injection

Runs everywhere you do

Windows
macOS
Linux