Changelog β
All notable changes to confused-ai are documented here.
Format: Keep a Changelog Β· Semantic Versioning
Full changelog
The authoritative CHANGELOG.md lives in the repository root.
View on GitHub β
v2.3.0 β Current β
Added β
- 9 Extended Multi-Agent Orchestration Patterns (
@confused-ai/orchestration) β Mixture-of-Agents (MoA), Actor-Critic loops, Socratic tutor guiding, Prompt Chaining pipelines, Program-of-Thought code sandbox runtimes, Skeleton-of-Thought parallel generation, Step-Back conceptual abstraction solvers, Rejection Sampling (Best-of-N) evaluations, and validation-driven Self-Correction. createGSDCoordinator()(Get Shit Done) β spec-driven workflow coordinator that executes project goals inPlan-Execute-Verify phases, using a workspace.planningfolder to isolate contexts.createRalphLoop()(RALF) β autonomous cycle executor that leverages fresh session isolation to prevent context bloat while propagating iteration summaries.MastermindContext Compression (@confused-ai/compression) β a multi-stage intelligent context compression suite featuring:CacheAligner(KV-cache prefix alignment).- Specialized crushers (
smart-crusherfor JSON, minifiers for Code, log timestamp/duplicate aggregators, XML, CSV). - Sliding-window group budget enforcers to prevent orphaned tool call/result pairs.
- Code & Context Reduction (CCR) annotations with
retrieveToolfor on-demand details recall.
v1.1.7 β
Added β
DbScheduleStore(@confused-ai/scheduler) β bridgesScheduleManagerwith anyAgentDbbackend. Persist schedules to SQLite, Postgres, MySQL, MongoDB, Redis, DynamoDB, or Turso with no custom glue code. See Scheduler β Production persistence.- DB health in
/healthendpoint βcreateHttpServicenow accepts adb?: AgentDboption. When provided,GET /health(and/v1/health) runs a livedb.health()probe. Returns HTTP 503 with{ status: 'degraded' }when the database is unreachable.
Fixed β
@confused-ai/dbβuuid()security β all 8 backends (InMemory, SQLite, Postgres, MongoDB, Redis, JSON, MySQL, DynamoDB, Turso) now generate IDs withcrypto.randomUUID()instead of the previousMath.random()-based implementation.@confused-ai/dbβinit()race condition β concurrent callers no longer double-initialize the connection. All async backends (Postgres, MongoDB, MySQL, DynamoDB, Turso) now share a single_initPromiseguard.PostgresAgentDbβgetKnowledgeItems(),getTrace(), andgetTraces()now correctly re-serialize JSONBcontentandmetadatacolumns to string (thepgdriver returns these as parsed objects).MongoAgentDbβ allfindOneandfindcalls now include{ projection: { _id: 0 } }so MongoDB's internal_idfield is never included in returned rows.DynamoDbAgentDbβ constructor now callsvalidateTableNames()to catch invalid table names at construction time instead of silently failing at runtime.DbSessionStoreβnow()helper now returns Unix epoch seconds (Math.floor(Date.now() / 1000)) to match theAgentDbtimestamp contract (was returning milliseconds, causingcreated_at/updated_atto be off by Γ1000).TursoAgentDbβ single-row casts (LibSqlRow β SessionRow,MemoryRow, etc.) now use theas unknown as Tdouble-cast pattern, fixing TypeScript strict-mode errors.PostgresAgentDbβclose()method was accidentally stripped during a refactor; restored.- Unified class API β
SimpleAgentandLegacyAgentwere removed from public exports;Agentis now the only class-based API and includes both legacy defaults and modern fluent methods. - Durable runtime lifecycle correctness β resume now rejects terminal workflows consistently; terminal-state handling no longer allows invalid resume paths.
- CQRS error propagation β event-bus handler failures are now surfaced via
AggregateErrorafter handlers run. - State machine lifecycle hardening β
start()is idempotent; transition commits insend()andjumpTo()are atomic (state changes apply only after targetonEntrysucceeds). - Snapshot restore semantics β snapshots persist startup status (
started); restore defaults legacy snapshots to started to avoid duplicate initialonEntryexecution.
v1.1.6 β
Changed β
Monorepo restructure β packages fully independent β
- All source code now lives in independently-built workspace packages under
packages/. Thesrc/directory is retained as a backward-compatible re-export barrel β no breaking API changes. packages/toolsrewritten with clean functionaldefineToolimplementations; removed all class-based files with broken relative imports.packages/test-utilsis now a fully standalone package:createMockLLM,createMockAgent,runScenariowith zero cross-package dependencies.- CI pipeline updated to 4 sequential jobs:
typecheck β lint β test (Node 18 / 20 / 22) β build all packages.
Fixed β
router/selectForBudgetβ removed incorrectΓ 1,000,000scaling; budget comparison is now a direct dollar-per-million comparison.adapter-redis/session-storeβ removed unnecessary optional chain on non-nullhGetAllresult; fixed template literal number type.tools/types.tsβ migrated from deprecatedZodTypeAnyβz.ZodType;_defprivate field access replaced with.def.- Removed 33 broken package copies that had relative
src/-path imports causing circular resolution failures. - Documentation URLs updated from
rvuyyuru2.github.io/agent-frameworktoconfused-ai.github.io/confused-aithroughout all docs. - Version consistency:
ARCHITECTURE.mdandSECURITY.mdnow match thepackage.jsonversion.
Security β
SECURITY.md: addedShellToolsandbox requirements section documenting blocked command patterns.SECURITY.md: documentedRedisRateLimiteras the required solution for multi-instance distributed rate limiting.README.md: qualified audit-logging claim β removed unqualified SOC 2 / HIPAA label; added compliance footnote.
v1.1.0 β
Added β
agent.stream() β async iterable streaming on every agent β
- Every
CreateAgentResultnow has a built-instream(prompt, options?)method - Returns an
AsyncIterable<string>β chunks arrive as the LLM generates - Works with
for awaitloops; no extra setup; accepts allrun()options exceptonChunk
ts
for await (const chunk of agent.stream('Explain quantum computing')) {
process.stdout.write(chunk);
}defineAgent() builder β budget(), checkpoint(), adapters() β
.budget(config)β USD spend caps without dropping down tocreateAgent().checkpoint(store)β durable crash recovery wired in one line.adapters(registry)β plug in adapter registry or explicit bindings- Full builder method table now documented in Creating Agents
Performance β
AgenticRunner β ZodβJSON Schema cached per agent (not per run) β
- Tool definitions (Zod β JSON Schema) are computed once in the constructor and reused
- Zero
toolToLLMDef()overhead on hot-pathrun()calls after initial agent creation
Tool execution β timer leak fixed β
Promise.racetimeout timer is now always cleared via.finally()on every tool call- Prevents 30-second timer handles accumulating in long-running processes
- Timing now uses
performance.now()for sub-millisecond accuracy
AuditPlugin β O(1) event queries β
- Internal
Mapindexes maintained on everyonEvent()call getEventsByType(),getEventsForNode(),getEventsForExecution()are all O(1) index lookups- Previously O(n) full scans β eliminates bottleneck on high-event-volume workflows
OpenTelemetryPlugin β OTel module imported once and cached β
- The
@opentelemetry/apidynamic import is now cached after the first successful load - Previously re-imported on every
onNodeStart()call
v1.0.0 β
Added β
Reasoning Module β
ReasoningManagerβ chain-of-thought and self-critique loops over anygeneratefunctionReasoningEventTypediscriminated union:step,action,complete,errorNextActiontyped decision point:continue | finish | backtrack | escalateReasoningStoreβ pluggable trace persistence (audit, replay, fine-tuning)
Scheduler Module β
ScheduleManagerβ CRUD for cron-based job schedules with pluggableScheduleStore+ScheduleRunStoreInMemoryScheduleStore(dev) /SqliteScheduleStore(prod)- In-process handler registry β no HTTP endpoint required
- Full lifecycle:
create / update / delete / enable / disable / triggerNow / listRuns
CompressionManager β
- Transparent context-window compression before LLM calls;
truncate | summarise | rollingstrategies
ContextProvider β
- Retrieves and injects grounding documents into the system prompt or user message at run time
- Pluggable
ContextBackend:InMemoryContextBackend,SqliteContextBackend
Freedom Layer β bare / compose / pipe β
bare(opts)β zero-defaults agent; caller owns LLM, tools, hooks, everythingcompose(...agents, opts?)β sequential pipeline; output of each agent β input of nextcomposeoptions:when(conditional routing) +transform(reshape data between steps)pipe(agent).then(agent).run(prompt)β builder-style equivalent tocompose()
Eval Regression Suite β
runEvalSuiteβ labeled dataset, per-sample scoring, baseline comparison, CI exit codeInMemoryEvalStore/SqliteEvalStoreβ durable baseline persistence across CI jobssetBaseline: trueβ promote current run as new reference;regressionThresholdβ allowable score drop
Real-World Example Library (4 new runnable examples) β
examples/reasoning-agent.tsβ Incident Triage Bot (no API key needed)examples/scheduled-agent.tsβ Nightly Market Digest (no API key needed)examples/code-review-pipeline.tsβ PR Code Review Pipeline (no API key needed)examples/eval-regression.tsβ CI Eval Regression Guard (no API key needed)
Documentation β
- 19 Β· Incident Triage Bot β
ReasoningManager, event streaming - 20 Β· Scheduled Agent Jobs β cron scheduling, run history
- 21 Β· Code Review Pipeline β
bare(),compose(),pipe() - 22 Β· Eval Regression Guard β
runEvalSuite, CI baseline guard
v0.7.0 β
Added β
Budget Enforcement β
budget?: BudgetConfigadded toCreateAgentOptionsβ hard USD caps per run and per userBudgetEnforcerinstantiated in factory,recordAndCheck(userId)called after the run loopuserId?: stringadded toAgenticRunConfigfor per-user cap enforcement
HITL Approval HTTP Endpoints β
GET /v1/approvalsβ list pending approvalsPOST /v1/approvals/:idβ submit decision{ approved, comment, decidedBy }approvalStore?: ApprovalStoreadded toCreateHttpServiceOptions
Distributed Trace Context β
- W3C
traceparent/tracestateextraction from incoming HTTP request headers traceIdfrom incoming trace propagated in JSON and SSE responsessrc/observability/trace-context.tsβextractTraceContext(),injectTraceContext()
v0.6.0 β
Added β
Testing Module (confused-ai/testing) β
MockToolRegistryβ records all invocations;calls(),lastCall(),reset()createTestAgent()β zero-config test harness withMockLLMProvider+MockSessionStorecreateTestHttpService()β integration test helper on a random port
HTTP Runtime β
X-Request-IDcorrelation header on every responserateLimitmiddleware option inCreateHttpServiceOptionsauditStoreoption β SQLite-backed persistent audit log- WebSocket transport (
websocket: true) β attaches to existinghttp.Server - Admin API (
adminApi: true) β/admin/health,/admin/agents,/admin/audit,/admin/stats,/admin/checkpoints
Adapter System (confused-ai/adapters) β
- 20-category adapter system covering SQL, NoSQL, vector, cache, object storage, message queues, observability, embedding, session, memory, guardrail, RAG, tool registry, auth, rate limiting, audit log
createProductionSetup()β opinionated full-stack wiring with progressive upgrade path
LLM Router (confused-ai/llm) β
LLMRouterβ intelligent routing by task type, complexity, and strategy- Four strategies:
balanced,cost,quality,speed - Factories:
createBalancedRouter,createCostOptimizedRouter,createQualityFirstRouter,createSpeedOptimizedRouter
Deployment Templates (/templates) β
Dockerfile,docker-compose.yml,fly.toml,render.yaml,k8s.yaml- Grafana dashboard JSON (
grafana-dashboard.json)
DX Improvements β
defineTool()helper β AI SDK-style fluent builder with Zod schemas,needsApproval, streaming hookscreateWorkflow().then(step).commit()β Mastra-style typed step workflowscreateStepWorkflow,StepWorkflow,StepWorkflowBuilder,StepWorkflowStepexports
Resilience β
withResilience()β circuit breaker + rate limiter + retry + health check wrapperRedisRateLimiterβ distributed rate limiting via Redis
Secret Manager (confused-ai/config) β
createSecretManager()with adapters:EnvSecretManagerAdapter,AwsSecretsManagerAdapter,AzureKeyVaultAdapter,VaultAdapter,GcpSecretManagerAdapter
Orchestration Extensions β
AgentRouterβ capability-based, round-robin, least-loaded routingHandoffProtocolβ structured agent-to-agent task handoff with tracingConsensusProtocolβ multi-agent voting (majority, unanimous, weighted, best-of-n)
v0.5.0 β
Added β
- Checkpoint/resume for long-running agents β
checkpointStore?inAgenticRunnerConfig createSqliteSessionStoreSyncβ sync init, safe for factory use- Persistent user profiles and learning modes
- Eval dataset persistence β
EvalStore,InMemoryEvalStore,SqliteEvalStore,runEvalSuite - Plugin system β
confused-ai/pluginswith built-in logging, rate-limit, telemetry plugins - Contracts layer β
confused-ai/contractsfor shared interfaces without runtime code
v0.4.0 β
Added β
- Full adapter system for all infrastructure categories
- Multi-tenancy with
createTenantContext() - JWT RBAC on HTTP routes
- SOC 2 / HIPAA audit trail
v0.3.0 β
Added β
- ReAct agentic loop with
createAgent createHttpServiceHTTP runtime with OpenAPI- 50+ built-in tools
- RAG / KnowledgeEngine
v0.1.0 β
Initial release.