Search.Graphrag
Overview
Available Operations
- createGraphRAGStore - Create Store
- ingestGraphRAGDocuments - Ingest Documents
- queryGraphRAGStore - Query Store
- inspectGraphRAGStore - Inspect Graph
- deleteGraphRAGStore - Delete Store
createGraphRAGStore
Create Store
Example Usage
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:
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.
import {
// Mutation hook for triggering the API call.
useSearchGraphragCreateGraphRAGStoreMutation
} from "@meetkai/mka1/react-query/searchGraphragCreateGraphRAGStore.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateGraphRAGStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.CreateGraphRAGStoreResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GraphRAGErrorResponse | 400 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
ingestGraphRAGDocuments
Ingest Documents
Example Usage
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:
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.
import {
// Mutation hook for triggering the API call.
useSearchGraphragIngestGraphRAGDocumentsMutation
} from "@meetkai/mka1/react-query/searchGraphragIngestGraphRAGDocuments.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.IngestGraphRAGDocumentsRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.IngestGraphRAGDocumentsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GraphRAGErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
queryGraphRAGStore
Query Store
Example Usage
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:
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.
import {
// Mutation hook for triggering the API call.
useSearchGraphragQueryGraphRAGStoreMutation
} from "@meetkai/mka1/react-query/searchGraphragQueryGraphRAGStore.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.QueryGraphRAGStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.GraphRAGQueryResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GraphRAGErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
inspectGraphRAGStore
Inspect Graph
Example Usage
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:
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.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.InspectGraphRAGStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.GraphInspectionResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GraphRAGErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |
deleteGraphRAGStore
Delete Store
Example Usage
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:
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.
import {
// Mutation hook for triggering the API call.
useSearchGraphragDeleteGraphRAGStoreMutation
} from "@meetkai/mka1/react-query/searchGraphragDeleteGraphRAGStore.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.DeleteGraphRAGStoreRequest | ✔️ | The request object to use for the request. |
options | RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions | RequestInit | ➖ | Options 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.retries | RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<components.DeleteGraphRAGStoreResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.GraphRAGErrorResponse | 404 | application/json |
| errors.HTTPValidationError | 422 | application/json |
| errors.APIError | 4XX, 5XX | */* |