import type { DocumentId, KnowledgeBaseId, TenantId } from '../ids/index.js' import type { ChunkingConfig } from './chunking.js' import type { EmbeddingConfig } from './embedding.js' import type { IngestionResult } from './ingestion.js' import type { RetrievalConfig, RetrievalQuery, RetrievalResult } from './retrieval.js' import type { DocumentMetadata, RAGOperationOptions } from './scope.js' export interface KnowledgeBaseConfig { id?: KnowledgeBaseId name: string description?: string tenantId: TenantId namespace?: string chunking?: Partial retrieval?: Partial embedding?: EmbeddingConfig } export interface KnowledgeBase { readonly id: KnowledgeBaseId readonly config: KnowledgeBaseConfig ingest( content: string, metadata?: DocumentMetadata, options?: RAGOperationOptions, ): Promise remove(documentId: DocumentId): Promise query(query: RetrievalQuery, options?: RAGOperationOptions): Promise clear(): Promise }