This page covers management of Semantic cells

Object Overview

Endpoint, URL, and Supported Methods
Objects are managed via the storage server API at [http|https]\://[hostname]\:[port]/v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[document-guid]/cells/[cell-guid]/chunks.

Supported methods include: GET ``HEAD

Structure

{
    "GUID": "de45fa91-35f0-4c71-829e-9f4a59a4cd92",
    "MD5Hash": "d41d8cd98f00b204e9800998ecf8427e",
    "SHA1Hash": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
    "SHA256Hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "Position": 1,
    "Start": 0,
    "End": 58,
    "Length": 58,
    "Content": "This is a semantic chunk representing a piece of text.",
    "Embeddings": [0.134, -0.092, 0.238, ...]
}

Properties:

  • GUID string unique identifier for the semantic chunk (may be auto-generated if not provided)
  • MD5Hash string MD5 hash of the chunk content
  • SHA1Hash string SHA1 hash of the chunk content
  • SHA256Hash string SHA256 hash of the chunk content
  • Position number index of the chunk in the document
  • Start number start character offset of the chunk in the source content
  • End number end character offset of the chunk in the source content
  • Length number total length of the chunk in characters
  • Content string textual content of the chunk
  • Embeddings array<number> array of floating-point numbers representing the semantic embedding of the content

Read semantic chunks

To Read semantic cells, call GET/v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[documentguid]/cells/[cell-guid]/chunks

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/vectorrepositories/00000000-0000-0000-0000-000000000000/documents/00000000-0000-0000-0000-000000000000/cells' \
--header 'Authorization: ••••••' \
--data ''
import { ViewVectorProxySdk } from "view-sdk";

const vector = new ViewVectorProxySdk(
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const readSematicChunks = async () => {
  try {
    const response = await vector.retrieveSemanticChunks(
      "00000000-0000-0000-0000-000000000000",
      "00000000-0000-0000-0000-000000000000",
      "00000000-0000-0000-0000-000000000000"
    );
    console.log(response, "Read semantic chunks response");
  } catch (err) {
    console.log("Error read semantic chunks:", err);
  }
};
readSematicChunks();

Read semantic chunk

To read a single semantic chunk, call GET /v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[document-guid]/cells/[cell-guid]/chunks/[chunk-guid]

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/vectorrepositories/00000000-0000-0000-0000-000000000000/documents/00000000-0000-0000-0000-000000000000/cells/00000000-0000-0000-0000-000000000000/chunks/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
--data ''
import { ViewVectorProxySdk } from "view-sdk";

const vector = new ViewVectorProxySdk(
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const readSematicChunk = async () => {
  try {
    const response = await vector.retrieveSemanticChunk(
      "00000000-0000-0000-0000-000000000000", // vector repository guid
      "00000000-0000-0000-0000-000000000000", // document guid
      "00000000-0000-0000-0000-000000000000", // semantic cell guid
      "00000000-0000-0000-0000-000000000000" // semantic chunk guid
    );
    console.log(response, "Read semantic chunk response");
  } catch (err) {
    console.log("Error read semantic chunk:", err);
  }
};

readSematicChunk();

Semantic chunk exists

To semantic chunk existence , call HEAD /v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[document-guid]/cells/[cell-guid]/chunks/[chunk-guid]

curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/vectorrepositories/00000000-0000-0000-0000-000000000000/documents/00000000-0000-0000-0000-000000000000/cells/00000000-0000-0000-0000-000000000000/chunks/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
--data ''
import { ViewVectorProxySdk } from "view-sdk";

const vector = new ViewVectorProxySdk(
  "00000000-0000-0000-0000-000000000000", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const existSemanticChunk = async () => {
  try {
    const response = await vector.semanticChunkExists(
      "00000000-0000-0000-0000-000000000000", // vector repository guid
      "00000000-0000-0000-0000-000000000000", // document guid
      "00000000-0000-0000-0000-000000000000", // semantic cell guid
      "00000000-0000-0000-0000-000000000000" // semantic chunk guid
    );
    console.log(response, "Semantic chunk exists response");
  } catch (err) {
    console.log("Error semantic chunk exists:", err);
  }
};
existSemanticChunk();