NewsMacroBuilding Self-Evolving AI Agents with OpenSpace: Skills, MCP, Lineage, and Low-Cost Reuse

Building Self-Evolving AI Agents with OpenSpace: Skills, MCP, Lineage, and Low-Cost Reuse

Author: MarkTechPost·

Key Takeaways

  • OpenSpace is an open-source HKUDS framework designed to let AI agents build, persist, reuse, and evolve skills across tasks.
  • The tutorial covers environment setup, sparse repository cloning, editable installation, credential configuration, and workspace preparation in Google Colab.
  • OpenSpace stores evolved capabilities in SQLite with metadata such as versioning, quality information, origin type, and lineage records.
  • A related payroll task and a custom CSV-analysis skill demonstrate how agents can reuse or derive capabilities from earlier work.
  • The streamable HTTP MCP server exposes OpenSpace skills through a standardized interface for MCP-compatible external agent clients.
Building Self-Evolving AI Agents with OpenSpace: Skills, MCP, Lineage, and Low-Cost Reuse

This tutorial walks through building and examining an OpenSpace workflow—from environment setup and sparse repository cloning to live task execution, skill evolution, and MCP-based agent integration. OpenSpace, developed by the HKUDS research group, is an open-source framework that lets AI agents build, store, and reuse their own capabilities across tasks—addressing a key limitation of today's agent systems, which typically start fresh on each interaction and incur repeated LLM costs. The process covers configuring model credentials and workspace variables, installing the project in editable mode, invoking the asynchronous Python API, and inspecting how OpenSpace stores evolved capabilities in SQLite with versioning and lineage metadata. Additional steps include creating a custom SKILL.md, connecting host-agent skills, testing warm-task reuse, launching the streamable HTTP MCP server, and analyzing the showcase evolution database to understand how FIX, DERIVED, and CAPTURED skills enable lower-cost, reusable agent behavior.

Environment Setup

First, the Python runtime is verified, required API credentials are defined, and the OpenSpace model along with optional cloud access settings are configured. The repository is cloned using sparse checkout, the package is installed in editable mode, and the availability of OpenSpace command-line tools is confirmed. Workspace and skill directories are then created, environment configuration files are written, required variables are exported, and the system detects whether live LLM execution is enabled.

Task Execution and Skill Evolution

Asynchronous execution is initialized in Google Colab, and a reusable function is defined to submit tasks via the OpenSpace Python API. An initial payroll-generation task is executed, followed by inspection of any skills OpenSpace evolves during post-execution analysis. The SQLite database structure is examined, stored records are displayed, and the skill registry and type definitions are verified as programmatically accessible.

A related payroll task is then submitted to observe how OpenSpace reuses or derives capabilities from previously generated skills—a design that can reduce repeated LLM calls and their associated cost and latency rather than solving the same problem from scratch each time. A custom SKILL.md is created to instruct the agent to analyze CSV files and produce structured Markdown reports. OpenSpace host skills are installed, a demonstration dataset is generated, and the custom capability is executed through the same evolving agent workflow.

MCP Server Integration

The OpenSpace MCP server is started using the streamable HTTP transport and bound to a local Colab endpoint. MCP (Model Context Protocol), introduced by Anthropic as an open standard for connecting AI models to external tools and data sources, gives OpenSpace skills a standardized interface that any MCP-compatible agent client can consume. The endpoint is probed to confirm the server process is running, even when a basic HTTP request returns an MCP-specific response status. An example MCP host configuration is generated, enabling external agents to access the OpenSpace workspace and skill directories.

When a valid cloud API key is available, the custom skill is conditionally uploaded to the OpenSpace cloud community. The repository's showcase SQLite database is inspected to study stored skills, metadata, quality information, and complete evolution lineage. Finally, skills are aggregated by origin type.

Conclusion

The tutorial establishes a practical OpenSpace environment demonstrating how agent capabilities are executed, persisted, reused, and progressively improved. By working directly with the Python API, local skill directories, SQLite-backed registries, MCP transports, and optional cloud skill-sharing commands, the process provides visibility into both the user-facing workflow and the underlying skill-engine architecture. Related tasks can reuse previously evolved knowledge, custom skills become discoverable at runtime, and lineage records expose the development history of each capability—offering a strong foundation for building self-evolving, cost-efficient agent systems in Colab. As the framework and its community skill-sharing ecosystem mature, the growing library of pre-evolved, reusable capabilities will be a key factor to monitor for teams evaluating agent platforms.

The full code for this tutorial is available here. The OpenSpace project repository is available on GitHub.