Build powerful plugins for Adverant Nexus with our comprehensive SDK
npm install @adverant-nexus/sdk
The SDK is compatible with Node.js 18+ and includes TypeScript definitions.
pip install adverant-nexus-sdk
Python SDK requires Python 3.9 or higher.
Plugins extend Nexus through the Model Context Protocol (MCP), providing tools, resources, and prompts that AI agents can discover and use.
The Nexus Client provides access to core platform services:
import { NexusClient } from '@adverant-nexus/sdk'
const nexus = new NexusClient({
apiKey: process.env.BRAIN_API_KEY
})
// Access GraphRAG memory
await nexus.graphrag.storeMemory({
content: 'Important information',
tags: ['customer', 'analysis']
})
// Orchestrate sub-agents
await nexus.agents.orchestrate({
task: 'Analyze customer feedback',
agents: ['sentiment', 'summarization']
})import { NexusPluginServer, Tool } from '@adverant-nexus/sdk/server'
const server = new NexusPluginServer({
name: 'my-plugin',
version: '1.0.0',
description: 'My awesome plugin'
})
// Define a tool
server.tool(new Tool({
name: 'analyze_data',
description: 'Analyzes data and returns insights',
inputSchema: {
type: 'object',
properties: {
data: { type: 'array' },
options: { type: 'object' }
},
required: ['data']
},
execute: async (input) => {
// Your implementation
return { insights: [...] }
}
}))
// Start the server
await server.start()// GraphRAG Memory
await nexus.graphrag.storeMemory({ content, tags })
await nexus.graphrag.query({ query, limit: 10 })
// Agent Orchestration
await nexus.agents.orchestrate({ task, agents })
// Learning System
await nexus.learning.recordPattern({ pattern, feedback })A basic plugin that provides a greeting tool:
import { NexusPluginServer, Tool } from '@adverant-nexus/sdk/server'
const server = new NexusPluginServer({
name: 'greeter',
version: '1.0.0'
})
server.tool(new Tool({
name: 'greet',
description: 'Greets a user by name',
inputSchema: {
type: 'object',
properties: {
name: { type: 'string' }
},
required: ['name']
},
execute: async ({ name }) => {
return { message: `Hello, ${name}!` }
}
}))
await server.start()