For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Node AI SDK release notes
このページはまだあなたの言語に翻訳されていません。 現在取り組んでいますので、後でもう一度確認してください。
Release notes for @amplitude/ai. For the full engineering changelog, go to the Amplitude-AI-Node CHANGELOG on GitHub. For the Python SDK, refer to Python AI SDK release notes.
0.21.0
Released October 2026. This release hardens privacy handling, provider wrappers, the MCP server, the CLI tools, and the release pipeline. Amplitude recommends that all users upgrade: npm install @amplitude/ai@^0.21.0.
Behavior changes
tool()inherits the active content mode. Without a privacy config from the decorator, the session'sAmplitudeAIclient, orToolCallTracker.setAmplitude(), it sends metadata only. To capture tool input and output, passprivacyConfig.- If a
customRedactionFnthrows, the SDK drops the affected content. InvalidcustomRedactionPatternsthrowConfigurationErrorwhen you build the config. wrap()instruments the OpenAI, Azure OpenAI, or Anthropic client you pass in place, so it keeps yourbaseURL,fetch, headers, and timeouts. Request options such assignal,timeout, andheaderspass through to the provider.pushContext(ctx, fn)sets the context only whilefnruns. CallingpushContext(ctx)without a callback still works but is deprecated and logs a warning once, because on an HTTP server the context can carry over to later requests on the same connection. UsepushContext(ctx, fn),runWithContext(), orsession.run()instead.amplitude-ai-instrumentinstruments only the process it launches. To instrument child Node processes too, setAMPLITUDE_AI_INSTRUMENT_CHILDREN=true.- The MCP
scan_projecttool reads only the client's MCP roots, or the server's working directory. To allow other directories, list them inAMPLITUDE_AI_MCP_ROOTS. - The MCP server uses your installed
@modelcontextprotocol/sdkandzodinstead of bundled copies, and tells you what to install if they're missing. - Peer dependency ranges have upper bounds:
@amplitude/analytics-node,@opentelemetry/api, andtiktokenbelow 2, and@opentelemetry/sdk-trace-basebelow 3. - Docs and bundled guides run commands from the scoped package,
npx -y -p @amplitude/ai <command>, and run integration scripts from the installed package, for examplenode node_modules/@amplitude/ai/docs/integrations/check-agent-events.mjs. Guide URLs point at a release tag instead ofmain. - With
patch(), OpenAI and Anthropic calls return the SDK's own types:create()returns anAPIPromise, so.withResponse()and.asResponse()work, and streams are the SDKStream, so.tee()and.toReadableStream()work. - Patched provider calls inside a session go to the
AmplitudeAIinstance that owns the session, even when a different instance calledpatch().
Fixes
- Tracking errors no longer affect the wrapped provider call.
- Each
AmplitudeAIinstance keeps its own client and context propagation, and integrations resolve identity per run. Propagated context travels in request headers only, and IDs that aren't valid HTTP header values are left out instead of failing the request. - Debug logs omit message content, and warnings omit user IDs. Attachments and message labels go through redaction.
- OpenTelemetry span mapping fixes.
- Offline evaluation uploads require HTTPS and use a timeout. Flushes have a bounded timeout.
- The package no longer bundles optional dependencies, so it ships about half as many files.
ai.flush({ timeoutMs })stops waiting after the timeout and resolves without an error.ai.flush()with no options is unchanged.- A span that both
enableOtel()andAmplitudeAgentExportersee is recorded once. amplitude-ai-instrumentforwards stop signals to the app it launched and exits with the app's exit code. It treatsnode_modules/.bin/<launcher>, such astsxornodemon, like the launcher itself.amplitude-ai-doctorreports a malformedpackage.jsonas a failed check instead of crashing.- The MCP server masks more key formats in code snippets and limits the size of every tool argument.
0.20.1
Released October 7, 2026.
Fixes
@google/genaiis now an optional peer dependency, like@google/generative-ai. TheGoogleGenAIwrapper already required it.- The bundled README and agent guides now describe built-in signals as properties on
[Agent] Session Recordand custom evaluators as[Agent] Evaluator Resultevents. They also no longer list deprecated events. - The provider matrix now shows cache token stats for Gemini, Azure OpenAI, and Bedrock. Only Mistral doesn't report them.
- The bundled
amplitude-ai.mdguide uses the correcttrackToolCalloptions,inputandoutput.
0.20.0
Released October 6, 2026. This release also includes the changes listed for 0.19.0, which wasn't published to npm.
Features
PROP_INGESTION_PATHandPROP_SOURCEconstants for[Agent] Ingestion Pathand[Agent] Source.amplitude-ai-register-catalognow registers[Agent] Git SHA,[Agent] Git Ref,[Agent] Git Repo, and[Agent] Provider Request ID, which the SDK already sent.
Fixes
- Gemini calls now record
[Agent] Provider Request ID. - The SDK prices Fireworks router calls at the model the router selected, so they no longer lose
[Agent] Cost USD. amplitude-ai-register-catalogno longer registers[Agent] Enrichment Cost USD, which Amplitude no longer sends.- The SDK pins
@pydantic/genai-pricesto^0.1.3, so a future major version can't silently drop cost.
0.18.0
Released September 24, 2026.
Features
- Every tracked event now carries
[Agent] Content Mode(full,metadata_only, orcustomer_enriched), so Amplitude can tell a deliberate metadata-only session from one whose instrumentation dropped the message text. MockAmplitudeAI.summary()now fails when a user message has empty content, except inmetadata_onlyandcustomer_enrichedmodes.
0.17.0
Released September 19, 2026.
Breaking changes
amplitude-ai-register-catalogno longer accepts credentials as arguments. It readsAMPLITUDE_API_KEYandAMPLITUDE_SECRET_KEYfrom the environment when the script runs. Write the script to a file withnpx -y -p @amplitude/ai amplitude-ai-register-catalog > register.sh, review it, then runbash register.shwith both variables exported.
Features
- Gateway recipes for OpenRouter, LiteLLM, and Requesty. Refer to Gateways.
- The LangChain handler tracks
[Agent] User Messagefor chat models. - The OpenTelemetry exporters accept
privacyConfig,allowedScopes, andblockedScopes.
Fixes
- When the SDK can't look up a model's price, it now omits
[Agent] Cost USDinstead of recording$0.
これは役に立ちましたか?