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

Environment Variables

Every configuration option available for LocusGraph SDKs. Two variables are enough to point any SDK at your Structured Agent Knowledge graph.

Reference

VariableRequiredDefaultDescription
LOCUSGRAPH_SERVER_URLNohttps://api.locusgraph.comAPI server URL
LOCUSGRAPH_AGENT_SECRETYesAgent authentication token

Setting Environment Variables

Create a .env file in your project root:

# .env file
LOCUSGRAPH_SERVER_URL=https://api.locusgraph.com
LOCUSGRAPH_AGENT_SECRET=your-agent-secret
Never commit LOCUSGRAPH_AGENT_SECRET to version control. Add .env to your .gitignore immediately.

Per-Language Usage

TypeScript reads from environment automatically, or accepts explicit config:

const client = new LocusGraphClient({
  serverUrl: process.env.LOCUSGRAPH_SERVER_URL,
  agentSecret: process.env.LOCUSGRAPH_AGENT_SECRET,
});

Python reads from environment automatically, or accepts constructor arguments:

client = LocusGraphClient(
    server_url=os.environ.get("LOCUSGRAPH_SERVER_URL"),
    agent_secret=os.environ.get("LOCUSGRAPH_AGENT_SECRET"),
)

Rust reads from environment automatically, or accepts config:

let client = LocusGraphClient::new(None); // reads from env

All three SDKs follow the same priority: explicit config overrides environment variables, which override defaults. If you pass None or omit a field, the SDK falls back to the environment variable. If that is unset, it uses the default (for LOCUSGRAPH_SERVER_URL) or returns an error (for LOCUSGRAPH_AGENT_SECRET).

Next

Authentication
Error Handling