@niadra/sdk 0.9.0 → 0.10.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/README.md +40 -1
  3. package/dist/ai-sdk.d.cts +3 -3
  4. package/dist/ai-sdk.d.ts +3 -3
  5. package/dist/anthropic.d.cts +4 -4
  6. package/dist/anthropic.d.ts +4 -4
  7. package/dist/bedrock.d.cts +4 -4
  8. package/dist/bedrock.d.ts +4 -4
  9. package/dist/cli.js +368 -104
  10. package/dist/cli.js.map +1 -1
  11. package/dist/{client-B_ip8T2o.d.cts → client-rmWhZJOx.d.cts} +212 -21
  12. package/dist/{client-B_ip8T2o.d.ts → client-rmWhZJOx.d.ts} +212 -21
  13. package/dist/cloudflare-agents.d.cts +3 -3
  14. package/dist/cloudflare-agents.d.ts +3 -3
  15. package/dist/elevenlabs.cjs +7 -5
  16. package/dist/elevenlabs.cjs.map +1 -1
  17. package/dist/elevenlabs.d.cts +5 -5
  18. package/dist/elevenlabs.d.ts +5 -5
  19. package/dist/elevenlabs.js +7 -5
  20. package/dist/elevenlabs.js.map +1 -1
  21. package/dist/genkit.d.cts +3 -3
  22. package/dist/genkit.d.ts +3 -3
  23. package/dist/google-adk.cjs +7 -5
  24. package/dist/google-adk.cjs.map +1 -1
  25. package/dist/google-adk.d.cts +3 -3
  26. package/dist/google-adk.d.ts +3 -3
  27. package/dist/google-adk.js +7 -5
  28. package/dist/google-adk.js.map +1 -1
  29. package/dist/google-genai.d.cts +4 -4
  30. package/dist/google-genai.d.ts +4 -4
  31. package/dist/index.cjs +378 -106
  32. package/dist/index.cjs.map +1 -1
  33. package/dist/index.d.cts +13 -5
  34. package/dist/index.d.ts +13 -5
  35. package/dist/index.js +378 -106
  36. package/dist/index.js.map +1 -1
  37. package/dist/{intercept-CxmBLfoj.d.cts → intercept-C0XODsy9.d.cts} +1 -1
  38. package/dist/{intercept-CBaPK_-k.d.ts → intercept-veMDudKV.d.ts} +1 -1
  39. package/dist/langchain.cjs.map +1 -1
  40. package/dist/langchain.d.cts +3 -3
  41. package/dist/langchain.d.ts +3 -3
  42. package/dist/langchain.js.map +1 -1
  43. package/dist/livekit.cjs +10 -2
  44. package/dist/livekit.cjs.map +1 -1
  45. package/dist/livekit.d.cts +3 -3
  46. package/dist/livekit.d.ts +3 -3
  47. package/dist/livekit.js +10 -2
  48. package/dist/livekit.js.map +1 -1
  49. package/dist/llamaindex.d.cts +3 -3
  50. package/dist/llamaindex.d.ts +3 -3
  51. package/dist/mastra.d.cts +3 -3
  52. package/dist/mastra.d.ts +3 -3
  53. package/dist/openai-agents.d.cts +3 -3
  54. package/dist/openai-agents.d.ts +3 -3
  55. package/dist/retell.cjs +7 -5
  56. package/dist/retell.cjs.map +1 -1
  57. package/dist/retell.d.cts +5 -5
  58. package/dist/retell.d.ts +5 -5
  59. package/dist/retell.js +7 -5
  60. package/dist/retell.js.map +1 -1
  61. package/dist/{shared-BLkAbvuf.d.ts → shared-Cs7h5C4Y.d.ts} +1 -1
  62. package/dist/{shared-DEkF2Y_z.d.cts → shared-zaTBum17.d.cts} +1 -1
  63. package/dist/strands.d.cts +3 -3
  64. package/dist/strands.d.ts +3 -3
  65. package/dist/twilio.cjs +10 -2
  66. package/dist/twilio.cjs.map +1 -1
  67. package/dist/twilio.d.cts +4 -4
  68. package/dist/twilio.d.ts +4 -4
  69. package/dist/twilio.js +10 -2
  70. package/dist/twilio.js.map +1 -1
  71. package/dist/vapi.cjs +7 -5
  72. package/dist/vapi.cjs.map +1 -1
  73. package/dist/vapi.d.cts +5 -5
  74. package/dist/vapi.d.ts +5 -5
  75. package/dist/vapi.js +7 -5
  76. package/dist/vapi.js.map +1 -1
  77. package/dist/voltagent.d.cts +3 -3
  78. package/dist/voltagent.d.ts +3 -3
  79. package/dist/{webhook-BaraTaA9.d.ts → webhook-2V5QgnKI.d.ts} +1 -1
  80. package/dist/{webhook-CuR0Wckd.d.cts → webhook-CX7nvQig.d.cts} +1 -1
  81. package/dist/whatsapp.cjs +10 -2
  82. package/dist/whatsapp.cjs.map +1 -1
  83. package/dist/whatsapp.d.cts +2 -2
  84. package/dist/whatsapp.d.ts +2 -2
  85. package/dist/whatsapp.js +10 -2
  86. package/dist/whatsapp.js.map +1 -1
  87. package/package.json +3 -2
package/CHANGELOG.md CHANGED
@@ -4,6 +4,77 @@ All notable changes to this package are documented here. The format follows [Kee
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.10.3] - 2026-10-03
8
+
9
+ ### Added
10
+
11
+ - `keepWarm` (on by default): while a conversation or task is open (created and not ended) and the client was
12
+ used in the last 10 minutes, the client sends `GET /healthz` every 100 s when nothing else went out for 90 s,
13
+ one attempt with a 2-second budget, so the connection to the region stays open. A turn after a long pause no
14
+ longer pays TCP, TLS and often DNS again. The pings are not the client's use, the timer is `unref()`'d, and a
15
+ conversation nobody holds any more stops them. `keepWarm: false` never pings.
16
+
17
+ ## [0.10.2] - 2026-10-03
18
+
19
+ ### Changed
20
+
21
+ - The client measures the round trip to the region once when it starts (`GET /healthz`, twice), not only for
22
+ voice, which also opens the connection the first read uses. `timeouts.context` and `timeouts.navigation` left
23
+ at their defaults take the measured round trip on top: from Sao Paulo (170 ms to us-east-2) every chat read
24
+ with the defaults ran out of time. A value you set stays a ceiling, and the client logs one warning when the
25
+ round trip plus 50 ms exceeds it. The voice budgets are unchanged, and their warnings now come only once the
26
+ client reads in voice. `voice: { probe: false }` measures nothing.
27
+
28
+ ## [0.10.1] - 2026-10-03
29
+
30
+ ### Added
31
+
32
+ - `contextUse({ since, until, group_by, source_id, channel, view, experiment_group })`: the context-use report
33
+ (`GET /v1/context-use`) as `ContextUseReport`, with its buckets typed and the other blocks passing through.
34
+ A key of an `analyst` source with the `analytics` scope reads every source of the space.
35
+ - `link({ person, organization, role })` and `endLink(linkId)`: a system of record that knows who works for whom
36
+ (a CRM, an HR system) links a person to the account or partner they act for, and ends the link, with a key
37
+ that has the `identity:link` scope instead of `admin`. `can_see_contacts` still needs `admin`. `Link` and
38
+ `LinkRequest` are the types.
39
+
40
+ ## [0.10.0] - 2026-10-03
41
+
42
+ ### Added
43
+
44
+ - `open(id, { about })`: with the person bound in `subject`, also an item of the organization they act for that
45
+ their view shows (the pack's account block). `tools()` bound with `about` passes it, so the kit reaches what
46
+ the pack shows.
47
+ - `about_unlinked` on `ContextResponse`, `SearchResponse` and `TimelineResponse`: `about` named an organization
48
+ with no active link to the subject, and the read went on with the subject's own memory. A conversation or a
49
+ task warns once through its `logger`.
50
+ - `explain(error)`: an API refusal for a log line, with its code, detail and request id. A coordination check
51
+ takes the client's `logger`, and `HistoryItemKind` includes `system_event`.
52
+
53
+ ### Changed
54
+
55
+ - An API error's `message` ends with the request id: `422 invalid_input: <detail> (request <id>)`.
56
+ - `govIdHmac` and `orgRegistryHmac` take the document number itself; the space keeps only a keyed hash of it.
57
+ - Idle connections are kept for `keepAliveMs` between turns, and a call that has to open a connection gets
58
+ `timeouts.connect` (1,000 ms by default) on top of its method's budget, once per cold period, so a first read
59
+ after idle no longer times out on the TLS handshake.
60
+ - A coordination check the API refuses (400, 401, 403 or 422) is `invalid_request`, never `unchecked`: an
61
+ outbound contact is deferred and an inbound one allowed, and `strict` throws. Refusals of background writes
62
+ (the outbox, turn records) log the problem's detail and request id.
63
+ - The tool definitions follow the server's: the timeline tool says it also lists the open items, facts,
64
+ patterns or objects `filters.item_kinds` names.
65
+
66
+ ## [0.9.1] - 2026-10-02
67
+
68
+ ### Changed
69
+
70
+ - The canonical phone of the suppression list follows the revised rules of the suppression spec (3.1 and 3.4): Mexico's and Argentina's mobile prefixes, an 11-digit North American number, a carrier code, `(0)`, `tel:` and direction marks. The key the SDK computes for an opted-out contact matches the server's again.
71
+
72
+ ### Added
73
+
74
+ - A route or field the API deprecates answers with the `Deprecation`, `Sunset` and `Link` headers; the
75
+ client logs one warning per deprecated route per process through its `logger`, with the two dates and the
76
+ migration note, never the path.
77
+
7
78
  ## [0.9.0] - 2026-09-30
8
79
 
9
80
  ### Added
package/README.md CHANGED
@@ -77,6 +77,45 @@ ESM and CommonJS builds with full type definitions; it only needs `fetch`.
77
77
  | `objectState()`, `objectTimeline()` | a business object (an order, an invoice, a ticket) as the systems of record reported it |
78
78
  | `feedback()` | a correction of what Niadra derived, audited like any other event |
79
79
 
80
+ ## Benchmark
81
+
82
+ Niadra and ten other memory systems for agents (thirteen configurations) were measured on the same dataset, in the same AWS region
83
+ (us-east-2), with the same agent and the same judge for every system. The script, the dataset and every
84
+ result file are in this repository, under [`benchmarks/`](https://github.com/ainiadra/niadra-sdk-python/tree/main/benchmarks),
85
+ so anyone can run it again. The full page, with every metric and where Niadra does not lead, is at
86
+ [niadra.com/benchmark](https://niadra.com/benchmark).
87
+
88
+ Combined run of 01/10/2026 ([`2026-09-30-abb516`](https://github.com/ainiadra/niadra-sdk-python/tree/main/benchmarks/results/2026-09-30-abb516)),
89
+ cross-channel accuracy on the same 165 valid cases, judged by the same model:
90
+
91
+ | System | Accuracy | Model spend per 1,000 conversations |
92
+ |---|---|---|
93
+ | **Niadra** (3 repetitions) | **98.7%** | **US$ 0.36** |
94
+ | Hindsight | 86.7% | US$ 6.10 |
95
+ | Amazon Bedrock AgentCore Memory (3 repetitions) | 80% | US$ 7.50 (AWS public price, its models included) |
96
+ | Honcho (dialectic) | 79.4% | US$ 6.92 |
97
+ | Mem0 open source (3 repetitions) | 77.6% | US$ 1.88 |
98
+ | Memobase | 77% | US$ 4.13 |
99
+ | Supermemory local | 71.6% | US$ 5.78 |
100
+ | Cognee | 70.3% | US$ 6.95 |
101
+ | LangMem | 66.7% | US$ 3.70 |
102
+ | Graphiti | 52.8% | US$ 18.72 |
103
+ | MemOS | 51.6% | US$ 3.70 |
104
+
105
+ With a different user id on each channel (agents from different vendors), Mem0 open source drops to
106
+ 28.5%, AgentCore Memory to 27.9%, and Niadra stays at 98.7%. Sensitive values reaching an unverified
107
+ conversation: Niadra 0 of 32; Mem0 and AgentCore Memory 32 of 32.
108
+
109
+ Typed state ([`typed/2026-09-30-b59a5d`](https://github.com/ainiadra/niadra-sdk-python/tree/main/benchmarks/results/typed/2026-09-30-b59a5d)):
110
+ with the state and constraints blocks, 84.9% correct [78, 90] against 36.6% without them; declared
111
+ constraints respected went from 0% to 94.4%, and what changed since the customer last saw it from 0% to
112
+ 100%, with no extra tokens on a turn that asks for no block.
113
+
114
+ Where Niadra does not lead in that run: ingest acknowledgement against systems that write in the
115
+ background, opening a single history item, history search p95 against LangMem by a few ms, and tokens per
116
+ turn against readers that return answer text. The benchmark is produced by Niadra; that is why every input
117
+ and output is public.
118
+
80
119
  ## Questions people ask
81
120
 
82
121
  **How do I give my AI agent memory of past conversations on other channels?** Record the turns
@@ -798,7 +837,7 @@ Include `requestId` when you contact support.
798
837
 
799
838
  ```sh
800
839
  pnpm install
801
- pnpm check # typecheck, lint, tests (the integrations with their frameworks' real types)
840
+ pnpm check # typecheck, lint, tests (the integrations with their frameworks' real types), audit of the runtime dependencies
802
841
  pnpm build # ESM and CommonJS into dist/, one entry per integration
803
842
  pnpm runtimes # the build on Deno, Bun, workerd and the Edge Runtime
804
843
  pnpm --filter "./packages/*" check # the n8n and Flowise nodes
package/dist/ai-sdk.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ToolSet } from 'ai';
2
- import { f as ModelUsage, fZ as TurnParams, fS as TurnFrame } from './client-B_ip8T2o.cjs';
3
- import { a as ProofSource, A as AgentMemoryOption, b as Session, S as SessionResolver } from './shared-DEkF2Y_z.cjs';
4
- export { P as Proof, c as attestationProof } from './shared-DEkF2Y_z.cjs';
2
+ import { f as ModelUsage, g5 as TurnParams, f_ as TurnFrame } from './client-rmWhZJOx.cjs';
3
+ import { a as ProofSource, A as AgentMemoryOption, b as Session, S as SessionResolver } from './shared-zaTBum17.cjs';
4
+ export { P as Proof, c as attestationProof } from './shared-zaTBum17.cjs';
5
5
 
6
6
  /**
7
7
  * Niadra for the Vercel AI SDK (`ai` 5, 6 and 7), the idiomatic way: a language model middleware
package/dist/ai-sdk.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ToolSet } from 'ai';
2
- import { f as ModelUsage, fZ as TurnParams, fS as TurnFrame } from './client-B_ip8T2o.js';
3
- import { a as ProofSource, A as AgentMemoryOption, b as Session, S as SessionResolver } from './shared-BLkAbvuf.js';
4
- export { P as Proof, c as attestationProof } from './shared-BLkAbvuf.js';
2
+ import { f as ModelUsage, g5 as TurnParams, f_ as TurnFrame } from './client-rmWhZJOx.js';
3
+ import { a as ProofSource, A as AgentMemoryOption, b as Session, S as SessionResolver } from './shared-Cs7h5C4Y.js';
4
+ export { P as Proof, c as attestationProof } from './shared-Cs7h5C4Y.js';
5
5
 
6
6
  /**
7
7
  * Niadra for the Vercel AI SDK (`ai` 5, 6 and 7), the idiomatic way: a language model middleware
@@ -1,7 +1,7 @@
1
- import { W as WrapOptions } from './intercept-CxmBLfoj.cjs';
2
- import { S as SessionResolver } from './shared-DEkF2Y_z.cjs';
3
- export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-DEkF2Y_z.cjs';
4
- import './client-B_ip8T2o.cjs';
1
+ import { W as WrapOptions } from './intercept-C0XODsy9.cjs';
2
+ import { S as SessionResolver } from './shared-zaTBum17.cjs';
3
+ export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-zaTBum17.cjs';
4
+ import './client-rmWhZJOx.cjs';
5
5
 
6
6
  /**
7
7
  * Niadra for the Anthropic TypeScript SDK (`@anthropic-ai/sdk`), as `wrap()` is for OpenAI.
@@ -1,7 +1,7 @@
1
- import { W as WrapOptions } from './intercept-CBaPK_-k.js';
2
- import { S as SessionResolver } from './shared-BLkAbvuf.js';
3
- export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-BLkAbvuf.js';
4
- import './client-B_ip8T2o.js';
1
+ import { W as WrapOptions } from './intercept-veMDudKV.js';
2
+ import { S as SessionResolver } from './shared-Cs7h5C4Y.js';
3
+ export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-Cs7h5C4Y.js';
4
+ import './client-rmWhZJOx.js';
5
5
 
6
6
  /**
7
7
  * Niadra for the Anthropic TypeScript SDK (`@anthropic-ai/sdk`), as `wrap()` is for OpenAI.
@@ -1,7 +1,7 @@
1
- import { f as ModelUsage } from './client-B_ip8T2o.cjs';
2
- import { W as WrapOptions } from './intercept-CxmBLfoj.cjs';
3
- import { S as SessionResolver } from './shared-DEkF2Y_z.cjs';
4
- export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-DEkF2Y_z.cjs';
1
+ import { f as ModelUsage } from './client-rmWhZJOx.cjs';
2
+ import { W as WrapOptions } from './intercept-C0XODsy9.cjs';
3
+ import { S as SessionResolver } from './shared-zaTBum17.cjs';
4
+ export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-zaTBum17.cjs';
5
5
 
6
6
  /**
7
7
  * Niadra for Amazon Bedrock's Converse API (`@aws-sdk/client-bedrock-runtime`), as `wrap()` is for
package/dist/bedrock.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { f as ModelUsage } from './client-B_ip8T2o.js';
2
- import { W as WrapOptions } from './intercept-CBaPK_-k.js';
3
- import { S as SessionResolver } from './shared-BLkAbvuf.js';
4
- export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-BLkAbvuf.js';
1
+ import { f as ModelUsage } from './client-rmWhZJOx.js';
2
+ import { W as WrapOptions } from './intercept-veMDudKV.js';
3
+ import { S as SessionResolver } from './shared-Cs7h5C4Y.js';
4
+ export { A as AgentMemoryOption, P as Proof, a as ProofSource, b as Session, c as attestationProof } from './shared-Cs7h5C4Y.js';
5
5
 
6
6
  /**
7
7
  * Niadra for Amazon Bedrock's Converse API (`@aws-sdk/client-bedrock-runtime`), as `wrap()` is for