
为AI交易代理提供决策审计轨迹+持久内存。结果加权召回,带有RFC 3161锚定的防篡改SHA-256链,20个MCP工具。
概览
它每次都会犯同样的错误。它无法解释为什么会交易。当上下文窗口结束时,它会忘记一切。与此同时,MiFID II正在提高算法决策文档的标准(第17条)。欧盟人工智能法案要求系统性记录人工智能行为(第14条)。你的竞争对手代理人正在从每一笔交易中学习。 AI交易栈缺少一层。每个MCP服务器都负责执行——下单、获取价格、阅读图表。 你的代理人可以买入100股AAPL,但无法回答:“上次我买AAPL时情况是怎么回事?” 只需安装一次PIP,您的AI代理就能记住每笔交易、每一个结果、每一个错误——并配备SHA-256防篡改审计追踪。 交易员在每个持仓前运行预检清单,EA系统每天记录数千个决策,均用于生产环境。 - 问问你的记忆——上次在这种市场条件下发生了什么?结果如何?
概述(AI 翻译)
入门指南 |用例 |API 参考 |OWM 框架 |局限性 |中文版
TradeMemory 会记住它所花费的代价。 它是 AI 交易代理的开源、本地优先的内存和刹车:它会拉取你的填充,查找你自己的历史亏损处,在下一个订单前将亏损的交易放在代理人面前,并且可以在订单到达经纪商之前拒绝违反规则的订单。
经纪商现在允许AI代理通过MCP进行交易,但有不同的限制:Webull和tastytrade设定了购买力上限,Interactive Brokers只允许代理为你起草订单,Robinhood和Public则不允许对外部代理施加上限(StockBrokers,2026-09-30)。上限是固定的数字。它们都不会考虑你过去的交易情况。
从你自己的历史开始
每笔已关闭的交易只存储一次;再次运行只存储新交易。然后打印你的历史亏损位置。格式,配有示例数字:
这些是你过去交易的描述性统计数据,不是对下一笔交易的建议。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
TradeMemory remembers what it cost. It is an open-source, local-first memory and brake for AI trading agents: it pulls in your fills, finds where your own history loses money, puts those losing trades in front of your agent before the next order, and can refuse an order that breaks rules you set, before it reaches the broker.
Brokers now let AI agents trade over MCP, with different guardrails: Webull and tastytrade set size or buying-power limits, Interactive Brokers only lets the agent draft an order for you to submit, and Robinhood and Public set no cap you can impose on an external agent (StockBrokers, 2026-09-30). The caps are fixed numbers. None of them looks at how your own past trades went.
Start with your own history
pip install tradememory-protocol
# Hyperliquid: public fills, no key needed
tradememory sync hyperliquid --address 0xYourAddress
# Alpaca: read-only calls with your own keys, kept in a local file
tradememory sync alpaca --env-file ~/.secrets/alpaca.env
Each closed trade is stored in memory once; running it again stores only new trades. Then it prints where your history loses money. The format, with illustrative numbers:
After 2 losses in a row (20 trades):
5 of them (25%) were 1.5x your usual size or more.
All 20 won 60% and made -$1,500.
The 5 sized-up trades won 20% and made -$1,700.
Median hold: winners 1.5h, losers 9.0h.
These are descriptive statistics of your own past trades, not advice about the next one. Hyperliquid’s API serves only an address’s recent fills, not its whole history, so the sooner it is synced, the more history is kept. Other venues: MT5 and Binance spot sync scripts are in scripts/, and any agent can record a trade with remember_trade.
安装
uvx tradememory-protocol配置
{
"mcpServers": {
"tradememory": {
"command": "uvx",
"args": ["tradememory-protocol"]
}
}
}