Inspiration

LLMs are powerful, but they are mostly stateless. In normal use, they forget previous user preferences after a session. Basic memory systems also have another problem: they may store everything forever, including outdated or contradictory information.

Memora was built to explore a more realistic memory agent: one that remembers useful information, forgets stale memories, and updates old beliefs when the user gives new conflicting information.

What it does

Memora is a self-managing memory agent for LLMs. It can:

  • Store persistent user memories
  • Detect contradictions between old and new information
  • Update outdated memories instead of keeping conflicting facts
  • Forget stale or low-importance memories through decay
  • Retrieve relevant memories using vector search and Qwen reranking
  • Keep memories separated by user ID

For example, if the system remembers “User is a photographer” and the user later says “I am not a photographer anymore; I now work as a video editor,” Memora updates the memory instead of blindly storing both.

How I built it

I built Memora with a FastAPI backend, Streamlit frontend, ChromaDB vector storage, and Qwen Cloud models. The backend handles memory extraction, conflict resolution, retrieval, decay, and response generation.

The system uses Qwen for reasoning, text-embedding-v4 for embeddings, and qwen3-rerank for improving retrieval quality. I also deployed the backend using Docker on Alibaba Cloud ECS.

Challenges I faced

The hardest part was making memory behavior reliable instead of just storing chat history. I had to handle conflict detection, duplicate memories, stale memories, and safe deletion. During development, I also fixed issues related to reranking fallback, recency tracking, adaptive conflict checks, API error handling, Docker deployment, and cloud networking.

Accomplishments

Memora was evaluated against a naive append-only memory baseline. On clear memory scenarios, Memora achieved 18/18, while the naive baseline achieved 6/18. This shows that the system is not only a UI demo, but also has measured memory behavior.

What I learned

I learned how to build a full AI agent pipeline using Qwen Cloud, vector search, reranking, memory management, FastAPI, Streamlit, Docker, and Alibaba Cloud deployment. I also learned that reliable memory agents need more than retrieval — they need conflict resolution, decay, and careful evaluation.

What's next

Future improvements include better handling of ambiguous cases, memory summarization instead of hard deletion, richer UI controls, and more advanced long-term memory policies.

Built With

  • alibaba-cloud-ecs
  • chromadb
  • dashscope-api
  • docker
  • fastapi
  • python
  • qwen-cloud
  • qwen-plus-latest
  • qwen3-rerank
  • streamlit
  • text-embedding-v4
Share this project:

Updates