@smartmemory/sdk-js 1.4.85 → 1.4.87

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.
@@ -721,6 +721,33 @@ class B {
721
721
  const u = { query: e, top_k: t, enable_hybrid: n };
722
722
  return s && (u.memory_type = s), r && (u.expertise = !0), i && (u.cite = !0), c && (u.decompose = !0), o && (u.multi_hop = !0), o && m !== 3 && (u.max_hops = m), o && h !== 1500 && (u.budget_ms = h), o && y && (u.semantic_hops = !0), p && (u.include_reference = !0), f && (u.include_consolidated = !0), _ && (u.consolidation_first = !0), d && (u.as_of_date = d instanceof Date ? d.toISOString() : d), l && (u.as_of_strict = !0), w && (u.include_superseded = !0), b && (u.include_retracted = !0), U && (u.include_archived = !0), this.api.post("/memory/search", u);
723
723
  }
724
+ /**
725
+ * Ask a question and get a written answer plus the evidence behind it (DIST-LITE-9).
726
+ *
727
+ * Where `search` hands back ranked memories for the caller to read, this returns a
728
+ * grounded answer together with the exact memories and graph relations it was built
729
+ * from, so a reader can check it rather than trust it. The evidence list is the
730
+ * retrieved set captured before the model ran, so a citation cannot be invented.
731
+ *
732
+ * The same request and response shape is served by the lite daemon on port 9014 and
733
+ * by the hosted API, which is what lets `AskPanel` from `@smartmemory/graph` point at
734
+ * either without changing.
735
+ *
736
+ * There is no fallback answer: a 502 comes back when the configured LLM errors or
737
+ * returns nothing, rather than a synthesized reply.
738
+ *
739
+ * @param {string} question - The natural-language question.
740
+ * @param {Object} [options]
741
+ * @param {number} [options.limit=5] - How many memories to retrieve as evidence (1-50).
742
+ * @param {boolean} [options.reasoning=true] - When false, `reasoning` comes back empty.
743
+ * @returns {Promise<{answer: string, reasoning: string, evidence: Array<{item_id: string, content: string}>, relations: Array<{source: string, type: string, target: string, source_id: string, target_id: string}>}>}
744
+ * Relation rows carry both display labels and graph node ids; combine them as
745
+ * `${source_id}->${target_id}:${type}` to address the edge in a graph view.
746
+ */
747
+ async ask(e, { limit: t = 5, reasoning: n = !0 } = {}) {
748
+ const s = { question: e, limit: t };
749
+ return n !== !0 && (s.reasoning = n), this.api.post("/memory/ask", s);
750
+ }
724
751
  /**
725
752
  * Get the complete audit answer for one memory (PLAT-AUDITABLE-MEMORY-1).
726
753
  *
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as e, a as r, d as A, e as I, B as P, D as o, f as n, I as t, M as g, O as i, j as m, q as M, r as h, l as f, m as l, T as S, o as p, U as u } from "./core-DM1Iz7Fc.js";
1
+ import { A as e, a as r, d as A, e as I, B as P, D as o, f as n, I as t, M as g, O as i, j as m, q as M, r as h, l as f, m as l, T as S, o as p, U as u } from "./core-BUZV42uF.js";
2
2
  export {
3
3
  e as APIError,
4
4
  r as AgentAPI,
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as f, a as u, b as A, c as P, d as b, e as h, D as I, E as g, G as x, f as p, I as w, L as m, M as k, O as v, g as T, P as B, h as y, i as C, j as S, R as E, k as R, S as F, l as L, m as M, T as O, n as G, o as U, p as $, U as D, V, Z } from "./core-DM1Iz7Fc.js";
1
+ import { A as f, a as u, b as A, c as P, d as b, e as h, D as I, E as g, G as x, f as p, I as w, L as m, M as k, O as v, g as T, P as B, h as y, i as C, j as S, R as E, k as R, S as F, l as L, m as M, T as O, n as G, o as U, p as $, U as D, V, Z } from "./core-BUZV42uF.js";
2
2
  const i = {
3
3
  variables: {
4
4
  colorBackground: "transparent",
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import h, { createContext as d, useRef as S, useState as p, useEffect as C, useCallback as c, useContext as g } from "react";
2
- import { l as y } from "./core-DM1Iz7Fc.js";
2
+ import { l as y } from "./core-BUZV42uF.js";
3
3
  const m = d(null), f = d(null);
4
4
  function b({ children: e, ...r }) {
5
5
  const n = S(null);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartmemory/sdk-js",
3
- "version": "1.4.85",
3
+ "version": "1.4.87",
4
4
  "description": "Unified JavaScript SDK for SmartMemory API — auth + API client for all frontends",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",