/**
 * Trajectory Feedback — Past Experience Injection
 *
 * Queries the trajectory database for past orchestrator decisions and
 * formats relevant experience as agent memory context. This closes the
 * loop between trajectory *output* (logging decisions) and trajectory
 * *input* (feeding experience back to agents at spawn time).
 *
 * Inspired by "Codified Context" (arXiv:2602.20478) — known failure
 * modes and past decisions are pre-loaded into agent context so they
 * don't repeat mistakes or re-derive solutions.
 *
 * @module services/trajectory-feedback
 */
import { type IAgentRuntime } from "@elizaos/core";
/** A distilled experience entry from a past trajectory. */
interface PastExperience {
    /** When this experience was recorded */
    timestamp: number;
    /** The orchestrator decision type (coordination, turn-complete, etc.) */
    decisionType: string;
    /** Agent label that produced this experience */
    taskLabel: string;
    /** The key insight or decision (extracted from LLM response) */
    insight: string;
}
/** Options for querying past experience. */
export interface TrajectoryFeedbackOptions {
    /** Maximum number of recent trajectories to scan (default: 30) */
    maxTrajectories?: number;
    /** Maximum number of experience entries to return (default: 8) */
    maxEntries?: number;
    /** Only include trajectories from the last N hours (default: 48) */
    lookbackHours?: number;
    /** Task description for relevance filtering */
    taskDescription?: string;
    /** Repository URL — only return experience from the same repo */
    repo?: string;
}
/**
 * Query the trajectory database for past orchestrator decisions and
 * return distilled experience entries relevant to the current task.
 */
export declare function queryPastExperience(runtime: IAgentRuntime, options?: TrajectoryFeedbackOptions): Promise<PastExperience[]>;
/**
 * Format past experience entries as a markdown section suitable for
 * injection into agent memory (CLAUDE.md / GEMINI.md).
 *
 * Returns empty string if no relevant experience is found.
 */
export declare function formatPastExperience(experiences: PastExperience[]): string;
export {};
//# sourceMappingURL=trajectory-feedback.d.ts.map