<?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: P. Sai Nieojitha</title>
    <description>The latest articles on DEV Community by P. Sai Nieojitha (@p_sainieojitha_af89d309).</description>
    <link>https://dev.to/p_sainieojitha_af89d309</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3944687%2Fceee798e-1cc3-4c92-b79e-044a73763e43.png</url>
      <title>DEV Community: P. Sai Nieojitha</title>
      <link>https://dev.to/p_sainieojitha_af89d309</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/p_sainieojitha_af89d309"/>
    <language>en</language>
    <item>
      <title>my new project</title>
      <dc:creator>P. Sai Nieojitha</dc:creator>
      <pubDate>Thu, 21 May 2026 18:31:28 +0000</pubDate>
      <link>https://dev.to/p_sainieojitha_af89d309/my-new-project-4b4</link>
      <guid>https://dev.to/p_sainieojitha_af89d309/my-new-project-4b4</guid>
      <description>&lt;p&gt;How I Stopped My Meal Agent From Inventing Ingredients&lt;/p&gt;

&lt;p&gt;Most AI meal assistants feel impressive for about five minutes.&lt;/p&gt;

&lt;p&gt;Then you realize they:&lt;/p&gt;

&lt;p&gt;suggest recipes using ingredients you don’t have,&lt;br&gt;
forget dietary restrictions,&lt;br&gt;
ignore previous reactions,&lt;br&gt;
and rerun expensive reasoning every interaction like nothing happened.&lt;/p&gt;

&lt;p&gt;I wanted to see what would happen if a household AI agent actually behaved more like a constrained system instead of a creative autocomplete engine.&lt;/p&gt;

&lt;p&gt;So I built ChefOS: a memory-aware meal planning agent with deterministic verification, runtime model routing, and long-term behavioral memory.&lt;/p&gt;

&lt;p&gt;The interesting part wasn’t generating recipes.&lt;/p&gt;

&lt;p&gt;It was making the agent trustworthy.&lt;/p&gt;

&lt;p&gt;The Problem With “Creative” Meal Agents&lt;/p&gt;

&lt;p&gt;Most LLM-based recipe systems optimize for fluency.&lt;/p&gt;

&lt;p&gt;That’s great until the model confidently recommends:&lt;/p&gt;

&lt;p&gt;paneer when none exists,&lt;br&gt;
spicy meals after reflux incidents,&lt;br&gt;
or recipes requiring ingredients the user explicitly removed from inventory.&lt;/p&gt;

&lt;p&gt;The deeper issue is that most assistants treat constraints as soft suggestions instead of hard rules.&lt;/p&gt;

&lt;p&gt;Inventory becomes context instead of a whitelist.&lt;/p&gt;

&lt;p&gt;Health restrictions become hints instead of safety requirements.&lt;/p&gt;

&lt;p&gt;I wanted to flip that architecture.&lt;/p&gt;

&lt;p&gt;The Core Design&lt;/p&gt;

&lt;p&gt;ChefOS runs on three ideas:&lt;/p&gt;

&lt;p&gt;Persistent memory using Hindsight&lt;br&gt;
Runtime routing + verifier gating using cascadeflow&lt;br&gt;
Deterministic inventory validation after inference&lt;/p&gt;

&lt;p&gt;The flow looks roughly like this:&lt;/p&gt;

&lt;p&gt;User Request&lt;br&gt;
    ↓&lt;br&gt;
Memory Recall (Hindsight)&lt;br&gt;
    ↓&lt;br&gt;
Constraint-Aware Prompt&lt;br&gt;
    ↓&lt;br&gt;
cascadeflow Routing&lt;br&gt;
    ↓&lt;br&gt;
Primary Model Response&lt;br&gt;
    ↓&lt;br&gt;
Verifier Gate&lt;br&gt;
    ↓&lt;br&gt;
Inventory + Safety Validation&lt;br&gt;
    ↓&lt;br&gt;
Render Response&lt;/p&gt;

&lt;p&gt;The biggest architectural decision was separating:&lt;/p&gt;

&lt;p&gt;generation&lt;br&gt;
from&lt;br&gt;
verification&lt;/p&gt;

&lt;p&gt;That changed everything.&lt;/p&gt;

&lt;p&gt;Memory Became More Useful Than I Expected&lt;/p&gt;

&lt;p&gt;I initially added Hindsight to persist user preferences across sessions.&lt;/p&gt;

&lt;p&gt;But the more interesting behavior came from storing negative outcomes.&lt;/p&gt;

&lt;p&gt;Example:&lt;/p&gt;

&lt;p&gt;Dad got acid reflux after spicy curry.&lt;/p&gt;

&lt;p&gt;Instead of storing raw chat history, the agent reflects that interaction into structured behavioral memory:&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
  "type": "safety_constraint",&lt;br&gt;
  "rule": "Avoid spicy meals for Dad",&lt;br&gt;
  "confidence": 93&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Over time, ChefOS builds “mental models” from repeated interactions.&lt;/p&gt;

&lt;p&gt;That created noticeably different behavior after multiple sessions:&lt;/p&gt;

&lt;p&gt;fewer unsafe suggestions,&lt;br&gt;
less repetitive reasoning,&lt;br&gt;
and more grounded recommendations.&lt;/p&gt;

&lt;p&gt;The agent stopped feeling stateless.&lt;/p&gt;

&lt;p&gt;Why I Added a Verifier After Generation&lt;/p&gt;

&lt;p&gt;This was probably the most important system change.&lt;/p&gt;

&lt;p&gt;Even with strong prompting, the generation model still occasionally hallucinated ingredients.&lt;/p&gt;

&lt;p&gt;So instead of trusting the output directly, I added a second verifier pass.&lt;/p&gt;

&lt;p&gt;The verifier checks:&lt;/p&gt;

&lt;p&gt;ingredient availability,&lt;br&gt;
allergy/reflux constraints,&lt;br&gt;
preference conflicts,&lt;br&gt;
and inventory consistency.&lt;/p&gt;

&lt;p&gt;A simplified version looks like this:&lt;/p&gt;

&lt;p&gt;const invalidIngredients = recipe.ingredients_used.filter(&lt;br&gt;
  item =&amp;gt; !fridgeInventory.includes(item.toLowerCase())&lt;br&gt;
);&lt;/p&gt;

&lt;p&gt;if (invalidIngredients.length &amp;gt; 0) {&lt;br&gt;
  blockRecipe();&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;This sounds simple, but it dramatically improved reliability.&lt;/p&gt;

&lt;p&gt;The interesting part is that the UX changed too.&lt;/p&gt;

&lt;p&gt;Instead of showing:&lt;/p&gt;

&lt;p&gt;“Recipe blocked”&lt;/p&gt;

&lt;p&gt;the assistant now responds conversationally:&lt;/p&gt;

&lt;p&gt;✨ Almost Ready&lt;/p&gt;

&lt;p&gt;Egg Fried Rice would work well here, but rice isn’t currently available in your kitchen.&lt;/p&gt;

&lt;p&gt;Scrambled Eggs is fully ready to make right now.&lt;/p&gt;

&lt;p&gt;That tiny change made the system feel much more intentional.&lt;/p&gt;

&lt;p&gt;cascadeflow Ended Up Solving Two Problems&lt;/p&gt;

&lt;p&gt;I originally added cascadeflow for model routing.&lt;/p&gt;

&lt;p&gt;Simple requests:&lt;/p&gt;

&lt;p&gt;inventory updates,&lt;br&gt;
short suggestions,&lt;br&gt;
preference retrieval&lt;/p&gt;

&lt;p&gt;run on smaller models.&lt;/p&gt;

&lt;p&gt;More complex requests:&lt;/p&gt;

&lt;p&gt;multi-user dietary conflicts,&lt;br&gt;
safety reasoning,&lt;br&gt;
verifier escalation&lt;/p&gt;

&lt;p&gt;route to larger reasoning models.&lt;/p&gt;

&lt;p&gt;The obvious benefit was lower cost and latency.&lt;/p&gt;

&lt;p&gt;The less obvious benefit was explainability.&lt;/p&gt;

&lt;p&gt;I exposed the routing decisions directly in the UI:&lt;/p&gt;

&lt;p&gt;Llama 8B → Escalated → 70B → Verifier&lt;/p&gt;

&lt;p&gt;That made the agent feel much less like a black box.&lt;/p&gt;

&lt;p&gt;The Most Interesting UX Decision&lt;/p&gt;

&lt;p&gt;I removed almost every “error-style” message.&lt;/p&gt;

&lt;p&gt;No:&lt;/p&gt;

&lt;p&gt;validation failure,&lt;br&gt;
blocked response,&lt;br&gt;
constraint violation,&lt;br&gt;
rejected recipe.&lt;/p&gt;

&lt;p&gt;Instead:&lt;/p&gt;

&lt;p&gt;“Almost Ready”&lt;br&gt;
“Tailored for Comfort”&lt;br&gt;
“Safety Checked &amp;amp; Ready”&lt;/p&gt;

&lt;p&gt;This sounds cosmetic, but it changed how the system felt during real interactions.&lt;/p&gt;

&lt;p&gt;The agent stopped feeling like a debugger and started feeling collaborative.&lt;/p&gt;

&lt;p&gt;What Actually Improved After Adding Memory&lt;/p&gt;

&lt;p&gt;The clearest improvement wasn’t recipe quality.&lt;/p&gt;

&lt;p&gt;It was behavioral consistency.&lt;/p&gt;

&lt;p&gt;Without memory:&lt;/p&gt;

&lt;p&gt;recommendations felt generic,&lt;br&gt;
health rules were forgotten,&lt;br&gt;
and repeated context had to be re-entered constantly.&lt;/p&gt;

&lt;p&gt;With memory:&lt;/p&gt;

&lt;p&gt;reflux-safe meals persisted,&lt;br&gt;
ingredient dislikes stayed enforced,&lt;br&gt;
and recommendations adapted over time.&lt;/p&gt;

&lt;p&gt;Interaction 1 felt like a chatbot.&lt;/p&gt;

&lt;p&gt;Interaction 20 felt much more like a constrained assistant with continuity.&lt;/p&gt;

&lt;p&gt;That gap ended up being the most convincing part of the system.&lt;/p&gt;

&lt;p&gt;Things I’d Improve Next&lt;/p&gt;

&lt;p&gt;A few areas still need work:&lt;/p&gt;

&lt;p&gt;stronger inventory normalization,&lt;br&gt;
confidence decay for stale preferences,&lt;br&gt;
multi-user conflict resolution,&lt;br&gt;
and better verifier parsing for ambiguous ingredients.&lt;/p&gt;

&lt;p&gt;I also want to experiment with local models for low-cost background memory reflection.&lt;/p&gt;

&lt;p&gt;Final Thought&lt;/p&gt;

&lt;p&gt;The most useful change wasn’t making the agent smarter.&lt;/p&gt;

&lt;p&gt;It was making the agent more constrained.&lt;/p&gt;

&lt;p&gt;Once memory, routing, and verification worked together, the system stopped behaving like a generic assistant and started behaving more like software with accountability.&lt;/p&gt;

&lt;p&gt;That distinction matters more than I expected.&lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;p&gt;Hindsight: Hindsight GitHub&lt;br&gt;
cascadeflow: cascadeflow GitHub&lt;/p&gt;

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