Skip to main content

Knowledge Graph

LocalNest includes a temporal knowledge graph built on SQLite. Store structured facts as subject-predicate-object triples, query at any point in time, and walk relationships across multiple hops.

Entities

Entities represent people, projects, concepts, or any named thing.

ToolWhat it does
localnest_kg_add_entityCreate entity with name, type, and properties. IDs are auto-generated as normalized slugs.

Entity IDs are normalized slugs: Alice O'Brien becomes alice_o_brien. Entities are auto-created when first referenced in a triple.

Triples

Triples connect a subject to an object via a predicate, with optional temporal validity.

ToolWhat it does
localnest_kg_add_tripleAdd a fact: subject, predicate, object
localnest_kg_queryQuery all relationships for an entity
localnest_kg_invalidateMark a fact as no longer valid
Contradiction Detection

When you add a triple that conflicts with an existing valid triple (same subject + predicate, different object), LocalNest warns you. It never blocks the write.

Temporal Queries

Every triple has optional valid_from and valid_to dates.

ToolWhat it does
localnest_kg_as_ofWhat was true about entity X on date Y?
localnest_kg_timelineChronological evolution of all facts for an entity
localnest_kg_statsEntity count, triple count, predicate breakdown

Graph Traversal

Walk relationships 2-5 hops deep using SQLite recursive CTEs. No other local-first tool offers this.

ToolWhat it does
localnest_graph_traverseMulti-hop walk from a starting entity (default 2 hops, max 5)
localnest_graph_bridgesFind entities connected across different nests

CLI

localnest kg add Alice works_on ProjectX
localnest kg query Alice
localnest kg timeline Alice
localnest kg stats