import { z } from "zod";
export type Observation = {
    id: string;
    content: string;
    validFrom: string;
    validTo: string | null;
};
export type Entity = {
    id: string;
    name: string;
    type: string;
    source: string;
    createdAt: string;
    observations: Observation[];
};
export type Relation = {
    id: string;
    from: string;
    to: string;
    type: string;
    source: string;
    validFrom: string;
    validTo: string | null;
};
export type MemoryGraphData = {
    entities: Entity[];
    relations: Relation[];
    nextId: number;
};
export type ConversationSummary = {
    summary: string;
    lastCompactedAt: string;
    messagesSummarized: number;
};
export type EmbeddingEntry = {
    id: string;
    vector: number[];
};
/**
 * `formatVersion` distinguishes embeddings built from different source
 * texts. Bumped to 2 when we started feeding the embedder a
 * contextualized "{name} ({type}): {content}" string per observation
 * instead of the bare observation content.
 *
 * Load-side behaviour (`MemoryManager.getEntry`): if the on-disk
 * index's `formatVersion` is missing (treated as v1) or older than
 * this constant, we discard the index in memory, log a warning so the
 * discard is visible, and start with an empty `EmbeddingManager`. The
 * graph and summary are NOT touched — only embeddings get rebuilt.
 * The next mutation (any `applyExtractionFromLLM` call) embeds the
 * affected observations in the current format and persists. Until
 * then, Tier 2 (embedding similarity) silently produces zero hits
 * and recall falls back to Tier 1 + Tier 3.
 *
 * If the source-text shape changes again, bump this constant; the
 * load guard handles the rest.
 */
export declare const EMBEDDING_FORMAT_VERSION = 2;
export type EmbeddingIndex = {
    formatVersion?: number;
    model: string;
    entries: EmbeddingEntry[];
};
export type MemoryConfig = {
    dir: string;
    /** Model used for memory's internal LLM calls (extraction, recall,
     *  forget, compaction, summary merge). Resolution order:
     *  this field > the top-level `defaultModel` from `agency.json` >
     *  the hardcoded fallback (`"gpt-4o-mini"`). Set this when you want
     *  a specific cheap model for memory work that differs from the
     *  agent's primary model. */
    model?: string;
    autoExtract?: {
        interval?: number;
    };
    compaction?: {
        trigger?: "token" | "messages";
        threshold?: number;
    };
    embeddings?: {
        model?: string;
    };
};
export type MemoryStore = {
    loadGraph(memoryId: string): Promise<MemoryGraphData>;
    saveGraph(memoryId: string, graph: MemoryGraphData): Promise<void>;
    loadEmbeddings(memoryId: string): Promise<EmbeddingIndex | null>;
    saveEmbeddings(memoryId: string, index: EmbeddingIndex): Promise<void>;
    loadSummary(memoryId: string): Promise<ConversationSummary | null>;
    saveSummary(memoryId: string, summary: ConversationSummary): Promise<void>;
};
export declare const MemoryGraphDataSchema: z.ZodObject<{
    entities: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        name: z.ZodString;
        type: z.ZodString;
        source: z.ZodString;
        createdAt: z.ZodString;
        observations: z.ZodArray<z.ZodObject<{
            id: z.ZodString;
            content: z.ZodString;
            validFrom: z.ZodString;
            validTo: z.ZodNullable<z.ZodString>;
        }, z.core.$strip>>;
    }, z.core.$strip>>;
    relations: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        from: z.ZodString;
        to: z.ZodString;
        type: z.ZodString;
        source: z.ZodString;
        validFrom: z.ZodString;
        validTo: z.ZodNullable<z.ZodString>;
    }, z.core.$strip>>;
    nextId: z.ZodNumber;
}, z.core.$strip>;
export declare const EmbeddingIndexSchema: z.ZodObject<{
    formatVersion: z.ZodOptional<z.ZodNumber>;
    model: z.ZodString;
    entries: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        vector: z.ZodArray<z.ZodNumber>;
    }, z.core.$strip>>;
}, z.core.$strip>;
export declare const ConversationSummarySchema: z.ZodObject<{
    summary: z.ZodString;
    lastCompactedAt: z.ZodString;
    messagesSummarized: z.ZodNumber;
}, z.core.$strip>;
