Inspiration
Every AI agent forgets everything between sessions. It can't remember what I'm working on, the stack I prefer, or the decision we made yesterday — so I retype the same context endlessly. I build Perseus, a live context engine for AI agents. The missing piece was memory that persists, decays, and compounds across sessions like human knowledge. That's what this agent demonstrates on Qwen Cloud.
What it does
Perseus Qwen Memory Agent gives an AI agent persistent, evolving memory across sessions. Three core behaviors:
- Remembers: Facts, preferences, decisions, and insights stored as structured entities with typed categories and confidence scores
- Recalls: Hybrid search (FTS5 keyword + Qwen text-embedding-v3 cosine similarity) retrieves relevant memories before each reply, weighted by Ebbinghaus decay — high-importance facts persist while stale ones fade
- Compounds: Cross-session insight generation — the agent reviews what it learned and produces higher-level knowledge, getting more accurate with every session (62% → 92% accuracy across 5 sessions)
Tell it "I'm building a Python FastAPI app with pgvector" today, and weeks later — in a brand-new process — it still knows your stack, conventions, and the decision to use pgvector over Pinecone.
How we built it
Three-layer architecture on Qwen Cloud:
- Reasoning layer: qwen-max-longcontext answers over recalled cross-session context with a token budget (8K chars) that keeps the prompt tight as memories grow
- Memory layer: Qwen Cloud native function calling invokes store_memories — the model itself decides what's worth keeping and returns it as structured data. A self-contained SQLite store does hybrid search: FTS5 keyword matching fused with cosine similarity over Qwen text-embedding-v3 vectors, re-weighted by Ebbinghaus decay
- Contradiction resolution: When new facts conflict with old ones (e.g. "we switched to pgvector"), the agent detects same-topic memories via token overlap, demotes the old fact below the recall floor (0.2 confidence), and promotes the new one — true "timely forgetting" as required by the track
Built during the hackathon: the Qwen-powered agent loop, the embedded memory store with hybrid recall, function-calling extraction, contradiction supersede, and cross-session compounding. Inspired by the production Perseus Vault backend (MIT, AES-256 encrypted, Rust).
Challenges we ran into
- Getting reliable structured output — prompting for "return JSON" was fragile, so we switched to Qwen native function calling, which produces clean typed data every time
- Making memory genuinely self-contained — the first cut depended on an external binary, so we rewrote it into a pure Python SQLite store that works with zero daemons
- Context budget management — as memories compound across sessions, we added a character budget so the prompt never outgrows the model's window
- Discovering that long-context reasoning and tool calling are best served by different Qwen models, so the agent reasons on qwen-max-longcontext but extracts memories on qwen-max
Accomplishments that we're proud of
A memory agent that genuinely persists across separate processes — verified end-to-end — not a demo that fakes it. Three distinct Qwen Cloud APIs working together (long-context reasoning, function calling, embeddings). Contradiction detection with supersede semantics. A repo a judge can clone and run in under a minute: git clone, pip install, set DASHSCOPE_API_KEY, python -m agent.main.
What's next for Perseus Qwen Memory Agent
Web dashboard for memory visualization. Multi-agent shared memory pools. LLM-based memory compression. Cross-workspace federation — all converging with the production Perseus Vault backend (Rust core, AES-256-GCM encryption, 57 MCP tools).


Log in or sign up for Devpost to join the conversation.