Skip to content

@agentctx/sdk

A high-level SDK that provides ergonomic abstractions for building agent-powered applications. Wraps @agentctx/core with convenience methods and builder patterns.

Terminal window
npm install @agentctx/sdk
import { AgentCTX } from '@agentctx/sdk';
// Initialize with automatic configuration
const ctx = await AgentCTX.init({
project: './my-project',
backends: [
{ id: 'github', command: 'npx -y @modelcontextprotocol/server-github', roles: ['code'] }
]
});
// Use the high-level API
const tools = await ctx.tools.search('github');
const result = await ctx.tools.call('github.issues.create', { title: 'Fix SSE handler' });
const memories = await ctx.memory.search('#arch @7d ^5');
await ctx.memory.store('decision', { tags: ['arch'], content: 'Use PASETO' });
const docs = await ctx.knowledge.search('authentication', { limit: 3 });
// Clean up
await ctx.close();
ctx.tools.search(query) // ?t <query>
ctx.tools.lookup(id) // !t <id>
ctx.tools.call(tool, args) // >t <tool> key=value
ctx.tools.register(schema) // +t <schema>
ctx.memory.search(filters) // ?m <filters>
ctx.memory.store(key, options) // +m <key> <tags> <payload>
ctx.memory.update(key, content) // ~m <key> <content>
ctx.memory.delete(key) // -m <key>
ctx.memory.relate(from, to) // +m @relate <from>-><edge>-><to>
ctx.memory.traverse(key, depth) // ?m @traverse <key> #depth:<n>
ctx.knowledge.search(query, opts) // ?k <query> <filters>
ctx.knowledge.lookup(id) // !k <id>
ctx.knowledge.ingest(path) // +k source=<path>
ctx.agents.search(query) // ?a <query>
ctx.agents.delegate(task, agent) // ^a <task> agent=<id>
const report = await ctx.verify();
// { valid: 42, invalid: 0, total: 42 }
const ctx = await AgentCTX.builder()
.project('./my-project')
.backend('github', {
command: 'npx -y @modelcontextprotocol/server-github',
roles: ['code', 'issues']
})
.backend('filesystem', {
command: 'npx -y @modelcontextprotocol/server-filesystem .',
roles: ['files']
})
.memory({ layers: ['ephemeral', 'individual', 'team'] })
.knowledge({ sources: ['docs/', 'src/'] })
.build();