@agentctx/sdk
@agentctx/sdk
Section titled “@agentctx/sdk”A high-level SDK that provides ergonomic abstractions for building agent-powered applications. Wraps @agentctx/core with convenience methods and builder patterns.
Installation
Section titled “Installation”npm install @agentctx/sdkQuick Start
Section titled “Quick Start”import { AgentCTX } from '@agentctx/sdk';
// Initialize with automatic configurationconst ctx = await AgentCTX.init({ project: './my-project', backends: [ { id: 'github', command: 'npx -y @modelcontextprotocol/server-github', roles: ['code'] } ]});
// Use the high-level APIconst 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 upawait ctx.close();API Overview
Section titled “API Overview”ctx.tools
Section titled “ctx.tools”ctx.tools.search(query) // ?t <query>ctx.tools.lookup(id) // !t <id>ctx.tools.call(tool, args) // >t <tool> key=valuectx.tools.register(schema) // +t <schema>ctx.memory
Section titled “ctx.memory”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
Section titled “ctx.knowledge”ctx.knowledge.search(query, opts) // ?k <query> <filters>ctx.knowledge.lookup(id) // !k <id>ctx.knowledge.ingest(path) // +k source=<path>ctx.agents
Section titled “ctx.agents”ctx.agents.search(query) // ?a <query>ctx.agents.delegate(task, agent) // ^a <task> agent=<id>ctx.verify()
Section titled “ctx.verify()”const report = await ctx.verify();// { valid: 42, invalid: 0, total: 42 }Builder Pattern
Section titled “Builder Pattern”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();See Also
Section titled “See Also”- @agentctx/core — lower-level runtime API
- @agentctx/client — remote gateway client
- Quick Start — get started