UNPKG

@vfarcic/dot-ai

Version:

AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance

77 lines 2.42 kB
/** * Knowledge Base Management Tool * * MCP tool for managing the knowledge base: ingest documents, search, delete, and retrieve chunks. * Documents are chunked (via plugin), embedded, and stored in Qdrant for semantic search. * * PRD #356: Knowledge Base System */ import { z } from 'zod'; import { Logger } from '../core/error-handling'; import { DotAI } from '../core/index'; import { KnowledgeSearchResultItem } from '../core/knowledge-types'; export declare const MANAGE_KNOWLEDGE_TOOL_NAME = "manageKnowledge"; export declare const MANAGE_KNOWLEDGE_TOOL_DESCRIPTION: string; export declare const MANAGE_KNOWLEDGE_TOOL_INPUT_SCHEMA: { operation: z.ZodEnum<{ search: "search"; ingest: "ingest"; deleteByUri: "deleteByUri"; }>; content: z.ZodOptional<z.ZodString>; uri: z.ZodOptional<z.ZodString>; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; query: z.ZodOptional<z.ZodString>; limit: z.ZodOptional<z.ZodNumber>; uriFilter: z.ZodOptional<z.ZodString>; interaction_id: z.ZodOptional<z.ZodString>; }; /** * Input type for knowledge management tool */ export interface ManageKnowledgeInput { operation: 'ingest' | 'search' | 'deleteByUri'; content?: string; uri?: string; metadata?: Record<string, unknown>; query?: string; limit?: number; uriFilter?: string; interaction_id?: string; } /** * Result type for the reusable search function */ export interface SearchKnowledgeBaseResult { success: boolean; chunks: KnowledgeSearchResultItem[]; totalMatches: number; error?: string; } /** * Reusable knowledge base search function. * Can be called from MCP tool handler or HTTP endpoints. * * @param params Search parameters * @returns Search results with chunks or error */ export declare function searchKnowledgeBase(params: { query: string; limit?: number; uriFilter?: string; }): Promise<SearchKnowledgeBaseResult>; /** * MCP response format with content array */ interface McpToolResponse { content: Array<{ type: 'text'; text: string; }>; } /** * Main tool handler - routes to appropriate operation handler */ export declare function handleManageKnowledgeTool(args: ManageKnowledgeInput, _dotAI: DotAI | null, logger: Logger, requestId: string): Promise<McpToolResponse>; export {}; //# sourceMappingURL=manage-knowledge.d.ts.map