/** * pi-loom: Temporal Query Parser * * Zero-LLM regex-based time-aware query parsing, aligned with Mem0 v3's * Temporal Reasoning feature. Extracts temporal intent from natural language * queries and maps them to SQL-compatible date ranges. * * Supported patterns: * - "last week/month/year" → relative date ranges * - "today/yesterday" → specific day ranges * - "this week/month" → current period * - "recently" → last 7 days * - "as of March 2025" → absolute date anchor * - "upcoming" / "planned" → future/unexpired * - "right now" / "currently" → active + recent */ /** Result of temporal query parsing. null means no temporal intent detected. */ export interface TemporalFilter { /** ISO 8601 start date for created_at range (inclusive). */ startDate?: string; /** ISO 8601 end date for created_at range (exclusive). */ endDate?: string; /** Only include memories without an expiration (upcoming/active). */ unexpiredOnly?: boolean; /** The query with temporal phrases removed for cleaner keyword matching. */ cleanQuery: string; } /** * Parse a natural language query and extract temporal intent. * Returns null if no temporal pattern is detected. */ export declare function parseTemporalQuery(query: string): TemporalFilter | null; /** Normalize whitespace in a query string (collapse runs → single space). */ export declare function normalizeQuery(q: string): string;