/**
 * src/knowledge/graphiti.ts
 * Conversation knowledge graph — SQLite-backed.
 *
 * Replaces the original Neo4j-backed implementation with a SQLite version
 * that ships out-of-the-box on the device. Same exported class shape so
 * unified.ts and downstream consumers (agent/brain.ts, channels/whatsapp/handler.ts)
 * don't change.
 *
 * Storage model (kg_entities + kg_relationships + kg_episodes):
 * - Customer-as-Person rows: kind='conversation', type='Person', customer_id=<the id>
 * - Other entities (Products, Locations, Companies, etc.): kind='conversation', customer_id=NULL
 * - Relationships: source_id → target_id with a type ('mentioned', 'interested_in', etc.)
 * - Episodes: raw conversation chunks with extracted-counts for telemetry
 */
export declare class GraphitiClient {
    /** Connect — no-op for SQLite (the shim is initialized lazily by utils/supabase.ts). */
    connect(): Promise<void>;
    /** Close — no-op. The underlying SQLite handle is managed by the shim. */
    close(): Promise<void>;
    private upsertEntity;
    private upsertRelationship;
    /**
     * Synchronous raw-episode write + naive entity stub extraction. (C5 fix.)
     *
     * Runs on the brain's hot path (awaited before next turn). Does NOT call
     * the LLM — uses a regex-based stub extractor to grab obvious entities
     * (proper nouns, numbers with units, URLs). The richer LLM-based
     * extraction follows in `addConversationEpisode` async.
     *
     * Why both: this guarantees that turn N+1's queryBusinessBrain sees at
     * least the ROUGH entities from turn N (e.g., a customer name, a product
     * SKU, a price). The previous design had a 2-10s gap where N's content
     * existed but had no extracted entities — agent forgot what was just said.
     */
    recordRawEpisode(tenantId: string, customerId: string, customerName: string, conversationText: string, timestamp?: Date): Promise<void>;
    /**
     * Add a conversation episode — extract entities/relationships and store.
     * Returns the count of entities + relationships persisted (caller telemetry).
     */
    addConversationEpisode(tenantId: string, customerId: string, customerName: string, conversationText: string, timestamp?: Date): Promise<{
        entitiesCreated: number;
        relationshipsCreated: number;
        failed?: boolean;
        reason?: string;
    }>;
    /**
     * Everything we know about a specific customer — their entity row plus
     * every entity they're connected to.
     */
    queryCustomerKnowledge(tenantId: string, customerId: string): Promise<{
        entities: Record<string, unknown>[];
        relationships: Record<string, unknown>[];
    }>;
    /** Keyword search across all conversation entities for a tenant. */
    searchKnowledge(tenantId: string, query: string): Promise<Record<string, unknown>[]>;
    /**
     * Find other customers who mentioned the same entities — "shared interest"
     * recommendations. JS-side join: get the customer's mentioned entities,
     * then find other customers who have a relationship to those same entities.
     */
    getCustomerRelationships(tenantId: string, customerId: string): Promise<Record<string, unknown>[]>;
    /**
     * Product insights — for a specific product (or all top products), list the
     * customers who mentioned/asked about it and how often.
     */
    getProductInsights(tenantId: string, productId?: string): Promise<Record<string, unknown>[]>;
}
export declare const graphiti: GraphitiClient;
//# sourceMappingURL=graphiti.d.ts.map