Guides
Local knowledge & RAG
Install, search, and govern on-device knowledge.
- 1
Install documents
Chunking (sentence-boundary, with overlap) and indexing happen at install time.
await lybo.installKnowledge({ doc_id: "manual", title: "Pump Manual", body: "The seal on pump unit seven…", scope: "app", // or a pack id / "org" / "user" expires_ms: null, // expired chunks never surface }); - 2
Enable hybrid search (optional, recommended)
Blends BM25 keyword scoring with embedding cosine similarity; also upgrades intent routing to handle paraphrases.
lybo studio --semantic # or rt.enable_semantic_routing(None)
- 3
Query through the retrieval pattern
Answers are grounded in retrieved chunks only, carry source titles, and say “no local information” rather than inventing content.
- Scopes partition knowledge (per pack, org, user) and are enforced at query time.
- Compression trims each hit to fit small context windows before prompting.
- Knowledge packs version and update content over the air with review/expiry dates.