@ontos-ai/knowhere-sdk 2.4.0 → 2.4.2

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.
package/README.md CHANGED
@@ -311,8 +311,8 @@ const response = await client.retrieval.query({
311
311
 
312
312
  console.log(response.answerText); // LLM-generated answer
313
313
  console.log(response.referencedChunks); // cited evidence chunks
314
- console.log(response.evidence); // composed parts to consume (text/HTML and inline images)
315
- console.log(response.evidenceText); // text projection of those parts
314
+ console.log(response.evidence); // grouped [E n] parts (text/HTML and inline images)
315
+ console.log(response.evidenceText); // deprecated; always empty. Use evidence.
316
316
  console.log(response.stopReason); // agentic termination reason, when returned
317
317
  console.log(response.failureReason); // no-answer reason, when returned
318
318
 
package/dist/index.d.mts CHANGED
@@ -199,14 +199,23 @@ interface Manifest {
199
199
  interface ConnectTo {
200
200
  /** Target chunk_id */
201
201
  target: string;
202
- /** Relationship type */
203
- relation: 'embeds' | 'related';
202
+ /**
203
+ * Relationship type.
204
+ * - `embeds`: body chunk -> inline image/table asset
205
+ * - `embedded_by`: image/table asset -> owning body chunk (reverse of `embeds`)
206
+ * - `related`: same-page body chunk -> asset
207
+ * - `cross_doc_entity` / `intra_doc_ref`: reserved, not produced yet
208
+ */
209
+ relation: 'embeds' | 'embedded_by' | 'related' | 'cross_doc_entity' | 'intra_doc_ref';
210
+ /** Reserved for cross-document targets; omitted for same-document edges */
211
+ targetDocumentId?: string;
204
212
  /** Placeholder ref in content, e.g. '[images/a.png]' (embeds only) */
205
213
  ref?: string;
206
- /** Semantic similarity score (related only) */
207
- score?: number;
208
- /** Shared keywords (related only) */
209
- keywords?: string[];
214
+ /** Character offsets of `ref` in the body content (embeds only) */
215
+ position?: {
216
+ start: number;
217
+ end: number;
218
+ };
210
219
  }
211
220
  /**
212
221
  * A single image or table resource entry in ``doc_nav.json``.
@@ -949,7 +958,7 @@ interface RetrievalReferencedChunk {
949
958
  *
950
959
  * Downstream agents consume:
951
960
  * - `evidence`: composed parts (text/HTML and inline images)
952
- * - `evidenceText`: text projection of those parts
961
+ * - `evidenceText`: deprecated; always empty. Use `evidence`.
953
962
  * - `results`: raw path chunks for debug
954
963
  * - `decisionTrace`: per-step navigation decisions (includes stop/failure)
955
964
  * - `referencedChunks`: structured chunk citations for follow-up queries
@@ -967,7 +976,7 @@ interface RetrievalQueryResponse {
967
976
  answerText: string | null;
968
977
  /** Cited evidence chunks with asset URLs when available */
969
978
  referencedChunks: RetrievalReferencedChunk[];
970
- /** Text projection of evidence. Tables stay as HTML; images are data URLs. */
979
+ /** Deprecated. Always empty. Use evidence. */
971
980
  evidenceText?: string | null;
972
981
  /** Reason why the agentic run stopped (e.g. answer_done, not_found) */
973
982
  stopReason?: string | null;
package/dist/index.d.ts CHANGED
@@ -199,14 +199,23 @@ interface Manifest {
199
199
  interface ConnectTo {
200
200
  /** Target chunk_id */
201
201
  target: string;
202
- /** Relationship type */
203
- relation: 'embeds' | 'related';
202
+ /**
203
+ * Relationship type.
204
+ * - `embeds`: body chunk -> inline image/table asset
205
+ * - `embedded_by`: image/table asset -> owning body chunk (reverse of `embeds`)
206
+ * - `related`: same-page body chunk -> asset
207
+ * - `cross_doc_entity` / `intra_doc_ref`: reserved, not produced yet
208
+ */
209
+ relation: 'embeds' | 'embedded_by' | 'related' | 'cross_doc_entity' | 'intra_doc_ref';
210
+ /** Reserved for cross-document targets; omitted for same-document edges */
211
+ targetDocumentId?: string;
204
212
  /** Placeholder ref in content, e.g. '[images/a.png]' (embeds only) */
205
213
  ref?: string;
206
- /** Semantic similarity score (related only) */
207
- score?: number;
208
- /** Shared keywords (related only) */
209
- keywords?: string[];
214
+ /** Character offsets of `ref` in the body content (embeds only) */
215
+ position?: {
216
+ start: number;
217
+ end: number;
218
+ };
210
219
  }
211
220
  /**
212
221
  * A single image or table resource entry in ``doc_nav.json``.
@@ -949,7 +958,7 @@ interface RetrievalReferencedChunk {
949
958
  *
950
959
  * Downstream agents consume:
951
960
  * - `evidence`: composed parts (text/HTML and inline images)
952
- * - `evidenceText`: text projection of those parts
961
+ * - `evidenceText`: deprecated; always empty. Use `evidence`.
953
962
  * - `results`: raw path chunks for debug
954
963
  * - `decisionTrace`: per-step navigation decisions (includes stop/failure)
955
964
  * - `referencedChunks`: structured chunk citations for follow-up queries
@@ -967,7 +976,7 @@ interface RetrievalQueryResponse {
967
976
  answerText: string | null;
968
977
  /** Cited evidence chunks with asset URLs when available */
969
978
  referencedChunks: RetrievalReferencedChunk[];
970
- /** Text projection of evidence. Tables stay as HTML; images are data URLs. */
979
+ /** Deprecated. Always empty. Use evidence. */
971
980
  evidenceText?: string | null;
972
981
  /** Reason why the agentic run stopped (e.g. answer_done, not_found) */
973
982
  stopReason?: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ontos-ai/knowhere-sdk",
3
- "version": "2.4.0",
3
+ "version": "2.4.2",
4
4
  "description": "Official Node.js SDK for Knowhere document parsing API",
5
5
  "keywords": [
6
6
  "knowhere",