/**
 * src/knowledge/unified.ts
 * طبقة المعرفة الموحدة — Unified Knowledge Layer
 * Combines conversation graph (Graphiti) + document graph (Graphify)
 * into a single query interface for the agent's brain.
 */
export interface BusinessBrainContext {
    customerContext: string;
    businessContext: string;
    combined: string;
}
export interface CustomerBrief {
    customerId: string;
    knownEntities: Record<string, unknown>[];
    relationships: Record<string, unknown>[];
    insights: {
        preferences: string[];
        sentiment: string;
        topics: string[];
    } | null;
    summary: string;
}
/**
 * Initialize both knowledge graph clients
 * Call once at startup — safe to call multiple times
 */
export declare function initKnowledgeGraphs(): Promise<void>;
/**
 * Graceful shutdown — wait for any in-flight background learning to finish
 * (up to 5 seconds) before closing KG handles.
 */
export declare function closeKnowledgeGraphs(): Promise<void>;
/**
 * Query the "Business Brain" — combines customer knowledge + document knowledge
 * Returns a context string ready to inject into the agent prompt
 */
export declare function queryBusinessBrain(tenantId: string, customerId: string, question: string): Promise<BusinessBrainContext>;
/**
 * Learn from a conversation — extract and store knowledge asynchronously
 * Runs in background so it doesn't block the response
 */
export declare function learnFromConversation(tenantId: string, customerId: string, customerName: string, conversationText: string): Promise<void>;
/**
 * Awaitable version of learnFromConversation. Use this in flows where you
 * want the next read-from-KG to definitely see the new episode (e.g.,
 * unit tests, eval runners, manual replay). Production message paths
 * should keep using the fire-and-forget version above.
 */
export declare function learnFromConversationSync(tenantId: string, customerId: string, customerName: string, conversationText: string): Promise<void>;
/**
 * Get a quick brief of everything known about a customer
 * Used for pre-loading agent context at conversation start
 */
export declare function getCustomerBrief(tenantId: string, customerId: string, conversationHistory?: string): Promise<CustomerBrief>;
/**
 * Build/refresh the document graph for a tenant
 */
export declare function buildTenantDocumentGraph(tenantId: string, documentsDir: string, refresh?: boolean): Promise<{
    filesProcessed: number;
    entitiesCreated: number;
}>;
//# sourceMappingURL=unified.d.ts.map