New:Microsoft Teams Notifications Are Now Available in Socket.Learn more
Get Started

agent-framework-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent-framework-js

Modular, tree-shakeable JavaScript/TypeScript agent framework for no-backend deployments (browser, edge, Node). Agents, tools, MCP, skills, multi-agent workflows, middleware, persistence, and OpenTelemetry observability.

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
8
-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

agent-framework-js

A modular, tree-shakeable JavaScript/TypeScript framework for building and orchestrating AI agents in no-backend deployments — browser, edge runtimes (e.g. Vercel without serverless functions), and Node. It mirrors the in-scope capability set of Microsoft Agent Framework: agents, code tools, MCP, skills, multi-agent workflows, middleware, persistence, and OpenTelemetry observability.

LLM providers are intentionally limited to GitHub Copilot and OpenAI-compatible endpoints (e.g. LM Studio) behind a pluggable abstraction.

Install

npm install agent-framework-js

Optional peer dependencies (installed only if you use the feature):

  • @modelcontextprotocol/sdk — MCP integration
  • @opentelemetry/api — tracing
  • yaml — YAML declarative definitions

Quick start

import { createAgent, createOpenAICompatibleProvider } from "agent-framework-js";

const provider = createOpenAICompatibleProvider({
  baseUrl: "http://localhost:1234/v1", // LM Studio
  getCredential: () => process.env.LMSTUDIO_KEY ?? "",
  capabilities: { model: "local-model", maxInputTokens: 262144, maxOutputTokens: 32000 },
});

const agent = createAgent({ name: "Helper", instructions: "Be concise.", provider });
const res = await agent.run("Say hello.");
console.log(res.status, res.output);

Prefer deep imports for the smallest bundle: agent-framework-js/agents, /providers, /tools, /mcp, /skills, /workflows, /middleware, /persistence, /observability, /declarative.

Features

AreaEntryNotes
Agentsagentstext + multimodal input, streaming, reasoning field, threads with compaction
ProvidersprovidersCopilot + OpenAI-compatible; caller-injected credentials; retry/backoff
Toolstoolslocal function tools, JSON-Schema validation, namespacing, enable/disable
MCPmcpremote (HTTP/SSE) everywhere; stdio in Node only
Skillsskillsprogressive disclosure; client-side keyword index
Workflowsworkflowssequential / concurrent / handoff / group; HITL; checkpoints
Middlewaremiddlewarerequest/response pipeline
Persistencepersistencein-memory + browser (localStorage/IndexedDB)
ObservabilityobservabilityOpenTelemetry spans with secret redaction
DeclarativedeclarativeYAML or JSON agent definitions

Credential handling

Credentials are always supplied via a callback and are never bundled, persisted, or logged.

  • Frontend-only: the end user supplies their own token; it stays client-side.
  • Backend: the developer may supply it, or the user sends it per request over SSL/TLS — and the backend must never log or persist it.

Configurable safeguards (defaults & customization)

All safeguards ship with safe defaults and are fully overridable. Set a value to -1 for unlimited where noted.

KnobWhereDefaultNotes
maxIterationscreateAgent10-1 = unlimited tool-call iterations
toolTimeoutMscreateAgentnoneper-tool-call timeout
compactionThresholdcreateAgent0.9fraction of maxInputTokens before compaction
compactionModelcreateAgentown provideroverride model for summaries
retry.maxRetriesprovider3transient-error retries (429/5xx/network)
maxRoundscreateWorkflow16-1 = unlimited; or end via completion signal
failurePolicycreateWorkflowfail-softor fail-fast
maxConcurrencycreateWorkflow4-1 = unlimited parallel agent/tool calls

Runtime support

Core features use only web-standard APIs and run in browser, edge, and Node. Node-only features (stdio MCP, filesystem storage) are gated by runtime detection and throw a typed RuntimeUnsupportedError when unavailable.

Scripts

npm run build      # dual ESM + CJS + .d.ts
npm test           # vitest
npm run lint
npm run typecheck

License

MIT

Keywords

agent

FAQs

Package last updated on 16 Jun 2026

Related posts