UNPKG

arela

Version:

AI-powered CTO with multi-agent orchestration, code summarization, visual testing (web + mobile) for blazing fast development.

65 lines 1.79 kB
import { HexiMemory } from "../memory/hexi-memory.js"; import { QueryClassifier } from "./classifier.js"; import type { RoutingResult } from "./types.js"; export interface MemoryRouterOptions { heximemory: HexiMemory; classifier: QueryClassifier; timeout?: number; cache?: boolean; } /** * MemoryRouter - Routes queries to appropriate memory layers based on classification * * Features: * - Automatic layer selection via QueryClassifier * - Parallel execution across multiple layers (Promise.all) * - Timeout handling (50ms default per layer) * - Graceful error handling (continues with partial results) * - Result caching (5-minute TTL) * - Performance tracking * * Example: * ```typescript * const router = new MemoryRouter({ heximemory, classifier }); * const result = await router.route("Continue working on auth"); * // Returns: { classification, results, stats } * ``` */ export declare class MemoryRouter { private heximemory; private classifier; private timeout; private cache; private cacheEnabled; constructor(options: MemoryRouterOptions); /** * Route a query to appropriate memory layers */ route(query: string): Promise<RoutingResult>; /** * Query a single memory layer with timeout */ private queryLayer; /** * Implementation of layer-specific queries * Maps each layer to its corresponding HexiMemory method */ private queryLayerImpl; /** * Timeout promise helper */ private timeoutPromise; /** * Clear cache */ clearCache(): void; /** * Get cache size */ getCacheSize(): number; /** * Get cache contents (for debugging) */ getCacheKeys(): string[]; } //# sourceMappingURL=router.d.ts.map