git extensions for knowledge graphs
What if git is the knowledge graph? Git already has content-addressed storage, branching, merging, diffing, blame, and a full temporal DAG.
git-lex extends git with structured knowledge.
Write markdown. Commit normally. git-lex extracts entities, relationships, and metadata into an RDF knowledge graph — tracked by git, queryable with SPARQL.
cargo install git-lex
cd my-project
git lex init --kit solo
git lex create note
git lex save "first note"
git lex query "SELECT ?s ?p ?o WHERE { ?s ?p ?o } LIMIT 10"
Everything lives in git. No binary stores, no external services. The .lex/ directory is your knowledge graph index — diffable, mergeable, portable.
YAML frontmatter with typed properties. Contacts, tasks, decisions, research, memories — each with its own schema. Dot notation keeps it clean.
@mentions and [[wikilinks]] are extracted from document bodies and commit messages into RDF triples. Relationships emerge naturally.
Query your knowledge graph with SPARQL. Auto-injected prefixes for git, frontmatter, and lex namespaces. Full graph traversal.
Pluggable document type systems. The solo kit ships with contacts, tasks, decisions, research, notes, and memories. Build your own.
RDF, OWL, SPARQL, JSON-LD. Your knowledge graph is interoperable with the entire semantic web stack. No lock-in.
| Command | What it does |
|---|---|
git lex init | Initialize git-lex in a repository |
git lex create <type> | Scaffold a new document from kit templates |
git lex save "msg" | Stage, commit, and extract in one step |
git lex sync | Build the knowledge graph from git + extractions |
git lex query "..." | Run a SPARQL query against the graph |
git lex status | Show extraction status |
git lex serve | Start a local SPARQL HTTP endpoint |