Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Quickstart

Get LocusGraph running in under five minutes: install, store knowledge, retrieve it.

Prerequisites

You need an agent secret from the LocusGraph dashboard. See Authentication if you don't have one yet.

Install

1
Install the SDK
npm install @locusgraph/client
2
Initialize the client
import { LocusGraphClient } from '@locusgraph/client';
 
const client = new LocusGraphClient({
  agentSecret: process.env.LOCUSGRAPH_AGENT_SECRET,
  graphId: 'default',
});
3
Store knowledge

Send an event to the wisdom graph. The admission pipeline processes it into a locus automatically.

await client.storeEvent({
  graph_id: 'default',
  event_kind: 'fact',
  source: 'agent',
  payload: { topic: 'user_preference', value: 'dark mode' },
});
4
Retrieve wisdom

Query the graph to pull back relevant knowledge.

const result = await client.retrieveMemories({
  query: 'user preferences',
  limit: 5,
});
 
console.log(result);

Start with the fact event kind for simple key-value knowledge. Explore other event kinds like action, decision, and observation as your agent grows.

Next

Authentication
Set up agent secrets and environment variables.
Memories & Events
Understand how knowledge flows through the wisdom graph.