How Tian AI Builds a Million-Entry Knowledge Base on Your Phone
Tian AI includes a massive local knowledge base β millions of indexed concepts across 100+ domains, stored in a single SQLite file, searchable in ~0.04 seconds.
The Problem
Large language models like GPT-4 store knowledge in their weights. Smaller local models (1.5B parameters) have limited knowledge capacity. The solution: augment the LLM with an external knowledge base .
The Architecture
User Query β KnowledgeRetriever β Confidence > 0.8? β Direct Answer β No Inject context into LLM prompt β LLM generates augmented response
Enter fullscreen mode
Exit fullscreen mode
Database Schema
CREATE TABLE IF NOT EXISTS concepts ( id INTEGER PRIMARY KEY AUTOINCREMENT , concept TEXT NOT NULL , category TEXT , response_template TEXT , question_patterns TEXT );
CREATE VIRTUAL TABLE IF NOT EXISTS concepts_fts USING fts5 ( concept , category , response_template , question_patterns );
Enter fullscreen mode
Exit fullscreen mode
Each conceptβ¦