git-lex

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.

Quick Start

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"

No database

Everything lives in git. No binary stores, no external services. The .lex/ directory is your knowledge graph index — diffable, mergeable, portable.

Structured frontmatter

YAML frontmatter with typed properties. Contacts, tasks, decisions, research, memories — each with its own schema. Dot notation keeps it clean.

Automatic extraction

@mentions and [[wikilinks]] are extracted from document bodies and commit messages into RDF triples. Relationships emerge naturally.

SPARQL queryable

Query your knowledge graph with SPARQL. Auto-injected prefixes for git, frontmatter, and lex namespaces. Full graph traversal.

Kits

Pluggable document type systems. The solo kit ships with contacts, tasks, decisions, research, notes, and memories. Build your own.

Built on open standards

RDF, OWL, SPARQL, JSON-LD. Your knowledge graph is interoperable with the entire semantic web stack. No lock-in.

Commands

CommandWhat it does
git lex initInitialize 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 syncBuild the knowledge graph from git + extractions
git lex query "..."Run a SPARQL query against the graph
git lex statusShow extraction status
git lex serveStart a local SPARQL HTTP endpoint