Documentation menu
Start here
IntroductionGetting startedWrite an agentProject anatomyUnderstand Ayjnt
Harness engineeringTwo runtimesHuman interfacesHow agents workHost bridgeAgent capabilities
Callable methodsState & SQLiteSessions & memorySchedulingWorkflowsDurable executionInter-agent RPCSub-agentsToolsWebAssembly modulesInterfaces & integrations
Browser clientRouting & middlewareVoiceBrowser toolsMCPEmailObservabilityCLI
Command overviewnewdevrunbuildcompilemigratedeployAPI reference
AgentAgentClientWorkflow classesLocal & cloudMigrationsExamplesInter-agent communication
Call a separately bound agent by durable name with typed RPC.
Use this.agent inside Ayjnt Agent
The protected this.agent() helper is Ayjnt’s typed wrapper around Cloudflare getAgentByName(). The target has its own top-level Durable Object namespace and storage.
import { Agent } from "ayjnt";
import InventoryAgent from "../inventory/agent";
export default class OrdersAgent extends Agent {
async reserve(sku: string, quantity: number) {
const inventory = await this.agent(InventoryAgent, "primary");
return inventory.reserve(sku, quantity);
}
}Outside an Agent
Import getAgent<T>() from ayjnt when calling from a Worker handler or other framework code. Browser code should use callable methods instead of a Durable Object binding.
Internal agent RPC does not need @callable(). Public methods are callable through the typed Durable Object stub.