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 & cloudMigrationsExamplesSessions and memory
Keep conversation history, context blocks, branches, search, and compaction close to the agent.
One session
Ayjnt’s createSession() returns Cloudflare’s Session builder backed by the agent’s SQLite. Add stable identity or instructions as a context block, and give learned memory a bounded token budget.
import { Agent } from "ayjnt";
export default class Assistant extends Agent {
session = this.createSession()
.withContext("soul", {
provider: { get: async () => "You are a careful project assistant." },
})
.withContext("memory", {
description: "Useful facts learned about the person",
maxTokens: 1100,
})
.withCachedPrompt();
async remember(message: Parameters<typeof this.session.appendMessage>[0]) {
await this.session.appendMessage(message);
return this.session.getHistory();
}
}Many sessions
Use createSession(id) when you already know the namespace, or createSessionManager() to create, list, branch, and archive multiple conversations inside one agent instance.
Session compaction summarizes older turns without rewriting your agent’s state. Search providers and context blocks let a harness load relevant memory instead of replaying everything.