The Grounded Memory research engine conducts iterative research rounds with web search and URL context enabled, feeding previously established facts back into subsequent prompts to discover novel claims and link each to exact source URLs until no new information emerges.

sequenceDiagram
    participant E as Engine
    participant G as Gemini Flash (Search)
    participant DB as Postgres DB

    Note over E: Round 1 (Initial)
    E->>G: Research brand facts (Grounding ON)
    G-->>E: Return facts and source URLs
    E->>DB: Save round 1 facts and citations

    loop Rounds 2 to N (until no fresh facts)
        Note over E: Accumulate facts
        E->>G: Find NEW facts excluding previous
        G-->>E: Return delta facts and sources
        alt New facts found
            E->>DB: Save delta facts and citations
        else No new facts / Empty delta
            Note over E: Stop iterative search
        end
    end

    Note over E: Trigger Fact and Gap Checker