<?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: Abhishek Vishwakarma</title>
    <description>The latest articles on DEV Community by Abhishek Vishwakarma (@abhishek_vishwakarma_8951).</description>
    <link>https://dev.to/abhishek_vishwakarma_8951</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%2F4008999%2Fa1127a37-9619-4fee-8c54-bd92a282b0b0.png</url>
      <title>DEV Community: Abhishek Vishwakarma</title>
      <link>https://dev.to/abhishek_vishwakarma_8951</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishek_vishwakarma_8951"/>
    <language>en</language>
    <item>
      <title>Five Bugs Deep in an AI Memory Layer: My Week with Cognee</title>
      <dc:creator>Abhishek Vishwakarma</dc:creator>
      <pubDate>Tue, 30 Jun 2026 05:34:36 +0000</pubDate>
      <link>https://dev.to/abhishek_vishwakarma_8951/five-bugs-deep-in-an-ai-memory-layer-my-week-with-cognee-3m01</link>
      <guid>https://dev.to/abhishek_vishwakarma_8951/five-bugs-deep-in-an-ai-memory-layer-my-week-with-cognee-3m01</guid>
      <description>&lt;p&gt;&lt;em&gt;By &lt;a href="https://github.com/vishwabhishek" rel="noopener noreferrer"&gt;Abhishek Vishwakarma&lt;/a&gt; — final-year CS student, SOC analyst background, building toward GenAI/agentic AI engineering.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When I signed up for &lt;strong&gt;The Hangover Part AI: Where's My Context?&lt;/strong&gt; — WeMakeDevs' hackathon built around Cognee — I didn't start by building a flashy demo. I started by reading code. Cognee promises AI agents a real memory: ingest anything, build a hybrid graph-vector knowledge store, and let agents &lt;code&gt;remember()&lt;/code&gt;, &lt;code&gt;recall()&lt;/code&gt;, &lt;code&gt;improve()&lt;/code&gt;, and &lt;code&gt;forget()&lt;/code&gt; across infinite sessions instead of waking up with amnesia every session. Before I trusted that promise enough to build on top of it, I wanted to know how solid the foundation actually was.&lt;/p&gt;

&lt;p&gt;So instead of a project, I went issue-hunting on the &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;Cognee GitHub repo&lt;/a&gt; — 25k+ stars, Python-first, the open-source backbone for a lot of "agent memory" products getting built right now. Five pull requests later, here's what I found and fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Retrying an error that was never going to succeed
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;EmbeddingException&lt;/code&gt; is what Cognee's embedding engines raise when a chunk of text is too short to split further but still blows past the embedding model's context window. That's a deterministic failure — retrying it changes nothing. But the &lt;code&gt;@retry&lt;/code&gt; decorator on &lt;code&gt;embed_text&lt;/code&gt; in &lt;code&gt;FastembedEmbeddingEngine&lt;/code&gt;, &lt;code&gt;LiteLLMEmbeddingEngine&lt;/code&gt;, and &lt;code&gt;OpenAICompatibleEmbeddingEngine&lt;/code&gt; was catching it anyway and retrying with exponential backoff for up to 128 seconds. In production this meant silent hangs on bad input; in CI it meant unit tests covering context-window fallbacks took over four minutes to run.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; added &lt;code&gt;EmbeddingException&lt;/code&gt; to the excluded exception types in &lt;code&gt;retry_if_not_exception_type&lt;/code&gt; across all three engines, so non-transient errors fail fast instead of burning two minutes pretending they might not.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. When "skip the bad entity" quietly breaks alignment
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;TripletSearchContextProvider&lt;/code&gt; builds search context by gathering results for a list of entities. The problem: when an entity was invalid (&lt;code&gt;_get_entity_text(entity)&lt;/code&gt; returned &lt;code&gt;None&lt;/code&gt;), it was still passed into &lt;code&gt;_results_to_context(entities, results)&lt;/code&gt; alongside the &lt;em&gt;valid&lt;/em&gt; entities' search tasks — but search tasks are only created for valid entities. That mismatch in list length silently zipped the wrong results to the wrong entities, with no error, just quietly wrong context.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; filter to &lt;code&gt;valid_entities&lt;/code&gt; &lt;em&gt;before&lt;/em&gt; generating search tasks, and use that same filtered list when zipping results back into context. Added a unit test specifically verifying alignment holds.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Configuration that pretended to be dynamic
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;DefaultCrawlerConfig&lt;/code&gt; and &lt;code&gt;TavilyConfig&lt;/code&gt; referenced environment variables like &lt;code&gt;WEB_SCRAPER_TIMEOUT&lt;/code&gt; — but the Pydantic fields were bound at class-definition time, so changing the env var at runtime did nothing. The config looked configurable. It wasn't.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; wrapped the env lookups in &lt;code&gt;Field(default_factory=...)&lt;/code&gt; so timeout, concurrency, and crawl-delay settings are actually read fresh at instantiation, with a test verifying overrides take effect.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. A docstring lying about its own function
&lt;/h2&gt;

&lt;p&gt;Small one, but the kind of thing that costs someone an hour of debugging: &lt;code&gt;is_embeddable(s: str)&lt;/code&gt;'s docstring claimed a string needed at least one &lt;em&gt;alphanumeric&lt;/em&gt; character to be embeddable. The actual implementation only checked for one &lt;em&gt;non-whitespace&lt;/em&gt; character. Different bar entirely — a string of just punctuation would pass the real check but, per the docs, shouldn't have.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; corrected the docstring to match what the code actually does.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Serialization that broke on its own success
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;SearchResultPayload&lt;/code&gt; had two separate problems. First, its serialization logic couldn't properly handle nested Pydantic models, UUIDs, or collections inside &lt;code&gt;result_object&lt;/code&gt; — it needed a real recursive serializer, not ad-hoc handling. Second, and sneakier: the result-resolution logic used a truthiness check, so a legitimately empty list, empty string, or empty dict in &lt;code&gt;completion&lt;/code&gt;/&lt;code&gt;context&lt;/code&gt; was treated as "nothing here" and silently fell back to different behavior — even though an empty result is still a &lt;em&gt;valid&lt;/em&gt; result.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Fix:&lt;/strong&gt; wrote a recursive &lt;code&gt;serialize_value()&lt;/code&gt; helper covering &lt;code&gt;BaseModel&lt;/code&gt;, UUIDs, lists/tuples/sets, and dicts, and replaced the truthiness check with an explicit &lt;code&gt;is not None&lt;/code&gt; check so falsy-but-valid values are returned correctly. Added tests for both the complex serialization case and the falsy-completion case.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this actually taught me
&lt;/h2&gt;

&lt;p&gt;None of these are headline bugs — no security holes, no crashes that scream at you in production. They're the quiet kind: a retry that should never retry, a zip that's misaligned by one, a config that lies about being configurable, a docstring that's just wrong, a truthy/falsy mixup that throws away valid empty results. The kind you only find by actually reading the code path end to end instead of skimming the README and writing a demo on top of it.&lt;/p&gt;

&lt;p&gt;Coming from a SOC/security background, that's basically the instinct I brought here: don't trust the surface, trace the actual data flow. Turns out that instinct travels well into "is this open-source memory layer solid enough to build agents on."&lt;/p&gt;

&lt;p&gt;All five PRs are open and awaiting review as of writing. I'll update this post once they're merged — but whether or not all five land, this was a better use of hackathon week than shipping a demo I'd have to explain away in the README.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PRs:&lt;/strong&gt; &lt;a href="https://github.com/topoteretes/cognee/pull/3565" rel="noopener noreferrer"&gt;#3565&lt;/a&gt; · &lt;a href="https://github.com/topoteretes/cognee/pull/3566" rel="noopener noreferrer"&gt;#3566&lt;/a&gt; · &lt;a href="https://github.com/topoteretes/cognee/pull/3567" rel="noopener noreferrer"&gt;#3567&lt;/a&gt; · &lt;a href="https://github.com/topoteretes/cognee/pull/3568" rel="noopener noreferrer"&gt;#3568&lt;/a&gt; · &lt;a href="https://github.com/topoteretes/cognee/pull/3569" rel="noopener noreferrer"&gt;#3569&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;All code, fixes, and pull requests in this post are my own work. I used Claude (AI assistant) to help structure and draft the writeup, as disclosed per the hackathon rules.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Built for &lt;a href="https://www.wemakedevs.org/hackathons/cognee" rel="noopener noreferrer"&gt;The Hangover Part AI&lt;/a&gt; by &lt;a href="https://twitter.com/WeMakeDevs" rel="noopener noreferrer"&gt;@wemakedevs&lt;/a&gt;, powered by &lt;a href="https://github.com/topoteretes/cognee" rel="noopener noreferrer"&gt;Cognee&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;and the above post is made by using claude &lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>debugging</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
