Quickstart
This walks the core pipeline against the hosted data plane: write facts →
build indexes → search. You’ll do it with the TypeScript or Python SDK, or a
plain curl.
You need a stack and a stack API key. Create a stack in the
console and copy its key — it looks like lbb_sk_live_… or
lbb_sk_test_…. See Authentication & endpoints for the
details.
npm install @lbb/clientimport { LbbClient } from "@lbb/client";
const lbb = new LbbClient({ baseUrl: "https://db.eu.littlebigbrain.com", apiKey: process.env.LBB_API_KEY, // lbb_sk_live_… / lbb_sk_test_…});
// 1. Write facts (triplets) into the default graph.await lbb.graph("main").facts.create( { triplets: [ { source: { type: "SERVICE", name: "auth-service" }, relation: "WRITES_TO", target: { type: "DATABASE", name: "user-db" }, confidence: 0.93, evidence: "auth-service writes identity records to user-db", }, ], }, { idempotencyKey: "quickstart-1" },);
// 2. Build persisted BM25 + vector + adjacency indexes and wait for them.await lbb.indexes.run({ wait: true });
// 3. Run hybrid search over the snapshot.const results = await lbb.search.hybrid( "which systems store customer identity data", { topK: 5, source: "persisted", consistency: "strong", targets: ["entities", "assertions"] },);for (const a of results.assertions ?? []) { console.log(a.relation?.name, a.score);}pip install lbb-sdkfrom lbb import LbbClient
with LbbClient("https://db.eu.littlebigbrain.com", api_key="lbb_sk_live_...") as lbb: # 1. Write facts. lbb.graph("main").facts.create({ "triplets": [{ "source": {"type": "SERVICE", "name": "auth-service"}, "relation": "WRITES_TO", "target": {"type": "DATABASE", "name": "user-db"}, "confidence": 0.93, "evidence": "auth-service writes identity records to user-db", }], }, idempotency_key="quickstart-1")
# 2. Build indexes. lbb.indexes.run(wait=True)
# 3. Hybrid search. results = lbb.search.hybrid( "which systems store customer identity data", top_k=5, source="persisted", consistency="strong", targets=["entities", "assertions"], ) for a in results.get("assertions", []): print(a["relation"]["name"], a["score"])export LBB_URL=https://db.eu.littlebigbrain.comexport LBB_KEY=lbb_sk_live_...
# 1. Write facts.curl -sS -X POST "$LBB_URL/v1/graph/commit?graph=main" \ -H "Authorization: Bearer $LBB_KEY" \ -H "Idempotency-Key: quickstart-1" \ -H "Content-Type: application/json" \ -d '{"triplets":[{"source":{"type":"SERVICE","name":"auth-service"}, "relation":"WRITES_TO","target":{"type":"DATABASE","name":"user-db"}, "confidence":0.93,"evidence":"auth-service writes identity records to user-db"}]}'
# 2. Build indexes.curl -sS -X POST "$LBB_URL/v1/index/run?graph=main&wait=true" -H "Authorization: Bearer $LBB_KEY"
# 3. Hybrid search.curl -sS "$LBB_URL/v1/search?graph=main&source=persisted&query=which%20systems%20store%20customer%20identity%20data" \ -H "Authorization: Bearer $LBB_KEY"Prefer not to write code first? Do the same three steps visually in the console — load data, build indexes in Retrieval → Indexes, and run a search in Search & eval.
What just happened
Section titled “What just happened”- Write appended immutable graph events (entities, a relation event, and the evidence that supports it) to the write-ahead log.
- Index built persisted BM25, vector/ANN, and adjacency runs — disposable accelerators derived from the graph snapshot.
- Search fused lexical + BM25 + vector + ontology + graph-neighborhood
signals over one snapshot, with
strongconsistency overlaying any facts committed after the index run.
Read Core concepts to understand snapshots, consistency, and the append-only model, then head to the use-case guides.