「Regnexe Python 实战系列」第 6 篇共 10 篇对应仓库examples/readme/06_marketplace.py。上一篇05. 改个 Skill 文案也要重新发版with_directory 让插件目录直接生效。一个容易被忽略的架构问题很多 Agent Demo 的能力列表都是启动时手写进去的tools[get_weather,search_docs,query_order]这在 Demo 里没问题。但到了平台型应用能力可能来自不同业务线、不同租户、不同环境。你迟早会问能力到底应该存在代码里、数据库里还是配置中心里regnexe-py 的答案是Agent 不直接关心能力存在哪里它只依赖 Marketplace 接口。默认实现SimpleMarketplace示例第一部分不跑 LLM只演示市场的基本动作安装、搜索、解析。marketplaceSimpleMarketplace()marketplace.install(weather_plugin)candidatesmarketplace.search(Check todays weather in Beijing)resolvedmarketplace.resolve(weather-plugin.get_weather)当前版本的search()很简单主要是能力索引入口。以后你要按标签、关键词、向量召回优化也是在这一层做。自定义市场假装背后是一张 DB 表示例里写了一个InMemoryDbMarketplaceclassInMemoryDbMarketplace(SimpleMarketplace):def__init__(self)-None:super().__init__()self.table:dict[str,PluginDescriptor]{}definstall(self,plugin:PluginDescriptor)-None:self.table[plugin.plugin_id]pluginsuper().install(plugin)deffind_by_tag(self,tag:str)-list[PluginDescriptor]:return[pforpinself.table.values()ifany(tagincap.tagsforcapinp.capabilities)]真实项目里table可以换成 ORM、SQL 查询、配置中心或远程能力服务。接入 Agent 不改主流程换市场时Agent 侧只改这一行agent(RegnexeAgentBuilder().with_default_model(Vendor.DEEPSEEK,deepseek-v4-flash).with_marketplace(marketplace).with_event_listener(ConsoleEventListener()).build())这就是 Marketplace 的价值能力管理怎么演进不应该让 Agent 主流程跟着重写。小结Marketplace 解决的是能力治理问题能力统一安装和查询能力 id 稳定可解析能力来源可以从内存换成数据库自定义查询方法可以服务管理后台Agent 构建逻辑不被存储细节污染一句话能力市场不是一个列表而是 Agent 应用的能力索引层。 上一篇05. 改个 Skill 文案也要重新发版with_directory 让插件目录直接生效 下一篇07. Agent 记不住上下文别再手写 history先把 session_id 设计对 项目地址https://github.com/flower-trees/regnexe-py