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
复制代码
显示我所有加油站购买记录
相关推荐
白色机械键盘9 小时前
领域大模型微调数据集构建实战
大数据·人工智能
极客互动API9 小时前
企业微信 iPad 协议服务搭建与 AI 回调实战
网络·汇编·人工智能·微信·企业微信·ipad
空堂与归9 小时前
token畅享?FreeToken单卡5090跑满血DeepSeek_V4Flash
人工智能·free token
AI码农小姐姐9 小时前
AI漫剧用什么软件制作?知漫剧小说导入成片教程
人工智能
ycjunhua9 小时前
Spring AI 2.0 GA:ToolCallingAdvisor 重构与 Java Agent 新范式
java·人工智能·spring
二川bro10 小时前
零门槛上手DeepSeek Harness,从零自制arxiv搜索插件
人工智能
cxr82810 小时前
数学的本质:关系、模式与不变量的结构世界
人工智能·算法·机器学习
东莞和裕包装10 小时前
如何管控广州定制纸箱生产中的啤切精度与印刷色差质量问题
大数据·运维·网络·人工智能
AIDANHANG10 小时前
放开靠时间戳对日志前先核请求ID跨服务传播与采样关联
前端·人工智能
牛肉胡辣汤10 小时前
手握实战经验,分享AI工程落地的踩坑与收获
人工智能