Skip to main content
Back

HKU's OpenSpace Teaches AI Agents to Remember, Cutting Token Costs 46%

OpenSpace gives any AI agent a memory that compounds — slashing token costs by 46% while multiplying output quality across professional tasks

Pro

Repo, Full Access
  • OpenSpace is an open-source self-evolving skill engine from HKU that plugs into any MCP-compatible agent (Claude Code, Codex, Cursor, etc.).
  • Skills automatically FIX themselves when broken, DERIVE new versions from successes, and CAPTURE novel patterns from task executions.
  • On the GDPVal benchmark, OpenSpace agents earned 4.2x more income and used 46% fewer tokens vs a baseline agent using the same LLM.
  • A cloud skill community at open-space.cloud lets agents share evolved skills across teams with public/private/group access controls.
  • The framework evolved 165 skills autonomously across 50 professional tasks — mostly error-recovery and execution-reliability patterns, not domain knowledge.
  • Free and MIT-licensed on GitHub; cloud features require a free API key registration.

Traditional AI agents operate as stateless tools, re-reasoning from scratch for every new task, which leads to high token costs and inconsistent performance. Every time you fire up Claude Code or Codex on a new project, it has no memory of the last time it solved the same class of problem. It burns tokens rediscovering what it already knew. OpenSpace shifts this paradigm by implementing a self-evolution loop that captures, repairs, and reuses skills, addressing the economic inefficiency of LLM-based automation where costs often scale linearly with task complexity.

OpenSpace by HKUDS (University of Hong Kong) is an open-source self-evolving skill engine that empowers AI agents to automatically learn, reuse, and optimize skills from every task, making automation smarter and significantly more token-efficient. It plugs into your existing agent stack via MCP (Model Context Protocol , the standard interface for connecting agents to external tools) and adds a compounding memory layer that persists and improves across runs. The framework was open-sourced and has rapidly gained traction in the AI agent community.

The Stateless Agent Tax

The problem OpenSpace targets is real and expensive. Every LLM call costs money, and today's agents pay a "stateless tax" , they re-derive solutions they've already found, re-encounter errors they've already fixed, and re-build pipelines they've already assembled. The 165 skills OpenSpace evolved autonomously tell a story about where agent intelligence actually lives. It's not in the model weights. It's in the accumulated knowledge of what breaks, what works around those breaks, and how to verify the output , and that's the kind of learning that compounds.

Memory has become a first-class architectural primitive in 2026, not an afterthought bolted onto a vector database. OpenSpace is a direct answer to that need , not through fine-tuning or RAG over documents, but through a living library of executable skills that get better with every task.

Three Ways Skills Evolve

The core of OpenSpace is its skill engine. Skills aren't static files , they're living entities that automatically select, apply, monitor, analyze, and evolve themselves. Full lifecycle management runs from discovery to application to evolution, all without human intervention. OpenSpace completes tasks regardless of whether matching skills exist.

When a task runs, the engine can trigger one of three evolution modes:

  • FIX , When a skill breaks (an API changed, a dependency updated), the engine auto-repairs it in place. Same skill, new version.
  • DERIVED , When a task succeeds, the winning pattern gets distilled into an enhanced or specialized version of an existing skill. New skill directory, coexists with its parent.
  • CAPTURED , When the agent discovers a novel workflow with no prior skill, it extracts and stores it as a brand-new reusable skill for future tasks.

Evolution isn't triggered once per session , it runs on three independent tracks: post-execution analysis after every task, tool degradation detection when success rates drop, and a periodic metric monitor that scans skill health (applied rate, completion rate, fallback rate) and evolves underperformers. OpenSpace gathers real evidence before making changes, produces minimal targeted diffs rather than full rewrites, and includes built-in safeguards: confirmation gates reduce false-positive triggers, anti-loop guards prevent runaway cycles, safety checks flag dangerous patterns like prompt injection and credential exfiltration, and evolved skills are validated before replacing predecessors.

GDPVal benchmark KPIs showing OpenSpace 4.2x income multiplier and 46% token savings vs ClawWork

Benchmarked Against Real Work

The team evaluated OpenSpace on GDPVal , OpenAI's benchmark of professional knowledge work. The GDPVal full set includes 1,320 specialized tasks, each crafted and vetted by experienced professionals with over 14 years of experience on average. Every task is based on real work products, such as a legal brief, an engineering blueprint, a customer support conversation, or a nursing care plan.

OpenSpace ran 50 of those tasks in two phases. Phase 1 (Cold Start) executes all 50 tasks sequentially while skills accumulate. Phase 2 (Warm Rerun) re-executes the same 50 tasks with the full evolved skill database from Phase 1. The same backbone LLM (Qwen 3.5-Plus) was used for both OpenSpace and the baseline agent, so performance differences come purely from skill evolution, not model capability.

The results:

  • 4.2x higher income vs the baseline agent on the same tasks
  • $11,484 earned out of $15,764 in total task value (72.8% capture rate)
  • 70.8% average quality , 30 percentage points above the best baseline agent (40.8%)
  • 46% fewer tokens in Phase 2 vs Phase 1 , the agent gets cheaper as it gets smarter

The tasks weren't toy problems. They included building payroll calculators from union contracts, preparing tax returns from 15 scattered PDFs, drafting legal memoranda on California privacy regulations, and creating compliance forms and engineering specifications.

Comparison table of quality scores and token efficiency across multiple AI agents including OpenSpace phases vs ClawWork

What the Agent Actually Learned

Across those 50 tasks, OpenSpace autonomously evolved 165 skills. The breakdown is revealing:

  • 44 File Format I/O skills , PDF extraction fallbacks, DOCX parsing, Excel merged-cell handling. 32 of 44 were captured from real failures.
  • 29 Execution Recovery skills , Layered fallbacks: sandbox fails → shell → file-write-then-run → heredoc. 28 of 29 came from actual crashes.
  • 26 Document Generation skills , One imported skill evolved into 13 derived versions through iteration.
  • 23 Quality Assurance skills , Post-write verification: check Excel row counts, validate PDF pages, proof-gate spreadsheet formulas.
  • 17 Task Orchestration skills , Multi-file tracking, ZIP packaging, zero-iteration failure detection.
  • 13 Domain Workflow skills , Audio production pipelines, SOAP notes, video workflows.

The pattern here is important: a significant portion of evolved skills (29 out of 165 in GDPVal) focuses on execution recovery, highlighting the importance of error-handling patterns. The agent isn't primarily learning domain knowledge , it's learning how to reliably execute in a messy, real-world environment where tools break, APIs drift, and sandboxes crash.

Collective Intelligence via the Cloud

Collective intelligence is OpenSpace's second major pillar: one agent's hard-won lesson becomes every agent's advantage. Through the open-space.cloud community, evolved skills can be shared with granular access controls for public, private, or team-only visibility.

Users can manage these capabilities through a local SQLite database or share evolved intelligence via the open-space.cloud community. The cloud layer is optional , all local capabilities work without an API key , but it's where the network effects kick in. More agents running tasks means more skills evolved, which means every connected agent gets smarter faster.

Two Ways to Use It

OpenSpace works with any agent supporting skills: Claude Code, Codex, OpenClaw, nanobot, Cursor, and more. Two integration paths exist: Path A plugs OpenSpace into your agent's MCP config, while Path B uses OpenSpace directly as a standalone AI co-worker.

Path A (plugging into an existing agent) takes three steps:

  1. Clone the repo and run pip install -e .
  2. Add openspace-mcp as an MCP server in your agent's config
  3. Copy two skill files (delegate-task and skill-discovery) into your agent's skills directory

For Path B (standalone), you can run tasks directly from the CLI or Python API:

import asyncio
from openspace import OpenSpace
async def main():
    async with OpenSpace() as cs:
        result = await cs.execute("Analyze GitHub trending repos and create a report")
        for skill in result.get("evolved_skills", []):
            print(f"  Evolved: {skill['name']} ({skill['origin']})")
asyncio.run(main())

The framework also includes a local dashboard for browsing skills, tracking lineage, and comparing diffs , built with React and served via a local Node.js server. You can inspect the full evolution history of every skill, see which version replaced which, and understand exactly why a skill was modified.

OpenSpace Skills evolution graph showing 28 total versions with lineage connections between skill nodes

The Bigger Picture

OpenSpace's real bet is that the value of an AI agent isn't just in the model it runs , it's in the accumulated operational knowledge it carries. OpenSpace evolves skills within a structured framework. The agent gets smarter without modifying its own architecture. That's a meaningful distinction: this isn't self-modifying code or weight updates. It's a structured, auditable, version-controlled library of executable patterns that grows with use.

The showcase that makes this concrete: zero human code was written. 60+ skills evolved from scratch to build a fully working live dashboard , an always-on system streaming processes, servers, news, markets, email, and schedules with a built-in AI agent. The entire codebase was generated and evolved autonomously by OpenSpace from a reference project. The full evolution history is open-sourced in a SQLite database you can inspect yourself.

The framework is MIT-licensed, free to use, and available now on GitHub. Cloud community features require a free API key from open-space.cloud. The assumption it challenges is simple but significant: that the cost of running agents is fixed by the model. With OpenSpace, every task makes the next one cheaper.