Menu

Tian AI Knowledge Base: Million Entries on Your Phone
πŸ“°

Tian AI Knowledge Base: Million Entries on Your Phone

DEV CommunityΒ·Jeffrey.FeillpΒ·6 months ago
#SMJjD22T
#database#ai#python#knowledge#concept
Reading 0:00
15s threshold

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…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.