yijiejiang/kaogong-school
Self-hosted multi-agent tutor for Chinese civil service exam prep
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Tracked from daily D1 telemetry snapshots. Hover any data point for exact daily star counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
Kaogong School is organized around one chat entry point, not a collection of independent bots. The Next.js 15 web app and native SwiftUI client use a Python 3.12 FastAPI backend over REST and SSE. A counselor built around Google ADK routes work to specialist roles for supervision, exam assembly, grading, tutoring and material collection or organization. Each role can use a different OpenAI-compatible model, and users can inspect handoffs and tool calls in the chat interface.
The data model distinguishes source documents, tagged questions, saved analyses and reusable skills. Ingestion creates retrievable chunks; question extraction runs as a background job with a progress endpoint. The tutor consults the skill map and material library, while grading feeds errors and mastery data back into study planning. Retrieval defaults to local hash-384 embeddings and can use a configured embedding API. Extension points include model endpoints and Git skill packs that follow the references/ layout.
Key Capabilities & Differentiators
The material library accepts PDF, DOCX, TXT, Markdown, web pages, images, audio, and Bilibili or YouTube video. Chunks can link back to source pages; for image-heavy questions that text extraction misses, multimodal extraction can retain the question crop alongside the recognized text. Video ingestion prefers captions, then falls back to transcription and aligns narration with OCR and timestamped keyframes. Saved analyses can render formulas, tables and diagrams in a full-screen presentation on web and iOS.
The exam workflow supports filtering by subject, module, difficulty and tag, timed attempts with autosave, objective scoring and model-assisted rubric grading for written answers. Online question selection extracts complete questions from search results rather than inventing replacements. Paper grading accepts 1–30 photos and requires review before results enter the question bank and update learner analytics. The OpenAI-compatible presets include DeepSeek, OpenCode Go and Ollama; OCR, search and speech capabilities depend on the configured service or local fallback.
Trade-offs & Limitations
Compared with a general self-hosted RAG workspace, the advantage is what happens after retrieval: a tagged question can be selected for an exam, scored and linked to a mastery update. Compared with a curated exam platform, there is more control over source material and model choice, but question coverage depends on what you import or can find online. Question-to-skill matching is heuristic, and mastery without real attempts is shown as an estimate rather than measured performance.
Self-hosting does not mean offline processing. Hosted inference, OCR and speech services can process inputs remotely and add usage costs; local Ollama and faster-whisper shift some of that load to the host. Video ingestion uses fixed-interval frames without scene detection or visual chart interpretation, and caption restrictions can reduce an import to its description. Most importantly, there is no login authentication. Keep the app private as shipped, and add authentication, access controls and an appropriate upload storage plan before a shared public deployment.
Hardware & Deployment Guide
The local path uses Python 3.12, uv, Node 20+ and ffmpeg. Run make install and make start, then open http://localhost:3000. make demo exercises the workflow with canned model responses and local hash embeddings, without requiring an API key. macOS is relevant for Vision OCR and iOS builds, not the FastAPI backend itself. The iOS 17+ client can pair over the LAN or reach a private instance through Tailscale.
SQLite is the default. For external infrastructure, make infra brings up the supplied Compose services: pgvector on PostgreSQL 16 and Redis 7, with persistent volumes. This is not a full application Compose stack; PostgreSQL is selected separately via DATABASE_URL. There is no tagged release in the supplied metadata. Recent project changes include image-based PDF question extraction, stricter source-based online question selection and skill-source filtering.
Individual Chinese civil service exam candidates who already have PDFs, courses or past papers and want one private workspace for retrieval, targeted practice, grading and progress tracking.
You need a maintained question catalog out of the box, production-ready multi-user authentication, or high-quality offline OCR and grading without configuring local models.
Quick Start & Installation
cd backend uv add faster-whisper # 想要更准可以设 ASR_LOCAL_MODEL=medium
Comparison vs. Top Chat UI & AI Apps Alternatives
Full comparison →| Repository | Stars | 7d Trend | Stack | License | Core Positioning |
|---|---|---|---|---|---|
| kaogong-school ★ | 203 | +27 | Python | MIT | Self-hosted multi-agent tutor for Chinese civil service exam prep |
| unsloth | 80.7k | +380 | Python | Apache-2.0 | Local AI workspace for model chat, fine-tuning, and API serving |
| open-design | 110.9k | +1k | TypeScript | Apache-2.0 | Local-first design workspace that turns coding-agent output into reviewable prot |
| kirara-ai | 19.3k | +26 | Python | AGPL-3.0 | Self-hosted Python bot orchestration for multi-platform AI chat |
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/yijiejiang/kaogong-school.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about kaogong-school
How should a custom client handle chat and long-running extraction?
POST /api/chat/stream for SSE chat. For bulk extraction, POST /api/questions/extract/{material_id} returns a job ID; poll GET /api/questions/extract/jobs/{job_id} for progress. Treat the user_id query parameter as a learner selector, not authenticated identity.Do I need a GPU, and what drives host resource usage?
Can I use it commercially or host it for a study group?
When is it a better fit than a general RAG workspace or a curated exam platform?
Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy