Skip to content

Search.Graphrag

Overview

Available Operations

createGraphRAGStore

Create Store

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.search.graphrag.createGraphRAGStore({
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
    createGraphRAGStoreRequest: {
      storeName: "vendor_network",
      embeddingModel: "meetkai:qwen3-embedding-8b",
      extractionModel: "openai:gpt-4.1-mini",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchGraphragCreateGraphRAGStore } from "@meetkai/mka1/funcs/searchGraphragCreateGraphRAGStore.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await searchGraphragCreateGraphRAGStore(sdk, {
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
    createGraphRAGStoreRequest: {
      storeName: "vendor_network",
      embeddingModel: "meetkai:qwen3-embedding-8b",
      extractionModel: "openai:gpt-4.1-mini",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("searchGraphragCreateGraphRAGStore failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchGraphragCreateGraphRAGStoreMutation
} from "@meetkai/mka1/react-query/searchGraphragCreateGraphRAGStore.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.CreateGraphRAGStoreRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.CreateGraphRAGStoreResponse>

Errors

Error TypeStatus CodeContent Type
errors.GraphRAGErrorResponse400application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

ingestGraphRAGDocuments

Ingest Documents

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.search.graphrag.ingestGraphRAGDocuments({
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
    ingestGraphRAGDocumentsRequest: {
      documents: [
        {
          documentId: "doc_001",
          text: "Atlas Infrastructure Group owns Rivera Logistics.",
          metadata: {
            "source": "benchmark",
          },
        },
      ],
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchGraphragIngestGraphRAGDocuments } from "@meetkai/mka1/funcs/searchGraphragIngestGraphRAGDocuments.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await searchGraphragIngestGraphRAGDocuments(sdk, {
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
    ingestGraphRAGDocumentsRequest: {
      documents: [
        {
          documentId: "doc_001",
          text: "Atlas Infrastructure Group owns Rivera Logistics.",
          metadata: {
            "source": "benchmark",
          },
        },
      ],
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("searchGraphragIngestGraphRAGDocuments failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchGraphragIngestGraphRAGDocumentsMutation
} from "@meetkai/mka1/react-query/searchGraphragIngestGraphRAGDocuments.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.IngestGraphRAGDocumentsRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.IngestGraphRAGDocumentsResponse>

Errors

Error TypeStatus CodeContent Type
errors.GraphRAGErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

queryGraphRAGStore

Query Store

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.search.graphrag.queryGraphRAGStore({
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
    graphRAGQueryRequest: {
      query: "Who owns the company that won the Northern Bridge Sensors contract?",
    },
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchGraphragQueryGraphRAGStore } from "@meetkai/mka1/funcs/searchGraphragQueryGraphRAGStore.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await searchGraphragQueryGraphRAGStore(sdk, {
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
    graphRAGQueryRequest: {
      query: "Who owns the company that won the Northern Bridge Sensors contract?",
    },
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("searchGraphragQueryGraphRAGStore failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchGraphragQueryGraphRAGStoreMutation
} from "@meetkai/mka1/react-query/searchGraphragQueryGraphRAGStore.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.QueryGraphRAGStoreRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.GraphRAGQueryResponse>

Errors

Error TypeStatus CodeContent Type
errors.GraphRAGErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

inspectGraphRAGStore

Inspect Graph

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.search.graphrag.inspectGraphRAGStore({
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchGraphragInspectGraphRAGStore } from "@meetkai/mka1/funcs/searchGraphragInspectGraphRAGStore.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await searchGraphragInspectGraphRAGStore(sdk, {
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("searchGraphragInspectGraphRAGStore failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Query hooks for fetching data.
  useSearchGraphragInspectGraphRAGStore,
  useSearchGraphragInspectGraphRAGStoreSuspense,

  // Utility for prefetching data during server-side rendering and in React
  // Server Components that will be immediately available to client components
  // using the hooks.
  prefetchSearchGraphragInspectGraphRAGStore,
  
  // Utilities to invalidate the query cache for this query in response to
  // mutations and other user actions.
  invalidateSearchGraphragInspectGraphRAGStore,
  invalidateAllSearchGraphragInspectGraphRAGStore,
} from "@meetkai/mka1/react-query/searchGraphragInspectGraphRAGStore.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.InspectGraphRAGStoreRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.GraphInspectionResponse>

Errors

Error TypeStatus CodeContent Type
errors.GraphRAGErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*

deleteGraphRAGStore

Delete Store

Example Usage

typescript
import { SDK } from "@meetkai/mka1";

const sdk = new SDK({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const result = await sdk.search.graphrag.deleteGraphRAGStore({
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

typescript
import { SDKCore } from "@meetkai/mka1/core.js";
import { searchGraphragDeleteGraphRAGStore } from "@meetkai/mka1/funcs/searchGraphragDeleteGraphRAGStore.js";

// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
  bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});

async function run() {
  const res = await searchGraphragDeleteGraphRAGStore(sdk, {
    storeName: "<value>",
    xApiKeyId: "<id>",
    xUserId: "<id>",
    xExchangeJwtExternalUserId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("searchGraphragDeleteGraphRAGStore failed:", res.error);
  }
}

run();

React hooks and utilities

This method can be used in React components through the following hooks and associated utilities.

Check out this guide for information about each of the utilities below and how to get started using React hooks.

tsx
import {
  // Mutation hook for triggering the API call.
  useSearchGraphragDeleteGraphRAGStoreMutation
} from "@meetkai/mka1/react-query/searchGraphragDeleteGraphRAGStore.js";

Parameters

ParameterTypeRequiredDescription
requestoperations.DeleteGraphRAGStoreRequest✔️The request object to use for the request.
optionsRequestOptionsUsed to set various options for making HTTP requests.
options.fetchOptionsRequestInitOptions that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retriesRetryConfigEnables retrying HTTP requests under certain failure conditions.

Response

Promise<components.DeleteGraphRAGStoreResponse>

Errors

Error TypeStatus CodeContent Type
errors.GraphRAGErrorResponse404application/json
errors.HTTPValidationError422application/json
errors.APIError4XX, 5XX*/*