Skip to main content
Glama
TradeMemory Protocol

TradeMemory Protocol

by mnemox-ai

PyPI Tests MCP Tools Smithery License: MIT

시작하기 | 사용 사례 | API 참조 | OWM 프레임워크 | 제한 사항 | 中文版


프로젝트 상태(2026년 8월): 기능 완료, 유지보수 모드 — 버그 및 보안 보고는 계속 검토됩니다. 새로운 기능이나 호스팅 서비스는 계획되어 있지 않습니다. 유료 작업은 거래 기록 분석을 참조하세요.

당신의 트레이딩 AI는 기억상실증에 걸려 있습니다. 그리고 규제 당국이 이를 주목하기 시작했습니다.

매 세션마다 같은 실수를 반복합니다. 왜 거래했는지 설명하지 못합니다. 컨텍스트 창이 끝나면 모든 것을 잊어버립니다. 한편 MiFID II는 알고리즘 결정 문서화 기준을 높이고 있습니다(제17조). EU AI Act는 AI 행동의 체계적 로깅을 요구합니다(제14조). 경쟁사의 에이전트는 모든 거래에서 학습하고 있습니다.

AI 트레이딩 스택에는 한 계층이 빠져 있습니다. 모든 MCP 서버는 실행을 처리합니다 — 주문 체결, 가격 조회, 차트 읽기. 어느 것도 메모리를 처리하지 않습니다.

당신의 에이전트는 AAPL 100주를 매수할 수 있지만, "이 조건에서 AAPL을 매수했을 때 지난번에 무슨 일이 있었지?" 라는 질문에는 답할 수 없습니다.

TradeMemory는 메모리 계층입니다. pip install 한 번이면 AI 에이전트가 모든 거래, 모든 결과, 모든 실수를 기억합니다 — SHA-256 변조 감지 감사 추적과 함께.

모든 포지션 전에 사전 점검 체크리스트를 실행하는 트레이더와 매일 수천 건의 결정을 기록하는 EA 시스템이 프로덕션에서 사용하고 있습니다.

하는 일

  • 거래 전: 메모리에 물어보세요 — 이 시장 조건에서 지난번에는 무슨 일이 있었나? 어떻게 끝났나?

  • 거래 후: 한 번의 호출로 모든 것이 기록됩니다 — 5개 메모리 계층이 자동으로 업데이트됩니다

  • 안전장치: 신뢰도 추적, 드로다운 알림, 연속 손실 감지 — 시스템이 멈춰야 할 때를 알려줍니다

모든 시장(주식, 외환, 암호화폐, 선물), 모든 브로커, 모든 AI 플랫폼에서 작동합니다. TradeMemory는 거래를 실행하거나 자금에 접근하지 않습니다 — 기록하고 회상할 뿐입니다.

Related MCP server: AgentRecall

빠른 시작

pip install tradememory-protocol

Claude Desktop(claude_desktop_config.json)에 추가하세요:

{
  "mcpServers": {
    "tradememory": {
      "command": "uvx",
      "args": ["tradememory-protocol"]
    }
  }
}

그런 다음 Claude에게 말하세요: "내 AAPL 롱 $195에 기록 — 실적 서프라이즈, 기관 매수, 높은 확신."

# Claude Code
claude mcp add tradememory -- uvx tradememory-protocol

# From source
git clone https://github.com/mnemox-ai/tradememory-protocol.git
cd tradememory-protocol && pip install -e . && python -m tradememory

# Docker
docker compose up -d

전체 가이드: 시작하기 (트레이더 트랙 + 개발자 트랙)

TradeMemory 사용자

미국 주식 트레이더

외환 EA 시스템

컴플라이언스 팀

시장

주식 (AAPL, TSLA, ...)

XAUUSD (금)

멀티 자산

방식

모든 거래 전 사전 점검 체크리스트

MT5에서 자동 동기화

전체 결정 감사 추적

핵심 가치

규율 시스템 — 모든 결정 전 메모리

실행된 신호뿐 아니라 차단된 이유도 기록

규제 기관용 SHA-256 변조 감지 기록

자세히

더 읽기 →

더 읽기 →

더 읽기 →

작동 방식

  1. 회상 — 거래 전에 결과 품질, 맥락 유사성, 최신성, 신뢰도, 감정 상태로 가중치를 둔 과거 거래를 검색합니다 (OWM 프레임워크)

  2. 기록 — 거래 후 remember_trade 호출 한 번으로 5개 메모리 계층에 기록합니다: 일화, 의미, 절차, 정서, 거래 기록

  3. 반성 — 일간/주간/월간 리뷰로 행동 변화, 전략 성과 저하, 거래 실수를 감지합니다

  4. 감사 — 모든 결정은 생성 시 SHA-256 해시로 고정됩니다. 검토나 규제 제출을 위해 언제든 내보낼 수 있습니다

MCP 도구

카테고리

도구

설명

메모리

remember_trade · recall_memories

결과 가중치 점수로 거래 기록 및 회상

상태

get_agent_state · get_behavioral_analysis

신뢰도, 드로다운, 연속 손실, 행동 패턴

계획

create_trading_plan · check_active_plans

조건부 트리거가 있는 사전 계획

리스크

check_trade_legitimacy

5요인 사전 거래 게이트(전체 / 축소 / 건너뛰기)

감사

export_audit_trail · verify_audit_hash

SHA-256 변조 감지 + 대량 내보내기

카테고리

도구

핵심 메모리

get_strategy_performance · get_trade_reflection

OWM 인지

remember_trade · recall_memories · get_behavioral_analysis · get_agent_state · create_trading_plan · check_active_plans

리스크 및 거버넌스

check_trade_legitimacy · validate_strategy · compute_dqs

진화

evolution_fetch_market_data · evolution_discover_patterns · evolution_run_backtest · evolution_evolve_strategy · evolution_get_log

감사

export_audit_trail · verify_audit_hash · verify_audit_chain · get_daily_root

REST API: 거래 기록, 반성, 리스크, MT5 동기화, OWM, 진화, 감사를 위한 35개 이상의 엔드포인트. 전체 참조 →

거래 기록 분석

TradeMemory 자체는 무료이며 자체 호스팅 방식입니다. 유지관리자가 유료 서비스로 제공하는 것은 귀하의 거래 기록에 대한 통계 분석입니다. MT4/MT5 내역을 내보내면 손실이 집중되는 지점, 손실 후 포지션 크기 변화, 강제 청산 구조, 거래별 실제 리스크를 설명하는 기술통계 보고서를 받고, 이어서 워크스루 콜이 진행됩니다.

과거 거래에 대한 기술통계만 제공합니다: 매매 신호 없음, 투자 조언 없음, 성과 약속 없음. 파일은 전달 후 삭제됩니다.

dev@mnemox.ai | 콜 예약

엔터프라이즈 및 컴플라이언스

에이전트가 내리는 모든 거래 결정 — 거래를 하지 않기로 한 결정까지 — 은 거래 결정 기록(TDR)으로 기록됩니다. 레코드별 SHA-256 콘텐츠 해시는 전방 연결 감사 원장에 연결되며, 모든 UTC 일자는 일자 간에도 연결되는 Merkle 루트로 요약됩니다. 과거 기록을 조작하면 이후의 모든 링크가 무효화됩니다.

규정

요구사항

TradeMemory 적용 범위

MiFID II 제17조

모든 알고리즘 거래 결정 요인 기록

전체 결정 체인: 조건, 필터, 지표, 실행

EU AI Act 제14조

고위험 AI 시스템에 대한 인간 감독

모든 결정에 대한 설명 가능한 추론 + 메모리 맥락

EU AI Act 제12조

시스템 수명 동안 자동화된 변조 방지 로그

연결형 SHA-256 체인 + 일별 Merkle 루트(Phase 1.5에서 RFC 3161 TSA)

# Verify a single record hasn't been tampered with
verify_audit_hash(trade_id="MT5-7047640363")
# → {"verified": true, "chain_entry": {"sequence_num": 42, ...}}

# Walk the entire chain (or a slice) end-to-end
verify_audit_chain(from_seq=1, to_seq=None)
# → {"verified": true, "checked_count": 1284, "first_break_at": null}

# Daily Merkle root — single 32-byte anchor over every TDR for that day
get_daily_root(date="2026-05-14")
# → {"verified": true, "root_hash": "a05544...", "record_count": 18}

# Bulk export for regulatory submission
GET /audit/export?strategy=VolBreakout&start=2026-03-01&format=jsonl

아직 v0.5.2에 포함되지 않은 기능(TSA 타임스탬프, 외부 앵커링, zkML 추론 증명)을 포함한 전체 감사 체인 성숙도 설명은 LIMITATIONS.md를 참조하세요.

펀드를 위한 맞춤 배포가 필요하신가요? → dev@mnemox.ai

보안

  • API 키에 절대 접근하지 않습니다. TradeMemory는 거래를 실행하거나 자금을 이동하거나 지갑에 접근하지 않습니다.

  • 읽기와 기록만 합니다. 에이전트가 결정 맥락을 TradeMemory에 전달하면, TradeMemory는 이를 저장할 뿐입니다. 그게 전부입니다.

  • 로컬 우선. 유일한 외부 호출은 일별 감사 루트의 RFC 3161 신뢰 타임스탬프입니다 — 32바이트 해시이며 거래 데이터는 포함되지 않습니다(기본적으로 켜져 있으며 TRADEMEMORY_TSA=off로 비활성화). 그 외에는 어떤 것도 머신을 떠나지 않습니다.

  • SHA-256 연결 감사 원장. 모든 레코드는 생성 시 해시되어 이전 레코드와 연결됩니다. 일별 Merkle 루트가 체인을 고정합니다. 레코드, 슬라이스, 일자 수준에서 무결성을 검증할 수 있습니다. 모든 수준에서 변조가 감지 가능하며, 외부 앵커링(기본적으로 TSA)은 로드맵에 있습니다.

  • 1,400개 이상의 테스트 통과. CI를 포함한 전체 테스트 스위트.

연구 현황

TradeMemory의 OWM 프레임워크는 인지과학(Tulving 1972)과 강화학습(Schaul et al. 2015)에 기반을 두고 있습니다. 현재 상태:

  • OWM 5요인 점수화: 구현 완료, 테스트 완료(1,400개 이상의 테스트)

  • 통계 검증: DSR, MBL 구현 완료(Bailey-de Prado 2014)

  • 감사 추적: SHA-256 변조 감지 TDR

  • 진화 엔진: 연구 단계(전략 생성은 작동, 통계 게이트 통과율 최적화 중)

  • 하이브리드 회상: OWM 전용 모드 활성, 임베딩 구성 시 벡터 융합 사용 가능

  • 실증 검증: 진행 중(n=40 거래, 통계적 유의성을 위해 n>=100 목표)

문서

Doc

Description

시작하기

설치 → 첫 거래 → 사전 점검 목록

사용 사례

실제 운영 환경의 3가지 시나리오

API 참조

모든 REST 엔드포인트

OWM Framework

Outcome-Weighted Memory 이론

아키텍처

시스템 설계 및 계층 분리

튜토리얼

상세 안내

MT5 설정

MetaTrader 5 통합

연구 로그

진화 실험 및 데이터

실패 분류 체계

11가지 트레이딩 AI 실패 유형

중국어판

번체 중국어

기여

참조: 기여 가이드 · 보안 정책


MIT — LICENSE를 참조하세요. 교육/연구 목적으로만 제공됩니다. 금융 조언이 아닙니다.

Available Tools

20 tools
check_active_plansA
Idempotent

Check active trading plans against current market context.

Queries all active prospective plans, expires any past their expiry date, and matches remaining plans against the provided context.

Inputs: context_atr_d1, context_regime. Returns: object

check_trade_legitimacyA
Idempotent

Check if the agent has sufficient data and confidence to trade.

Call this before making any trade decision. Evaluates sample size, memory quality, regime experience, streak state, and drawdown to determine whether the agent has earned the right to trade at full size.

Inputs: strategy_name (required), symbol, current_atr_d1, current_regime. Returns: object

compute_dqsA
Idempotent

Compute Decision Quality Score before executing a trade.

Evaluates the quality of the decision process (not outcome) across 5 factors: regime match, position sizing vs Kelly, process adherence (OWM similarity), risk state, and historical pattern.

Inputs: symbol (required), direction (required), strategy_name (required), context_atr_d1, +3 more. Returns: object

create_trading_planA

Create a prospective trading plan that activates when conditions are met.

Stores a rule-based plan in prospective memory. The plan stays active until triggered, expired, or manually cancelled.

Inputs: reasoning (required), trigger_type (required), planned_action (required), trigger_condition (required), +2 more. Returns: object

evolution_discover_patternsA

Discover trading patterns from market data using LLM analysis.

Uses Claude to analyze OHLCV data and generate candidate trading patterns with entry/exit conditions. Each pattern can be backtested afterward.

Inputs: symbol (required), days, count, timeframe, +1 more. Returns: object

evolution_evolve_strategyA

Run full evolution loop — generate, backtest, select, eliminate.

Multi-generation strategy evolution: generates candidate patterns via LLM, backtests on in-sample data, validates survivors on out-of-sample data, eliminates weak hypotheses. Returns graduated strategies and graveyard.

Inputs: symbol (required), days, timeframe, generations, +1 more. Returns: object

evolution_fetch_market_dataA
Idempotent

Fetch OHLCV market data from Binance for evolution analysis.

Downloads historical price bars for backtesting and pattern discovery. Use this before discover_patterns or run_backtest to get data.

Inputs: symbol (required), days, timeframe. Returns: object

evolution_get_logA
Read-onlyIdempotent

Get the log of past evolution runs from this session.

Returns a list of all evolution runs with their results, including graduated strategies, graveyard, token usage, and backtest counts. Data is in-memory (resets on server restart).

Inputs: no named parameters. Returns: object

evolution_run_backtestA
Idempotent

Backtest a candidate pattern against historical OHLCV data.

Takes a pattern dict (from discover_patterns) and runs a vectorized backtest. Returns fitness metrics: Sharpe ratio, win rate, trade count, max drawdown, total PnL.

Inputs: pattern_dict (required), days, symbol, timeframe. Returns: object

export_audit_trailA
Read-onlyIdempotent

Export Trading Decision Records for audit and compliance review.

Provides a complete, tamper-evident record of trading decisions including the memory context (similar trades, beliefs) that informed each decision.

Inputs: end, limit, start, strategy, +1 more. Returns: object

get_agent_stateA
Read-onlyIdempotent

Get the current agent affective state (confidence, risk, drawdown).

Returns confidence level, risk appetite, drawdown percentage, win/loss streaks, equity tracking, and a recommended action based on current drawdown severity.

Inputs: no named parameters. Returns: object

get_behavioral_analysisA
Read-onlyIdempotent

Get behavioral analysis from procedural memory.

Returns aggregate trading behavior stats: hold times, disposition ratio, lot sizing variance, and Kelly criterion comparison.

Inputs: symbol, strategy_name. Returns: object

get_daily_rootA
Idempotent

Get (or rebuild) the daily Merkle root for a UTC date.

The Merkle root summarises every audit_chain entry whose chained_at falls inside the UTC day. Verifying this single 32-byte root proves the integrity of every TDR for that day without re-walking each one.

Inputs: date (required), rebuild, request_tsa, include_token. Returns: object

get_strategy_performanceA
Read-onlyIdempotent

Get aggregate performance stats per strategy.

Use this to evaluate which strategies are working and which need adjustment.

Inputs: symbol, strategy_name. Returns: object

get_trade_reflectionA
Read-onlyIdempotent

Get the full context and reflection for a specific trade.

Use this to deep-dive into a particular trade's reasoning and lessons.

Inputs: trade_id (required). Returns: object

recall_memoriesA
Idempotent

Recall memories using OWM outcome-weighted scoring.

Queries episodic and semantic memories, scores them by outcome quality, context similarity, recency, confidence, and affective modulation. Returns ranked memories with score breakdown.

Use order="losses_first" right before placing a trade: losing trades taken in similar conditions rank first, and the current mood (a losing streak) no longer pushes them down.

Inputs: symbol (required), market_context (required), limit, order, +6 more. Returns: object

remember_tradeA

Store a trade into OWM multi-layer memory with automatic updates.

Writes to episodic memory and automatically updates semantic (Bayesian), procedural (running averages + hold time + Kelly), and affective (EWMA confidence/streaks). Also writes to trade_records for backward compatibility.

Inputs: pnl (required), symbol (required), direction (required), exit_price (required), +14 more. Returns: object

validate_strategyA
Read-onlyIdempotent

Validate a trading strategy using statistical tests (DSR + Walk-Forward + Regime + CPCV).

For educational and research purposes only. Not financial advice.

Upload a trade log CSV (QuantConnect format) or daily returns CSV. The tool runs four statistical tests:

  1. Deflated Sharpe Ratio (DSR) — detects overfitting from multiple testing

  2. Walk-Forward Validation — checks out-of-sample consistency

  3. Regime Analysis — performance across bull/bear/crisis markets

  4. CPCV — cross-validated Sharpe stability across time periods

Inputs: file_path (required), format, strategy_name, num_strategies. Returns: object

verify_audit_chainA
Read-onlyIdempotent

Verify the integrity of the audit chain.

Walks the chain from from_seq (default: 1, the genesis record) to to_seq (default: latest), checking that every record's prev_hash matches the previous record's data_hash, and that each data_hash equals SHA256(prev_hash || content_hash).

Returns a dict with verified, checked_count, first_break_at, reason. A first_break_at of None with verified=True means the chain is intact across the verified range.

Inputs: to_seq, from_seq. Returns: object

verify_audit_hashA
Read-onlyIdempotent

Verify the integrity of a Trading Decision Record.

Recomputes the SHA256 data_hash from stored inputs and compares with the hash computed at decision time. A mismatch indicates tampering.

Inputs: trade_id (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 20 tools

    Disambiguation4/5

    Most tools target clearly distinct resources and actions, and namespaces (evolution_*, verify_audit_*) help group related operations. However, check_trade_legitimacy vs compute_dqs (both pre-trade gates) and get_agent_state vs get_behavioral_analysis (both aggregate state) have overlapping boundaries an agent could misselect between.

    Naming Consistency4/5

    Nearly all tools follow a predictable snake_case verb_noun pattern (get_*, create_*, verify_*, check_*), with the evolution_* prefix used consistently as a namespace for that subgroup. Minor deviation is the mixed imperative/noun style of remember_trade, recall_memories, and compute_dqs, but the convention remains readable throughout.

    Tool Count4/5

    20 tools is on the heavier side but justified by the breadth of the domain (memory, planning, strategy evolution, audit, validation). Each tool maps to a distinct capability rather than being redundant, so the count is reasonable though slightly toward the upper bound.

    Completeness4/5

    Coverage is strong: memory write/recall, planning create/check, a full evolution loop, and a complete audit trail (export, hash, chain, Merkle root). The notable gap is the planning lifecycle—create_trading_plan mentions manual cancellation but no cancel/update plan tool exists, and there is no delete/update for stored trades.

    Maintenance

    ActivitySlowing
    ResponsivenessMixed handling

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides persistent memory for AI agents by storing session snapshots, factual memories, and conversation summaries. It enables seamless continuity between interactions by allowing agents to restore previous emotional states and recall relevant past experiences.
      -
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for persistent, compounding memory that automatically captures corrections and insights across AI sessions, enabling agents to learn and improve over time.
      5
      376
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server that provides AI agents with persistent memory, cross-agent sharing, and context management, enabling them to remember conversations, track complex tasks, and evolve skills across tools.
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that captures and stores user decisions during AI-agent interactions, offering structured decision memory, cognitive bias detection, and personalized advice from historical patterns.
      2
      -