Skip to main content
The Worlds API SDK is the easiest way to interact with the API. It provides a fully typed interface for managing worlds, executing SPARQL queries, and performing vector searches.

Installation

Install the package via your preferred package manager (using JSR):
npx jsr add @fartlabs/worlds

Basic Usage

Initialize the client with your API key.
import { World } from "@fartlabs/worlds";

// Initialize the client for a specific world.
const world = new World({
  baseUrl: "https://api.wazoo.tech/v1", // Adjust if using a different endpoint
  apiKey: "your-api-key",
  worldId: "my-knowledge-base",
});

// Run a SPARQL query
const result = await world.sparqlQuery(`
  SELECT ?s ?p ?o WHERE {
    ?s ?p ?o .
  } LIMIT 10
`);

console.log(result);