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.25.0
Released November 2, 2026.
Features
- Add the
experimentsoption onai.agent(),agent.child(),agent.session(), and single agent or sessiontrack*calls. It records A/B test or feature flag assignment as[{ key, variant, provider?, unit? }], and every event carries[Agent] Experiments(key:variantstrings) plus[Agent] Experiment Key,Variant,Unit, andProviderwhen exactly one experiment applies, so any chart splits by arm. Call entries override session entries, which override agent entries, by key; child agents andrunAs()inherit them; provider wrappers,tool(), and OTel-mapped spans inside a session carry them.unitisagent_session(default),turn, orspan; at most 10 apply to an event; invalid entries are dropped with a debug log.context: { experiment_variant }keeps working. - Add helpers for the flag tool you already use:
experimentsFromAmplitude(variants, { keys })maps an Amplitude ExperimentfetchV2()orevaluateV2()result;AmplitudeAIHookfrom@amplitude/ai/openfeaturerecords flags an OpenFeature provider evaluates inside a session, withflags,unit, andvariantOfoptions;session.addExperiments()records an assignment learned after the session started, shared acrossrunAs()delegation. None of them sends an exposure event.experimentFromEvaluation()is the mapping behind the hook. - Warehouse templates read optional
experiment_keyandexperiment_variantcolumns, one experiment per row with unitagent_session. - The forwarder core sends
NormalizedConversation.experimentswith the same rules as the SDK. - MCP server:
scan_projectreportsexperiment_packagesandflag_call_sites;instrument_fileadds a TODO where a file reads a flag;validate_fileflags the legacyexperiment_variantcontext form and helpers called withoutkeysorflags;generate_verify_testchecks that session experiments reach every event;MockAmplitudeAI.summary()reports anExperiments fillline.AGENTS.mdandamplitude-ai.mdroute flag reads toexperiments.
Refer to Record experiment variants in Agent Analytics and Run an agent experiment.
0.24.2
Released November 2, 2026.
Features
amplitude-ai-register-catalognow registers descriptions for the version properties Amplitude's enrichment sets:[Agent] Signal Versionson[Agent] Session Record,[Agent] Evaluator IDand[Agent] Evaluator Versionon[Agent] Evaluator Result, and[Agent] Taxonomy Versionfor the org-wide evaluation configuration.
0.24.1
Released October 26, 2026.
Fixes
- Preserve numeric values and valid JSON escaping in serialized JSON objects and arrays within structured content channels. Built-in redaction scans decoded string values and keys, masks numeric values under recognized phone, card, and SSN fields, and preserves other numeric tokens verbatim. Distinct original keys that collapse to one redacted key cause the serialized document to fail closed.
0.24.0
Released October 2026.
Features
- Add optional
$agent_artifactTypeScript type for inline message attachments, improving type inference without changing runtime capture or validating the artifact schema. - Preserve multi-agent lineage through agent delegation so the full agent chain is recorded when one agent delegates to another.
- Set
[Agent] Sourceon spans you create with an explicit user role, consistent with how provider-originated user messages are tracked.
Fixes
- Restore artifact capture for tool and span input and output and for AI and user message attachments after a regression.
- Harden artifact privacy: reject unsupported MathML snapshots, close CSS quote leakage, and bound static-artifact text visibility so content does not appear outside the active content mode. Raw HTML artifact snapshots are owned by the producer; existing content capture settings, best-effort string redaction, and size limits apply.
- Record only the new user turn in LangChain conversations instead of re-recording all prior turns, preventing duplicate
[Agent] User Messageevents. - Fix the OTLP replay script to reject
--metadata-onlybefore forwarding when the envelope is a rawresourceSpanspayload, rather than silently including content the flag cannot remove.
0.23.0
Released October 2026. Public guide URLs now track main, so a later SDK release doesn't require new links. This release adds the AWS Strands guide, the privacy contract for HTTP, OpenTelemetry, Batch, S3, and warehouse imports, and states that [Agent] Session End is optional and recommended.
0.22.0
Released October 2026.
Features
- Add review mode (
reviewMode: true). The SDK records each post-redaction event and prints a sanitized pre-transport upload preview without sending it to Amplitude. Read the previews withgetReviewTraffic(). For zero-code instrumentation, setAMPLITUDE_AI_REVIEW=true. Prompt and message content is left intact; the envelope API key is[REDACTED].AMPLITUDE_AI_DEBUGdoes not enable review mode.
const ai = new AmplitudeAI({
apiKey: process.env.AMPLITUDE_AI_API_KEY!,
config: new AIConfig({ reviewMode: true }),
});
// Exercise a representative session, then:
await ai.flush();
console.log(ai.getReviewTraffic());
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.
이 내용이 도움이 되었나요?