Changelog
All notable changes to AgentVM will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
Nothing yet — v0.3.0 is the current release.
0.3.0 — 2026-05-05
Added
- Framework Adapters (
src/adapters/)- LangChain.js adapter (
adapters/langchain.ts)toolToLangChain(tool)— convert a single AgentVM tool to LangChainDynamicStructuredToolshapetoLangChainTools(kernel, filter?)— convert all (or filtered) tools at oncetoLangChainMemory(kernel, namespace, options?)— use AgentVM memory as LangChainBaseMemory- Supports
memoryKey,maxEntries,returnFormat('string' | 'array') loadMemoryVariables(),saveContext(),clear()interface
- Supports
- Vercel AI SDK adapter (
adapters/vercel-ai.ts)toolToAISDK(tool)— convert a single tool to AI SDKtool()formattoAISDKTools(kernel, filter?)— returnsRecord<string, tool>forgenerateText({ tools })createUsageTracker(kernel, namespace)— record AI SDK token usage into AgentVM memory
- Generic adapter (
adapters/generic.ts)toOpenAITools(kernel)— OpenAI function-calling format (works with LiteLLM, Ollama, etc.)toAnthropicTools(kernel)— Anthropic tool format (name,description,input_schema)createToolExecutor(kernel)— generic(toolName, args) => resultfor any model responseserveMCP(kernel)— expose AgentVM tools as an MCP server over stdio (for Claude Desktop, Cursor, etc.)describeTools(kernel)— human-readable tool summary for debugging
- All adapters are zero-dependency — they produce plain objects matching each framework's interface
- 34 adapter tests covering all conversion formats and integration with built-in tools
- LangChain.js adapter (
- Pluggable Memory Backends
MemoryBackendinterface — 8-method contract (get,set,delete,list,clear,deleteNamespace,stats,close)InMemoryBackend— refactored default backend, fully backward compatibleSqliteBackend— file-based persistence using sql.js (pure WASM, no native bindings)SqliteBackend.create('./data.db')— async factory, loads existing DB or creates new- Auto-flush dirty writes to disk every 5 seconds
flush()for manual persistence,close()for graceful shutdown
MemoryBusnow accepts anyMemoryBackendvia constructorMemoryBus.statsAsync()— full async stats from the backendMemoryBus.close()— flush and release backend resources
- Agent Contract Enforcement
validateSchema()— recursive schema validator forstring,number,boolean,object,arraywith nestedproperties,required, anditemsvalidateInput()/validateOutput()— called automatically inKernel.execute()when agent has acontractContractValidationError— thrown with agent name, phase (input/output), and violation details- SLA enforcement —
Kernel.execute()emitscontract:sla:latencyevent when execution exceedscontract.maxLatency
- YAML Config System
loadConfig('agentvm.yml')— parse, validate, and return typedAgentVMConfig- Built-in YAML parser (zero dependencies) — handles nested objects, arrays (block + flow), scalars, comments
validateConfig()— checks types, required fields, valid enums; returns array of error messagesConfigValidationErrorwith all violations listed- Environment variable overrides via
env:section in YAML
- Checkpointing
checkpoint(kernel, processId, path)— serialize process metadata + full memory snapshot to JSONrestore(kernel, path)— spawn a new process and restore all memory from checkpoint filereadCheckpoint(path)— inspect checkpoint data without restoring
- Resource Tracking & Kernel Stats
ExecutionResult.tokensUsed— automatically populated from__llm_usagein process memoryKernel.stats()— aggregate stats: agents, processes by state, memory backend info, tools, channels, total tokens
ProcessOptions.tokenBudget— type added for per-process token limitsKernelConfig.memoryBackend— pass aMemoryBackendinstance to the kernel constructor- New type exports:
MemoryBackend,MemoryBackendStats,AgentVMConfig,CheckpointData,KernelStats - 114 new unit tests (333 total across 9 test files)
Changed
MemoryBus— rewritten to useMemoryBackendinterface internally (backward compatible API)Kernelconstructor — acceptsmemoryBackendin config, passes it toMemoryBusKernel.execute()— now validates input/output contracts, tracks resource usage, checks SLA latencysrc/index.ts— exports config, checkpoint, and all new backend modules
Dependencies
- Added
sql.js(pure WASM SQLite) as optional dependency forSqliteBackend
0.2.2 — 2026-04-11
Added
MCPClient— connect to MCP servers over stdio or SSE transport, auto-discover and register tools- Full JSON-RPC 2.0 message passing with timeout handling
- Tool auto-registration: discovered tools appear in the
ToolRouterasmcp:<server>:<tool> - Resource discovery via
resources/list connect(),disconnect(),disconnectAll(),callTool(),readResource()API
createLLMAgent()factory — create AI agents backed by Anthropic or OpenAI models- Full agentic tool-use loop (up to
maxTurns, default 10) - Conversation history persisted in process memory across executions
- Token usage tracking in
__llm_usagememory key onBeforeCall,onAfterCall,onToolCallhooks- Both Anthropic (
claude-*) and OpenAI (gpt-*) provider support
- Full agentic tool-use loop (up to
createPipeline()— chain agents sequentially; each agent's output feeds the next- Built-in tools (
src/builtins/tools.ts) — practical tools ready to register:http_fetch— HTTP GET/POST/etc with headers, body, timeout (60 req/min)json_fetch— fetch + auto-parse JSON responseshell_exec— run shell commands, returns{ stdout, stderr, exitCode }file_read— read files with size limit guardfile_write— write/append files, creates parent directorieswait— sleep for N milliseconds (capped at 60s, respects AbortSignal)registerBuiltins(kernel)convenience function
- Kernel injects
__tool_schemasinto process memory at spawn time so LLM agents can discover tool definitions - New example projects:
llm-pipeline.ts(researcher → writer → editor chain),mcp-agent.ts(filesystem MCP server integration),llm-research-agent.ts - MCP types exported:
MCPServerConfig,MCPTool,MCPResource - LLM types exported:
LLMAgentConfig,LLMMessage,LLMResponse - Unit tests for LLM agent (
tests/unit/llm.test.ts) and MCP client (tests/unit/mcp.test.ts,tests/unit/mcp-stdio.test.ts) - Fake MCP server fixture for integration testing (
tests/fixtures/fake-mcp-server.mjs) - RFC-002 (Memory Bus Interface Contract) — accepted
- RFC-003 (Event Schema Specification) — accepted
Changed
src/index.ts—MCPClient,createLLMAgent,createPipeline, and all builtin tools now exported from the package rootExecutionContext.signal— AbortSignal now threaded through to builtin tool handlers for cancellation support
0.2.1 — 2026-04-05
Added
ToolRouter.getAvailableTools(allowedToolNames)— filter registered tools by an allowlistKernel.registerTool()convenience method (wrapskernel.tools.register()and emitstool:registered)Kernel.createChannel()convenience method (wrapskernel.broker.createChannel()and emitschannel:created)AgentContractinterface — typed input/output contracts withmaxLatencyandmaxCostSLA fields (types defined, runtime enforcement in v0.3.0)MemoryBus.stats— returns{ namespaces, totalEntries }MessageBroker.stats— returns{ channels, totalMessages }Scheduler.stats— returns{ queued, running, completed, failed }
Fixed
Process._terminate()is now idempotent — calling it twice no longer throwsKernel.terminate()cleans up process memory namespace whenagent.memory.persistentis falseToolRouterrate limiter key now scoped pertoolName:agentNameto prevent cross-agent bleed
0.2.0 — 2026-03-31
Added
ToolRouter— central tool registry with registration, invocation, and per-tool rate limitingregister(),unregister(),getTool(),invoke(),getAvailableTools()ToolNotFoundError,ToolExecutionError,ToolRateLimitErrorerror classes- Per-tool
rateLimit(calls/minute), per-agent counter scoping
MessageBroker— inter-agent communication with pub/sub and direct channelscreateChannel(),deleteChannel(),publish(),subscribe(),sendDirect()- Channel history with configurable
historyLimit - Direct channel auto-creation (
__direct__:a:bnaming) - Subscriber errors caught — bad handlers don't break delivery
Scheduler— multi-strategy task execution enginesequential— dependency-ordered, fail-fastparallel— layer-based parallel execution respectingdependsOnrace— first-to-finish winsconditional— stop on falsy resultenqueue()/enqueueAll()with priority sorting- Retry policies:
fixedandexponentialbackoff withmaxAttempts - Circular dependency detection
Kernel.execute()— execute a task on a running process viaExecutionContextctx.memory— scopedMemoryAccessorfor the processctx.useTool()— invoke tools with agent permission enforcementctx.publish()— publish to broker channelsctx.emit()— emit customagent:<event>eventsctx.signal— AbortSignal for cancellation- Agent tool allowlist enforcement: undeclared tools are blocked
- Execution metadata stored on process (
lastExecution) - Process transitions to
crashedon unhandled handler errors
- CLI commands:
agentvm init,agentvm start,agentvm spawn,agentvm ps,agentvm kill,agentvm logs MemoryBus.getSharedAccessor()— cross-process shared memory namespaceMemoryEntryTTL support — expired entries auto-deleted onget()Process.signal—AbortSignalautomatically aborted on terminate/crashProcess.getMetadata()/setMetadata()— per-process key-value metadata storeProcess.info— immutableProcessInfosnapshot (deep-copied metadata)Kernel.getProcesses()filter — byagentName,state, oractive(running + paused)Kernel.shutdown()— terminates all active processesKernel.onAny()— subscribe to all events with a wildcard handlerKernel.debugmode — logs all emitted events toconsole.warn
0.1.0 — 2026-03-26
Added
- Initial project scaffolding — TypeScript, tsup, vitest, ESLint, Prettier, husky
Kernelclass — agent registry, process lifecycle, event systemAgentclass — typed agent definitions with name validationProcessclass — state machine (created → starting → running → paused → terminated | crashed)MemoryBus— namespaced in-memory key-value store with shared memory namespaceProcessStateenum and all core types insrc/core/types.tsKernelEventstructured event system withon()/onAny()/ unsubscribe supportKernel.spawn()— create a running process from a registered agent definitionKernel.pause(),resume(),terminate()— full process lifecycle managementKernel.maxProcessesconfig — cap concurrent active processes- Unit tests for
Agent,Process,Kernel,MemoryBus - GitHub Actions CI/CD (test on push/PR, publish on tag)
- RFC-001 (Process State Machine Design) — accepted
- Architecture Overview documentation
- Getting Started guide
- 3 example projects:
hello-world.ts,multi-agent.ts,memory-demo.ts - MIT License, Code of Conduct, Contributing guide
