Elasticsearch:交易搜索 - AI Agent builder

在之前的文章中,我们使用 MCP 来查询我们的交易。在今天的文章中,我们把之前的 MCP tools 集成到 AI builder 中,并使这些 tools 能被 AI builder 所使用。在今天的练习中,我们接着之前的文章来进行。以下的演示是在最新的 Elastic Stack 9.3 上进行的。

运行 MCP 服务器

我们按照如下的方式来运行我们的 MCP 服务器:

复制代码
fastmcp run src/server/server.py:mcp --transport http --port 9000

如上所示,我们的 MCP 服务器运行于 http://localhost:9000 端口。

导入 MCP 所提供的 tools

我们可以安装入下的方式来导入 MCP 所提供的 tools:

如果我们的 MCP 服务器地址有错误,那么就会弹出错误的信息。我们在完成正确的配置后,点击上面的 Bulk import MCP Tools

这样我们就可以发现我们已经导入的 3 个 tools:

创建 agents

我们接下来创建一个叫做 transactions 的 agent:

我们的 transactions agent 配置如下:

复制代码
You are a helpful banking transaction agent. You help users search and analyze their banking transactions.

Current date: {current_date}

When users ask about transactions, use the appropriate tools:
- Use trans-search for finding specific transactions

For date references:
- "last month" = past 30 days from today
- "this month" = current month from 1st to today
- "last week" = past 7 days
- "this year" = January 1st of current year to today

By default set the make the to date today and the from date 1 year ago
Common categories: groceries, dining, gas, shopping, entertainment, utilities, healthcare, transportation, travel, subscriptions, insurance, phone, internet

使用 transactions agent

我们接下来使用刚创建的 agent:

复制代码
Find all Amazon purchases between $20 and $50
复制代码
Find all transactions over $100 in San Francisco
复制代码
显示我所有加油站购买记录
相关推荐
云烟成雨TD20 小时前
Spring AI Alibaba 1.x 系列【64】 ReactAgent 长期记忆
java·人工智能·spring
道可云20 小时前
道可云荣登半导体AI智能体应用第一梯队,打造研发全链路新范式
人工智能·半导体
w_t_y_y20 小时前
知识体系——MCP(四)自定义mcp server和client
人工智能
山川湖海20 小时前
AI时代快速学编程语言的陷阱(以Python为例)
大数据·人工智能·python
悟乙己21 小时前
因果机器学习DML效果与应用场景探索
人工智能·机器学习
z小猫不吃鱼21 小时前
13 Scaling Law 入门:模型规模、数据规模和计算量是什么关系?
人工智能·深度学习·机器学习
一叶清辉21 小时前
CS336 Assignment 1 BPE分词器训练初版(朴素版基础上优化)及后续优化方向分析
人工智能
七牛开发者21 小时前
如何从零开发一个工业级的 SKILL
人工智能·程序员·agent
瘦瘦瘦大人21 小时前
豆包与抖音联动创作新手实战指南
人工智能
三无推导21 小时前
ComfyUI 安装部署教程:Windows 下快速搭建可视化 AI 绘图工作流,零基础也能跑通
人工智能·pytorch·windows·stable diffusion·aigc·ai绘画·持续部署