Skip to main content

codebolt.rag

Retrieval Augmented Generation tools for creating and querying knowledge indexes.

Available Tools

  • rag_create_index - Create a new RAG index
  • rag_add_documents - Add documents to a RAG index
  • rag_query - Query documents from RAG index
  • rag_delete_index - Delete a RAG index
  • rag_update_document - Update a document in RAG index
  • rag_list_indexes - List all available RAG indexes

Tool Parameters

rag_create_index

Creates a new RAG (Retrieval Augmented Generation) index for storing and retrieving documents.

ParameterTypeRequiredDescription
indexNamestringYesThe unique name for the new RAG index
descriptionstringNoA description of what the index contains

rag_add_documents

Adds one or more documents to an existing RAG index.

ParameterTypeRequiredDescription
indexNamestringYesThe name of the RAG index to add documents to
documentsarrayYesArray of document objects to add
documents[].idstringYesUnique identifier for the document
documents[].contentstringYesThe text content of the document
documents[].metadataobjectNoOptional metadata associated with the document (e.g., type, version)

rag_query

Queries documents from a RAG index based on a natural language query.

ParameterTypeRequiredDescription
indexNamestringYesThe name of the RAG index to query
querystringYesThe natural language query to search for
topKnumberNoMaximum number of results to return (default varies by implementation)

rag_delete_index

Deletes an existing RAG index and all its documents.

ParameterTypeRequiredDescription
indexNamestringYesThe name of the RAG index to delete

rag_update_document

Updates an existing document in a RAG index.

ParameterTypeRequiredDescription
indexNamestringYesThe name of the RAG index containing the document
documentIdstringYesThe unique identifier of the document to update
contentstringYesThe new text content for the document
metadataobjectNoOptional updated metadata for the document

rag_list_indexes

Lists all available RAG indexes.

ParameterTypeRequiredDescription
(none)--This tool takes no parameters

Sample Usage

// Create a new RAG index
const createResult = await codeboltMCP.executeTool(
"codebolt.rag",
"rag_create_index",
{
indexName: "project_docs",
description: "Project documentation index"
}
);

// Add documents to index
const addResult = await codeboltMCP.executeTool(
"codebolt.rag",
"rag_add_documents",
{
indexName: "project_docs",
documents: [
{
id: "doc1",
content: "This is the API documentation...",
metadata: { type: "api", version: "1.0" }
}
]
}
);

// Query the RAG index
const queryResult = await codeboltMCP.executeTool(
"codebolt.rag",
"rag_query",
{
indexName: "project_docs",
query: "How to authenticate users?",
topK: 3
}
);

// List all indexes
const listResult = await codeboltMCP.executeTool(
"codebolt.rag",
"rag_list_indexes",
{}
);

// Update a document
const updateResult = await codeboltMCP.executeTool(
"codebolt.rag",
"rag_update_document",
{
indexName: "project_docs",
documentId: "doc1",
content: "Updated API documentation..."
}
);
info

This functionality is similar to the rag API and provides knowledge retrieval through MCP interface.