<?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: Muhammad Awais</title>
    <description>The latest articles on DEV Community by Muhammad Awais (@imawais).</description>
    <link>https://dev.to/imawais</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%2F2803387%2Fc79b25f7-67b9-4c74-aa55-a2ad3033047c.png</url>
      <title>DEV Community: Muhammad Awais</title>
      <link>https://dev.to/imawais</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/imawais"/>
    <language>en</language>
    <item>
      <title>Memoria – A Self‑Evolving Personal AI with Human‑like Memory</title>
      <dc:creator>Muhammad Awais</dc:creator>
      <pubDate>Sat, 18 Jul 2026 15:22:47 +0000</pubDate>
      <link>https://dev.to/imawais/memoria-a-self-evolving-personal-ai-with-human-like-memory-34p</link>
      <guid>https://dev.to/imawais/memoria-a-self-evolving-personal-ai-with-human-like-memory-34p</guid>
      <description>&lt;p&gt;Most AI assistants forget everything after each session. Memoria remembers, forgets, and evolves—extracting personal facts, resolving contradictions, and reflecting on what it knows. This post shares the journey of building a production‑ready MemoryAgent for the &lt;strong&gt;Qwen Cloud Hackathon, Track 1&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Inspiration
&lt;/h2&gt;

&lt;p&gt;Every conversation with a typical chatbot starts from zero. You tell it you're allergic to peanuts on Monday, and by Wednesday it recommends pad thai with crushed peanuts. The model doesn't forget; it never had long‑term memory in the first place. Without durable knowledge about who you are, real personalisation is impossible.&lt;/p&gt;

&lt;p&gt;We built &lt;strong&gt;Memoria&lt;/strong&gt; to solve that problem: a personal AI with human‑like memory that remembers what matters, forgets what fades, resolves contradictions, and evolves its understanding of you over time. Real memory isn't a bigger context window—it's extraction, prioritisation, decay, consolidation, and reflection. The hackathon challenged us to deliver a memory‑efficient, production‑grade MemoryAgent, and we built one from the ground up on Alibaba Cloud.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Memoria does
&lt;/h2&gt;

&lt;p&gt;Memoria organises knowledge in three deliberate tiers:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Session Memory&lt;/strong&gt; (Redis) – the last 10 messages of the active chat.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personal Memory&lt;/strong&gt; (PostgreSQL 16 + pgvector) – user‑centric facts embedded with &lt;code&gt;text-embedding-v3&lt;/code&gt;, ranked by hybrid scoring, and subject to decay, consolidation, and conflict resolution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Context Archive&lt;/strong&gt; – full transcripts stored for on‑demand search, never polluting routine retrieval.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Other key features:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Autonomous memory lifecycle&lt;/strong&gt;: daily decay, weekly consolidation, and background reflection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personal Intelligence toggle&lt;/strong&gt;: global memory access vs. session‑only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Memory‑Less incognito mode&lt;/strong&gt;: no memory reads or writes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;MCP skills server&lt;/strong&gt;: exposes &lt;code&gt;get_core_memories&lt;/code&gt;, &lt;code&gt;get_user_preferences&lt;/code&gt;, &lt;code&gt;forget_memory&lt;/code&gt;, and &lt;code&gt;strengthen_memory&lt;/code&gt; to any Qwen agent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflict detection &amp;amp; versioning&lt;/strong&gt;: contradictory facts are automatically flagged and superseded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Persona customisation&lt;/strong&gt;: users set response length, tone, and behaviour.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Benchmark‑proven 77.6 % improvement&lt;/strong&gt; in decision accuracy across 12 realistic scenarios.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live deployment on Alibaba Cloud ECS&lt;/strong&gt; with ApsaraDB for PostgreSQL and Redis, provisioned via Terraform.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How we built it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Backend&lt;/strong&gt;: Python FastAPI, SQLAlchemy async, PostgreSQL 16 + pgvector for hybrid vector search.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Memory pipeline&lt;/strong&gt;: DashScope – Qwen‑Plus for chat/extraction/conflict/reflection, Qwen‑Max for consolidation, &lt;code&gt;text-embedding-v3&lt;/code&gt; for embeddings.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Background workers&lt;/strong&gt;: Celery handles memory ingestion, decay, and consolidation with Redis as the broker.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Frontend&lt;/strong&gt;: React + Vite, &lt;code&gt;react-markdown&lt;/code&gt;, &lt;code&gt;remark‑math&lt;/code&gt;, &lt;code&gt;rehype‑katex&lt;/code&gt;, custom dark theme.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Deployment&lt;/strong&gt;: Docker Compose, Terraform for Alibaba Cloud (ECS, ApsaraDB, Redis), Let's Encrypt via Nginx.&lt;/p&gt;

&lt;h2&gt;
  
  
  Challenges we ran into
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Embedding dimension mismatch&lt;/strong&gt; (1536 → 1024) – fixed with an Alembic migration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DashScope international endpoint&lt;/strong&gt; – defaulted to Beijing, required explicit config.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Model availability&lt;/strong&gt; – &lt;code&gt;qwen3-plus&lt;/code&gt; not accessible; standardised on &lt;code&gt;qwen-plus&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Markdown + LaTeX rendering&lt;/strong&gt; – needed multiple plugins and preprocessing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Performance with conflict detection and reflection&lt;/strong&gt; – kept latency low by running them asynchronously in Celery.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Human‑like memory is harder than simple RAG&lt;/strong&gt; – it needs importance, decay, consolidation, and conflict resolution.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qwen's tool‑calling and structured JSON output&lt;/strong&gt; make LLM pipelines reliable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;UX (PI toggle, Memory‑Less) matters as much as algorithms&lt;/strong&gt; – users must trust the memory.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real‑infrastructure testing catches subtle bugs&lt;/strong&gt; – always deploy early.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Voice input, multi‑agent collaboration via MCP, a mobile companion, advanced memory visualisations, and fine‑tuning Qwen on memory tasks.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Try it yourself:&lt;/strong&gt; &lt;a href="https://memoria.imawais.engineer" rel="noopener noreferrer"&gt;https://memoria.imawais.engineer&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/imawais-engineer/Memoria" rel="noopener noreferrer"&gt;imawais-engineer/Memoria&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built with ❤️ on &lt;strong&gt;Alibaba Cloud&lt;/strong&gt; and &lt;strong&gt;Qwen Cloud&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>qwen</category>
      <category>alibabacloud</category>
      <category>ai</category>
      <category>hackathon</category>
    </item>
  </channel>
</rss>
