A neuro-symbolic world model. Two systems sharing one query language: an RDF-star
triplestore (explicit memory, exact answers) plus a transformer trained on the same triples (implicit memory,
plausible answers). Generated facts write back into the store as RDF-star annotations with
propositionInferredFrom citation edges.
Loka is serverless by default — open a .sdb file, no daemon, no config. Install, configure, and query entirely from the command line. The agent installer (loka install-agent) walks an LLM through configuration via structured Markdown prompts. Start here: the GitHub repo's README documents the engine and the model series; CLAUDE.md is the canonical context file for agent assistants.
Vector embeddings are stored as RDF triples and indexed by HNSW. Not a sidecar — a first-class part of the graph. One query language for both.
VECTOR_SIMILAR and VECTOR_SCORE extend standard SPARQL. Traverse the graph, jump into vector space, come back — all in one query.
Like SQLite for graph+vector data. Open a .sdb file, query it. No daemon, no config. Server mode is opt-in when you need HTTP access.
Triples about triples, natively. Annotate edges with confidence scores, embeddings, provenance — no reification hacks.
SPO/POS/OSP indexes on interned u64 IDs. HNSW with cosine/euclidean/dot product. No bloat, no ORMs, no magic.
A superset of RDF 1.2 and SPARQL 1.1. Any valid standard query works. Extensions add what the standards can't express.
Remove a node and every model-generated inference that transitively cited it disappears — bounded to provenance edges, real→real is never a dependency. Preview-by-default; commit explicitly. How it works →
Everything the W3C standards do, plus what they can't.
RDF 1.2: triple terms in object position only
+ Loka: triple terms in any position (RDF-star)
+ Native vector literals (loka:f32vec)
+ HNSW index per vector predicate
SPARQL 1.1: SELECT, FILTER, OPTIONAL, UNION...
+ VECTOR_SIMILAR() — ANN search in graph patterns
+ VECTOR_SCORE() — similarity ranking in ORDER BY
+ ef:= and k:= query hints for HNSW tuning
Find academic papers similar to a query vector that cite papers by a specific author:
PREFIX ex: <http://example.org/> SELECT ?paper ?title WHERE { # Jump into vector space: find similar papers VECTOR_SIMILAR(?paper ex:hasEmbedding "0.23 -0.11 0.87 ..."^^loka:f32vec, 0.85) # Back to graph: filter by citation chain ?paper ex:cites ?cited . ?cited ex:author <http://example.org/Vaswani> . ?paper ex:title ?title . } ORDER BY DESC(VECTOR_SCORE(?paper ex:hasEmbedding "0.23 -0.11 0.87 ..."^^loka:f32vec)) LIMIT 10
The Windows installer asks whether you want the database alone, or the database plus the inference model it ships with. Pick the model and Loka is wired for generative queries on first run; skip it and you have a pure triplestore.
File format: .sdb — a superset of RDF containing triples + HNSW vector indexes.
Query directly (no server needed): loka query "SELECT * WHERE { ?s ?p ?o } LIMIT 10"
|
Optional server: loka serve --port 3030