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
复制代码
显示我所有加油站购买记录
相关推荐
时光追逐者13 小时前
白嫖小米 MiMo 百万亿 Token,附 Claude Code 配置全流程!
ai·claude code·xiaomi
kcuwu.13 小时前
机器学习入门:线性回归完全指南(含波士顿房价预测案例)
人工智能·机器学习·线性回归
幸运的大号暖贴13 小时前
解决Vibe Coding时Idea经常不自动git add问题
java·人工智能·git·intellij-idea·claudecode·opencode
MonkeyKing_sunyuhua13 小时前
什么是服务端 VAD 端点检测
人工智能·语音识别
ascarl201013 小时前
Linux.do 帖子整理:AI 调用 Chrome DevTools 调试前端页面
linux·前端·人工智能
qxq_sunshine13 小时前
从 CNN 到 Agent:给 DL 工程师的“智能体”入门黑话指南(概念篇)
人工智能·神经网络·cnn
郝学胜-神的一滴13 小时前
反向传播:神经网络的「灵魂」修炼法则
人工智能·pytorch·深度学习·神经网络·机器学习·数据挖掘
Tutankaaa13 小时前
知识竞赛软件SaaS版 vs 本地部署
人工智能·经验分享·笔记·学习
DanCheOo13 小时前
开源 | 我是怎么用 ai-memory 让 Cursor 每次开新对话都自动知道项目背景的
前端·人工智能·ai·ai编程
好赞科技13 小时前
2026年最佳健身小程序推荐榜单,帮你解锁智能运动新体验
大数据·微信小程序