/**
 * Memory relationships (links).
 *
 * Lifted out of the 2,166-line store.ts so the linking surface can be
 * read, tested, and modified without scrolling past every CRUD/search
 * helper in the memory module. No behaviour change vs the original
 * implementation in store.ts — exports re-emerge from store.ts via
 * a barrel re-export so existing import paths keep working.
 *
 * Imports from store.ts (getMemoryById, rowToMemory) form a module
 * cycle, but both are only invoked inside function bodies — ESM live
 * bindings handle this correctly at runtime.
 */
import type { Memory } from './types.js';
export type RelationshipType = 'references' | 'extends' | 'contradicts' | 'related';
export interface MemoryLink {
    id: number;
    sourceId: number;
    targetId: number;
    relationship: RelationshipType;
    strength: number;
    createdAt: Date;
}
/**
 * Create a link between two memories.
 *
 * Returns null if either memory id doesn't exist, the source equals
 * the target, or the link already exists (UNIQUE constraint).
 */
export declare function createMemoryLink(sourceId: number, targetId: number, relationship: RelationshipType, strength?: number): MemoryLink | null;
/**
 * Get all memories related to a given memory (incoming + outgoing links).
 */
export declare function getRelatedMemories(memoryId: number): {
    memory: Memory;
    relationship: RelationshipType;
    strength: number;
    direction: 'outgoing' | 'incoming';
}[];
/**
 * Delete a memory link by source/target id pair. Returns true if a row was removed.
 */
export declare function deleteMemoryLink(sourceId: number, targetId: number): boolean;
/**
 * Get every memory link in the database, newest first.
 */
export declare function getAllMemoryLinks(): MemoryLink[];
/**
 * Detect potential relationships for a new memory.
 *
 * Three strategies in priority order:
 *   1. Tag-based linking (shared tags)
 *   2. Embedding-based semantic linking (cosine similarity >= 0.6)
 *   3. FTS content similarity fallback (Jaccard similarity >= 0.3)
 *
 * Returns deduped results sorted by strength descending, capped at
 * maxResults.
 */
export declare function detectRelationships(memory: Memory, maxResults?: number): {
    targetId: number;
    relationship: RelationshipType;
    strength: number;
}[];
