@wazoo/tools works with Mastra agents out of the box.
Installation
Install Mastra core and the Wazoo AI tools:Usage
You can pass@wazoo/tools directly to a Mastra Agent.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Connect Worlds to Mastra
@wazoo/tools works with Mastra agents out of the box.
npm i @mastra/core && npx jsr add @wazoo/tools
deno add npm:@mastra/core jsr:@wazoo/tools
pnpm add @mastra/core && pnpm dlx jsr add @wazoo/tools
yarn add @mastra/core && yarn dlx jsr add @wazoo/tools
bun add @mastra/core && bunx jsr add @wazoo/tools
@wazoo/tools directly to a Mastra Agent.
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
import { WorldsSdk } from "@worlds/sdk";
import { RdfjsQuadStore, RdfjsSearchIndex } from "@worlds/sdk/rdfjs";
import { WazooSparqlEngine } from "@wazoo/sparql-engine";
import { Store } from "n3";
import { createTools } from "@wazoo/tools";
const store = new Store();
const client = new WorldsSdk({
quadStore: new RdfjsQuadStore(store),
searchIndex: new RdfjsSearchIndex(store),
sparqlEngine: new WazooSparqlEngine({ store }),
});
const { executeSparql, searchWorld } = createTools({
client,
});
// Create a Mastra agent with Worlds tools
const agent = new Agent({
name: "WorldsAgent",
instructions: "You are a knowledge graph assistant.",
model: openai("gpt-4o"),
tools: {
executeSparql,
searchWorld,
},
});
const result = await agent.generate("Find all people in my world.");
console.log(result.text);
import { Agent } from "@mastra/core/agent";
import { openai } from "@ai-sdk/openai";
import { createSearchWorldTool } from "@wazoo/tools";
// client is the @worlds/sdk instance from the usage example above.
const agent = new Agent({
name: "SearchAgent",
model: openai("gpt-4o"),
tools: {
searchWorld: createSearchWorldTool(client),
},
});