Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 5.04 KB

SPEC.md

File metadata and controls

61 lines (50 loc) · 5.04 KB

Cortex — a persistent memory layer any agent plugs into via MCP

For: Qwen Cloud Global AI Hackathon 2026 · Track: MemoryAgent · Deadline: July 20, 2026, 2:00pm PDT Prize target: $7,000 cash + $3,000 cloud credits (track win)

The problem

AI agents forget everything between sessions. Every conversation starts from zero. The fix most people build is "dump all past chat into a vector DB and stuff it into the prompt" — which doesn't scale, never forgets noise, and isn't reusable across agents.

What Cortex is

An MCP server that gives ANY agent a self-curating long-term memory. It:

  1. Decides what's worth remembering — a Qwen3 agent extracts durable facts/preferences/decisions from each interaction (ignores small talk).
  2. Stores with a salience + decay score — embeddings + a forgetting curve, so stale one-off details fade while important facts persist.
  3. Retrieves only what matters — semantic similarity × recency-decay × salience, top-k into the prompt.
  4. Is reusable infrastructure — because it's an MCP server, the same memory plugs into a chat assistant, a coding assistant, anything.

Why it's different (honest positioning)

Agent memory is crowded (Mem0, Zep, Letta/MemGPT). Cortex does NOT compete on "we store memories." Its wedge is what incumbents under-serve:

  • Active, salience-scaled forgetting — context stays lean and self-prunes; stale memories actually leave (most systems only grow). Proven by eval.py (89% footprint shrink, 0 important lost).
  • Transparency & governance — memory you can see, audit, edit, and delete (the live memory-graph UI). The open gap for enterprise/regulated + consumer-trust use.
  • MCP-native — a drop-in memory primitive any agent inherits, no SDK lock-in.

Positioning line: transparent, self-pruning memory — the agent memory you can audit, and that doesn't bloat.

The demo (≤3 min)

Across 3 sessions days apart, a generic assistant wired to Cortex:

  • S1: learns the user is vegan + nut-allergic + prefers terse answers.
  • S2: proactively avoids a recommendation that conflicts.
  • S3: weeks of "noise" later, still recalls the allergy but has forgotten a throwaway detail.
  • Live memory-graph panel visualizes writes / retrievals / scores / forgets in real time.
  • Closer: swap Cortex onto a different agent (a coding assistant) — the memory carries over. Proof it's infra, not an app.

Why it wins (maps to the rubric)

  • Innovation 30% — it is an MCP integration + the remember/forget policy is a custom skill (the two things the rubric names by hand).
  • Tech Depth 30% — standalone MCP server + memory engine (extract → score → decay → rerank), modular, reusable.
  • Impact 25% — universal pain; shipped as open-source MCP infra → maxes "scalable to community."
  • Presentation 15% — the memory-graph panel literally "visualizes the key logic" (their phrase); cross-agent swap is the money shot.

Architecture

  • Backend (Python / FastAPI): cortex/ package — memory_engine.py (extract/score/decay/retrieve), qwen_client.py (DashScope OpenAI-compatible), mcp_server.py (FastMCP: remember, recall tools), main.py (multi-tenant REST API: /remember /recall /chat /memories /audit).
  • Frontend: web/index.html — a single-page, dependency-free HTML/CSS/JS live memory-graph UI (writes/retrievals/decay/forgets rendered in real time, multi-agent swap, audit drawer, memory inspector). Shipped; no separate Next.js app.
  • Store: shared persistent JSON store (store.py) so the MCP server + REST clients + multiple agents see the same memories (what makes the cross-agent swap real, not simulated).
  • Deploy: Alibaba Cloud (mandatory pass/fail gate — deploy early, capture proof link).

Build plan (~17 days, solo)

  1. D1–2: DashScope key + $40 voucher; port LLM calls to Qwen (OpenAI-compatible); deploy a hello-world to Alibaba Cloud to prove the gate early.
  2. D3–5: memory engine — extraction, embeddings, salience+decay, retrieve/rerank, forget. ✅ (skeleton in repo)
  3. D6–7: MCP server exposing remember/recall; shared persistent store.
  4. D8–10: web/index.html chat client + live memory-graph panel. ✅ (shipped)
  5. D11–12: wire a 2nd agent (coding assistant) to the same Cortex for the swap demo.
  6. D13–14: scripted 3-session demo data + polish UX.
  7. D15: deploy final to Alibaba Cloud; README + architecture diagram.
  8. D16: record ≤3-min demo (lead with cross-agent swap).
  9. D17: Devpost submission (video + repo + slides + description) buffer.

Scope cuts (in order, if time runs short)

  1. Pre-record the cross-agent swap instead of live.
  2. Memory-graph → simpler real-time "memory ledger" table (still "visualizes key logic").
  3. Cut S2 proactive-avoidance; keep S3 forget-vs-recall (the non-negotiable core).

Minimum winning core

MCP server + Qwen-driven remember/forget engine + one client showing recall-after-noise and forgetting, deployed on Alibaba Cloud, with a logic-visualizing demo.