/** * Context Agent - Agent with enhanced context management */ import { KnowledgeBase, type SearchResult } from '../knowledge/rag'; export interface ContextAgentConfig { name?: string; instructions: string; llm?: string; knowledgeBase?: KnowledgeBase; contextWindow?: number; maxContextTokens?: number; verbose?: boolean; } export interface ContextMessage { role: 'system' | 'user' | 'assistant'; content: string; timestamp: number; metadata?: Record; } /** * Context Agent - Agent with RAG and context management */ export declare class ContextAgent { readonly name: string; readonly instructions: string; private provider; private providerPromise; private llmModel; private knowledgeBase?; private contextWindow; private maxContextTokens; private messages; private verbose; constructor(config: ContextAgentConfig); /** * Get the LLM provider (lazy initialization with AI SDK backend) */ private getProvider; /** * Chat with context awareness */ chat(prompt: string): Promise<{ text: string; context?: SearchResult[]; }>; /** * Get recent messages within context window */ private getRecentMessages; /** * Add document to knowledge base */ addDocument(id: string, content: string, metadata?: Record): Promise; /** * Search knowledge base */ searchKnowledge(query: string, limit?: number): Promise; /** * Clear conversation history */ clearHistory(): void; /** * Get conversation history */ getHistory(): ContextMessage[]; /** * Set knowledge base */ setKnowledgeBase(kb: KnowledgeBase): void; } /** * Create a context agent */ export declare function createContextAgent(config: ContextAgentConfig): ContextAgent;