<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Sufiya Maheen</title>
    <description>The latest articles on DEV Community by Sufiya Maheen (@sufiyaaa_007_).</description>
    <link>https://dev.to/sufiyaaa_007_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4149898%2F7d0cf3bb-ca07-48f2-932f-926d1fe54f21.jpg</url>
      <title>DEV Community: Sufiya Maheen</title>
      <link>https://dev.to/sufiyaaa_007_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sufiyaaa_007_"/>
    <language>en</language>
    <item>
      <title>Engineering the Scan and Recommendation Agents for a Memory-Driven GEO System</title>
      <dc:creator>Sufiya Maheen</dc:creator>
      <pubDate>Tue, 29 Sep 2026 14:36:05 +0000</pubDate>
      <link>https://dev.to/sufiyaaa_007_/engineering-the-scan-and-recommendation-agents-for-a-memory-driven-geo-system-4o71</link>
      <guid>https://dev.to/sufiyaaa_007_/engineering-the-scan-and-recommendation-agents-for-a-memory-driven-geo-system-4o71</guid>
      <description>&lt;p&gt;The AI pipeline turns a brand name into two things: a measurable GEO visibility result and a recommendation for what to do next. I worked on both the Scan Agent and the Recommendation Agent, and we kept them as separate modules because they solve two different problems.&lt;/p&gt;

&lt;p&gt;• Scan Agent: Gathers and structures evidence.&lt;br&gt;
• Recommendation Agent: Reasons over that evidence and the history stored in Hindsight.&lt;/p&gt;

&lt;p&gt;MODULE A: SCAN AGENT&lt;/p&gt;

&lt;p&gt;The process starts with a brand name and category. Instead of simply asking a model, “Do you know this brand?”, the agent generates questions based on what a customer would actually search for.&lt;/p&gt;

&lt;p&gt;These questions are sent to models representing search engines such as ChatGPT and Perplexity. Each response is then analyzed to determine:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Whether the target brand was mentioned.&lt;/li&gt;
&lt;li&gt;Which competitors were mentioned.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The raw responses are also preserved. The scan produces a fixed structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"brand"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Acme"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"timestamp"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2026-01-15T10:00:00Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"queries_tested"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mentions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"total_queries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"competitors_mentioned"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"raw_snippets"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;WHY USE STRUCTURED DATA?&lt;/p&gt;

&lt;p&gt;It would be easy to pass raw model responses directly into the next prompt. We chose not to do that because a scan should be reusable evidence.&lt;/p&gt;

&lt;p&gt;A structured scan can be:&lt;/p&gt;

&lt;p&gt;• Stored for later use&lt;br&gt;
• Displayed in the frontend&lt;br&gt;
• Compared with another scan&lt;br&gt;
• Passed to the Recommendation Agent&lt;/p&gt;

&lt;p&gt;It also gives the frontend a predictable structure and allows the Recommendation Agent to work without knowing how the original responses were collected.&lt;/p&gt;

&lt;p&gt;MODULE B: RECOMMENDATION AGENT&lt;/p&gt;

&lt;p&gt;The Recommendation Agent takes two inputs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The current scan&lt;/li&gt;
&lt;li&gt;The Hindsight record containing scan history and the actions log&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The actions log is especially important because it records not only what was recommended, but also what was actually tried and what happened afterward.&lt;/p&gt;

&lt;p&gt;One rule is built into the system:&lt;/p&gt;

&lt;p&gt;“If the actions log is empty, we are at Scan 1. Give a baseline recommendation and clearly acknowledge that there is no previous history yet.”&lt;/p&gt;

&lt;p&gt;When previous actions exist, the recommendation must consider what was already tried and whether those actions produced useful results.&lt;/p&gt;

&lt;p&gt;WHY KEEP THE AGENTS SEPARATE?&lt;/p&gt;

&lt;p&gt;The two agents answer different questions:&lt;/p&gt;

&lt;p&gt;• Scan Agent: “What is the current visibility situation?”&lt;br&gt;
• Recommendation Agent: “Given the current situation and what happened before, what should we recommend?”&lt;/p&gt;

&lt;p&gt;Keeping them separate makes the system easier to test and integrate.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;• The Scan Agent can be tested using sample inputs without running Hindsight.&lt;br&gt;
• The Recommendation Agent can be tested using a fake scan and progressively richer histories.&lt;br&gt;
• Problems can be isolated as either data collection issues or recommendation reasoning issues.&lt;/p&gt;

&lt;p&gt;TESTING SCAN 1, 5, AND 10&lt;/p&gt;

&lt;p&gt;The important question is not simply:&lt;/p&gt;

&lt;p&gt;“Does the system produce a recommendation?”&lt;/p&gt;

&lt;p&gt;The more important question is:&lt;/p&gt;

&lt;p&gt;“Does the recommendation change when the memory changes?”&lt;/p&gt;

&lt;p&gt;We test this using different stages of history:&lt;/p&gt;

&lt;p&gt;• Scan 1: Empty history. The recommendation should be general and honest about the lack of previous evidence.&lt;/p&gt;

&lt;p&gt;• Scan 5: Earlier actions and outcomes are available. The agent should begin identifying useful patterns.&lt;/p&gt;

&lt;p&gt;• Scan 10: More history is available. The recommendation should become more specific and refer to previous actions and their measured outcomes.&lt;/p&gt;

&lt;p&gt;This allows us to test whether Hindsight is actually influencing the recommendation instead of simply being stored in the system without affecting the output.&lt;/p&gt;

&lt;p&gt;USING SIMILAR PRECEDENTS&lt;/p&gt;

&lt;p&gt;Hindsight also provides a similar-precedent function.&lt;/p&gt;

&lt;p&gt;Given a new scan, an AI call can identify a relevant past action or outcome from the same brand or a similar situation. It also provides a short explanation of why that precedent is relevant.&lt;/p&gt;

&lt;p&gt;This means the agent does not have to depend only on fixed rules. A previous situation can provide useful guidance even when it is not exactly identical to the current one.&lt;/p&gt;

&lt;p&gt;FAKE DATA FIRST&lt;/p&gt;

&lt;p&gt;We first built the pipeline using hardcoded data before connecting all the real components.&lt;/p&gt;

&lt;p&gt;This helped us identify problems in the data flow and recommendation logic before dealing with integration issues.&lt;/p&gt;

&lt;p&gt;The core interface is intentionally simple:&lt;/p&gt;

&lt;p&gt;--&amp;gt; Current Scan + Remembered History → Recommendation&lt;/p&gt;

&lt;p&gt;The Scan Agent does not need to know how Hindsight stores its data, and Hindsight does not need to generate scans.&lt;/p&gt;

&lt;p&gt;This separation gives us a cleaner architecture, makes testing easier, and most importantly, gives us a way to verify whether memory actually changes the recommendations produced by the system.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>agents</category>
      <category>architecture</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
