/** * InMemoryKnowledgeBaseClient — deterministic in-memory KnowledgeBaseClient. * * Returns a fixed set of FAKE retrieval passages, respecting maxResults * (default 5). No AWS, no Bedrock, no network. * * This is for build-plan §4 "in-memory dev clients (tools return real data * locally)". */ import type { KnowledgeBaseClient, KnowledgeBaseResult, RetrieveOptions } from './client.js'; const SEED_RESULTS: KnowledgeBaseResult[] = [ { source: 's3://sh-mcp-kb/handbook/vendor-onboarding.md', score: 0.92, passage: 'New vendors must complete the W-9 intake form and provide a certificate of insurance before any purchase order is issued.', }, { source: 's3://sh-mcp-kb/handbook/payment-terms.md', score: 0.84, passage: 'Standard payment terms are Net 30. Early-payment discounts of 2% are available when invoices are paid within 10 days.', }, { source: 's3://sh-mcp-kb/runbooks/dock-electrical.md', score: 0.77, passage: 'Dock lighting circuits are rated for 30A. A repeated trip under load usually indicates a degraded breaker or a wet junction box.', }, ]; /** In-memory KnowledgeBaseClient returning seeded passages. */ export class InMemoryKnowledgeBaseClient implements KnowledgeBaseClient { async retrieve(options: RetrieveOptions): Promise { const limit = options.maxResults ?? 5; return SEED_RESULTS.slice(0, limit); } }