Architecture
Design principle
git-lex treats git as the database. Instead of building a separate knowledge store and syncing it with git, git-lex derives structured knowledge directly from git’s content-addressed storage.
Repository structure
my-project/
├── .lex/
│ ├── schema/ # Kit type definitions (OWL/RDFS)
│ ├── extraction.log # Which files have been extracted
│ ├── graphs/ # RDF graph files (N-Triples)
│ └── config.toml # git-lex configuration
├── notes/ # Your documents (markdown)
├── contacts/
├── tasks/
└── ...
Data flow
- Write — Author markdown documents with YAML frontmatter
- Save —
git lex savecommits and triggers extraction - Extract — Frontmatter properties become RDF triples;
@mentionsand[[wikilinks]]become relationship triples - Sync —
git lex syncbuilds the complete knowledge graph from git history + extractions - Query —
git lex queryruns SPARQL against the graph
No binary stores
Everything in .lex/ is text-based and git-diff-friendly. No SQLite, no RocksDB, no binary indexes. This means:
- Knowledge graphs can be merged with standard git merge
- Diffs show exactly what changed in the graph
- The entire knowledge state is versioned with your content
- Any git host (GitHub, GitLab, etc.) can serve as backup
Namespaces
git-lex uses RDF namespaces to organize triples:
| Prefix | URI | Purpose |
|---|---|---|
git: |
https://repolex.ai/ontology/git/ |
Git metadata (commits, authors, timestamps) |
fm: |
https://repolex.ai/ontology/frontmatter/ |
Frontmatter properties |
lex: |
https://repolex.ai/ontology/lex/ |
git-lex relationships (mentions, linksTo) |
lex-o: |
https://repolex.ai/ontology/lex-o/ |
git-lex ontology classes |
solo: |
https://repolex.ai/ontology/solo/ |
Solo kit types and properties |
Kits
Kits are pluggable type systems distributed as git-lex packages. A kit defines:
- Document types with typed properties
- Templates for
git lex create - Schema (OWL/RDFS) for validation and reasoning
- Extraction rules for custom property handling
The solo kit is built-in. Custom kits can be installed from git repositories.