gcharanteja
feat: implement enhanced 3-tier query search with fuzzy matching and LLM reranking
a964d2d | import { | |
| addDocuments, | |
| addDocumentsToolDefinition, | |
| listCollectionData, | |
| listCollectionDataToolDefinition, | |
| queryCollectionData, | |
| queryCollectionDataEnhanced, | |
| queryCollectionDataToolDefinition, | |
| } from "../services/vector.js"; | |
| export const vectorTools = [ | |
| addDocumentsToolDefinition, | |
| listCollectionDataToolDefinition, | |
| queryCollectionDataToolDefinition, | |
| ]; | |
| export async function handleVectorTool(name, args) { | |
| if (name === "list_collection_data") { | |
| const results = await listCollectionData(args); | |
| return { | |
| content: [ | |
| { | |
| type: "text", | |
| text: JSON.stringify(results, null, 2), | |
| }, | |
| ], | |
| }; | |
| } | |
| if (name === "add_documents") { | |
| const results = await addDocuments(args); | |
| return { | |
| content: [ | |
| { | |
| type: "text", | |
| text: JSON.stringify(results, null, 2), | |
| }, | |
| ], | |
| }; | |
| } | |
| if (name === "query_collection_data") { | |
| const results = args.enhanced | |
| ? await queryCollectionDataEnhanced(args) | |
| : await queryCollectionData(args); | |
| return { | |
| content: [ | |
| { | |
| type: "text", | |
| text: JSON.stringify(results, null, 2), | |
| }, | |
| ], | |
| }; | |
| } | |
| return null; | |
| } | |