Skip to main content

codebolt.vector

Vector database operations for adding, querying, and retrieving vectors.

Available Tools​

  • add_item - Add an item to the vector database
  • query - Query the vector database
  • get_vector - Retrieve a vector by item

Tool Parameters​

add_item​

Adds an item to the vector database. The item will be converted to a vector representation for similarity search.

ParameterTypeRequiredDescription
itemstringYesThe text content or data to add to the vector database

query​

Queries the vector database to find items similar to the provided query.

ParameterTypeRequiredDescription
querystringYesThe search query text to find similar items
topKnumberNoMaximum number of similar results to return (default: 1)

get_vector​

Retrieves a vector representation for a specific item from the database.

ParameterTypeRequiredDescription
itemstringYesThe identifier or key of the item to retrieve the vector for

Sample Usage​

// Add an item to the vector database
const addResult = await codebolt.tools.executeTool(
"codebolt.vector",
"add_item",
{ item: "This is a test document for vector database" }
);

// Query the vector database
const queryResult = await codebolt.tools.executeTool(
"codebolt.vector",
"query",
{ query: "test document vector", topK: 1 }
);

// Retrieve a vector by item
const getVectorResult = await codebolt.tools.executeTool(
"codebolt.vector",
"get_vector",
{ item: "test-vector-001" }
);
info

This functionality provides vector database operations through the MCP interface.