Documentation

Neural API Reference

Documentation for the rlx-search engine and MCP orchestration.

Engine StatusOperational

Model Context Protocol

The MCP Server acts as a semantic gateway, exposing the full ai_patterns analysis surface to remote AI agents and internal swarm orchestration.

Transport Protocols

Local Stdio

Best for local development and direct integration with VS Code or Claude Desktop.

Remote HTTP

Production-grade endpoint for distributed agentic swarms via Nginx reverse-proxy.

POST /api/mcpActive
GET /api/mcpAgent Docs

Live Tool Registry

General

pattern_searchmcp

Search for similar historical price patterns in the RLX database.

symbolintervalqflimitsortanchorTsembeddingModetoken_id
search_by_sketchmcp

Search for historical patterns similar to a custom 'sketched' price trajectory (Sketch-to-Search). Useful when you want to find matches for a hypothetical or hand-drawn pattern.

queryValuessymbolintervallimittoken_id
get_pattern_metricsmcp

Retrieve advanced statistical metrics and forecast distributions for a pattern search result.

symbolintervalqflimitsortanchorTsembeddingModetoken_id
get_grid_statsmcp

Calculate optimal grid trading levels, confidence, and risk profiles based on pattern analysis.

symbolintervalqflimitsortanchorTsembeddingModetoken_id
get_trading_decisionmcp

Return a compact trader decision card for a symbol/interval: TRADEABLE, WATCH, or SKIP with direction, confidence, evidence, risk, reasons, and caveats.

symbolintervalqflimitsortanchorTsembeddingModeincludeBacktestbacktestStartTsbacktestEndTsbacktestStepbacktestMaxBarsbacktestTimeoutMsminAvgSimminProbfeePctslippagePcttoken_id
get_index_healthmcp

Operator tool: inspect ANN index progress, lag, vector counts, and coverage for a symbol/interval/q.

symbolintervalqembeddingMode
rebuild_pattern_indexmcp

Operator tool: rebuild the ANN pattern index for a symbol/interval/q so search quality can recover after stale or expanded history.

symbolintervalqembeddingModetargetBars
warm_symbol_contextmcp

Operator tool: refresh series and prewarm ANN indexes for multiple q values before a live trading session.

symbolintervalqValuesembeddingModetargetBars
append_private_memory_rowsmcp

Append or upsert candle rows into an existing private memory dataset so agents can keep memory fresh without full re-import.

userIdagentIddatasetIdrawTextrows
search_private_memorymcp

Run analog search and forecast against a private memory dataset instead of the shared public symbol universe. Use this when an agent or trader uploads their own candles and wants historical context before deciding whether to validate the idea in RLXBT.

userIdagentIddatasetIdqflimitcursorstartincludeForecastforcesortwindowStartTswindowEndTsanchorTsembeddingMode
forecast_private_memorymcp

Run a dataset-scoped private-memory search and return a compact forecast card with direction, execution posture, evidence, and top analogues. This is the memory/intelligence step before a fast RLXBT proof run on the same thesis.

userIdagentIddatasetIdqflimitcursorstartincludeForecastforcesortwindowStartTswindowEndTsanchorTsembeddingModetoken_id
forecast_private_memory_from_datamcp

Create or reuse a private dataset, import candle data, and return a compact forecast card in one call. Ideal for users who want to upload exchange or ML-derived candle history, inspect analogues immediately, and only then decide whether to run RLXBT.

userIdagentIddatasetIdnameslugintervaldescriptionrawTextrowsqflimitcursorstartincludeForecastforcesortwindowStartTswindowEndTsanchorTsembeddingModetoken_id
get_rlxbt_statusmcp

Inspect whether the external RLXBT daemon is reachable and return its health payload. This wraps the daemon health contract (typically GET /api/health) and is the first call an agent should make before requesting proof backtests.

get_training_episodesmcp

Retrieve historical RL episodes for training context or audit.

symbolintervallimit
get_bar_momentummcp

Current intrabar statistics for BTCUSDT. Shows how much % the price moved from open to now, and compares it with expected volatility.

symbolinterval
intrabar_momentum_probmcp

Calculate an intrabar-adjusted probability for Polymarket 5m/15m markets. Incorporates the current bar's momentum to improve prediction accuracy when time-to-close is short.

symbolstrikePricecurrentPricebarOpenTimetimeToCloseMinutes
resolve_live_trade_outcomemcp

Resolve a previously logged live Polymarket market after expiry so calibration stats can measure real decision quality.

marketIdoutcomeresolvedAt
compare_current_to_past_casemcp

Compare the current Polymarket setup against a selected historical analogue case. Returns the full live probability snapshot plus one chosen precedent and a structured comparison summary.

userIdsymbolstrikePricecurrentPricetimeToCloseMinutesanchorTimestampregimeFilterextremeVolatilityModetargetThresholdsPctmodel5mmodel15mcaseSelectioncaseIdcaseModeltoken_id
explain_pattern_matchmcp

Explain why the current Polymarket setup matches or differs from a selected historical analogue. Returns structured `whyMatched` and `whyDifferent` explanations alongside the selected case.

userIdsymbolstrikePricecurrentPricetimeToCloseMinutesanchorTimestampregimeFilterextremeVolatilityModetargetThresholdsPctmodel5mmodel15mcaseSelectioncaseIdcaseModeltoken_id
get_calibration_statsmcp

Retrieve calibration statistics for VBRL Polymarket probability predictions: Brier score, log loss, calibration buckets (predicted vs realized frequency), YES signal win rate. Use to validate model accuracy over time.

get_api_guidemcp

Returns the full documentation and workflow guide for this MCP server. Call this first to understand all available tools, their use cases, and how to combine them. Includes: tool catalog, recommended workflows for Polymarket research, historical analog analysis, and example calls.

topic
find_market_analogsmcp

Find historical price patterns similar to the current (or specified) market state. Returns a list of past dates when the same pattern occurred, the price outcome after each analog, and aggregate statistics (win rate, median return, percentile range). Use cases: (1) pre-news analysis — filter by timeOfDayUTC to find analogs that happened near a specific event time (e.g., FOMC at 14:00 UTC); (2) regime research — understand historically what happens after this pattern; (3) Polymarket context — combine with get_polymarket_probabilities to validate signal with historical evidence. Returns a plain-English summary suitable for agent reasoning.

symbolintervalqfanchorTimestamplimitminSimilaritytimeOfDayUTCtimeRangeUTCweekdayssessiontimeWindowMinutescontexttoken_id
research_time_conditioned_analogsmcp

Research historical analogues under specific UTC time conditions: hour ranges, weekdays, and market sessions. Use this for hypotheses like FOMC hour, New York open, Monday morning, weekly close, or time-of-day behavior.

symbolintervalqfanchorTimestamplimitminSimilaritytimeOfDayUTCtimeRangeUTCweekdayssessiontimeWindowMinutescontexttoken_id
research_market_structuremcp

Research the current Rust marketStructure label against historical analogues. Returns current structure, filtered analog outcomes, continuation/reversal stats, warnings, next research questions, and a research verdict.

symbolintervalqfanchorTimestamplimitminSimilaritytimeOfDayUTCtimeRangeUTCweekdayssessiontimeWindowMinutescontextstructureFocusincludeDecisiontoken_id
get_market_playbookmcp

Turn the current Rust marketStructure, trading decision, failure analogues, and historical structure research into an agent-ready market playbook with status, bias, confirmations, invalidations, and execution notes.

symbolintervalqfanchorTimestamplimitminSimilaritytimeOfDayUTCtimeRangeUTCweekdayssessiontimeWindowMinutescontextstructureFocusincludeDecisionplaybookFocusincludeResearchtoken_id
explain_live_skipmcp

Return the most recent skipped live selector tick with per-scale details and skip reasons.

symbolintervalmarketIdhourstoken_id
get_scale_agreement_historymcp

Summarize how often multi-scale consensus reaches a required agreement threshold by UTC hour and weekday.

symbolintervalhoursminAgreetoken_id
get_execution_feedback_loopmcp

Analyze live execution outcomes, selector signal frequency, and calibration stats to recommend adaptive signal-quality thresholds for strategy consumers.

symbolintervalhoursbaseMinConfidencebaseMinEdgetargetWinRateminResolvedTradestoken_id
get_confidence_calibration_guidancemcp

Return BTCUSDT 15m confidence calibration and threshold guidance for live trading, including calibrated-probability bands and drift notes.

symbolintervalhoursminResolvedTradestoken_id
get_btc15m_risk_profilesmcp

Return ready-to-use BTCUSDT 15m risk profiles for integrators, including conservative, balanced, and aggressive selector settings.

hoursminResolvedTradestoken_id
get_mcp_compatibility_manifestmcp

Return the versioned MCP compatibility manifest, including canonical tools, aliases, and JSON argument schemas for remote clients.

Backtesting

backtest_strategymcp

Perform a full strategy backtest over a historical period (Walk-forward analysis). Use this for testing general rules or long-term performance.

symbolintervalqfstartTsendTssteptopKminAvgSimminProbdirectiononlySignalsfeePctslippagePctmaxBarsembeddingModeincludeStatstoken_id
backtest_patternmcp

Forensic Backtest: verify a specific pattern occurrence with historical simulation to inspect PnL, drawdowns, and trajectories.

symbolintervaltimestampqftopKminAvgSimminProbminMatchSimcandidateLimitdirectionfeePctslippagePctmaxBarsembeddingModeincludeStatstoken_id
run_rlxbt_backtestmcp

Send a preset-expanded or custom RLXBT strategy payload to the external daemon backtest contract (typically POST /api/run-backtest) and return the raw result. Supports presets rsi_mean_reversion, ema_trend_follow, breakout_confirmation, or custom fields like entry_long/exit_long/entry_short/exit_short, entry_rules/exit_rules, strategy, stop_loss_pct, take_profit_pct, max_hold_bars, position_size, initial_capital, commission, and slippage. Use it as a fast hosted validation layer after pattern discovery or private-memory research, so traders do not need to maintain separate backtesting infrastructure. Paid access is Manus token-based rather than period-based: expect payment_required with price_sol, token_id, and access_contract, then retry after payment with the same token. Do not mix preset with custom rule fields in the same request.

presetstrategyentry_longexit_longentry_shortexit_shortentry_rulesexit_rulesstop_loss_pcttake_profit_pctmax_hold_barsposition_sizeinitial_capitalcommissionslippageposition_sizingrisk_managementtoken_id

Data Management

get_dataset_statusmcp

Get summary of available bars and time ranges for a symbol and interval.

symbolintervaltoken_id
get_dataset_statsmcp

Get detailed statistics about dataset size, pairs, gaps, and freshness.

symbolintervaltoken_id
get_data_healthmcp

Operator tool: inspect freshness, gap status, cache state, and ANN readiness for a symbol/interval.

symbolintervalqembeddingMode
expand_datasetmcp

Trigger background fetching of historical data to extend a dataset on the Rust server.

symbolintervalbarssincetoken_id
list_private_memory_datasetsmcp

List private datasets available to a human owner or a specific agent so MCP clients can discover dataset IDs before import and search operations.

userIdagentId
get_private_memory_dataset_statusmcp

Get status, row counts, timestamps, and last import/error state for one private dataset.

userIdagentIddatasetId
create_private_memory_datasetmcp

Create a new private memory dataset for an owned agent or for the calling agent itself.

userIdagentIdnameslugintervaldescription
import_private_memory_datasetmcp

Import candle-style JSON/CSV text or normalized rows into an existing private memory dataset and make it RLX-searchable.

userIdagentIddatasetIdrawTextrows
delete_private_memory_datasetmcp

Delete a private dataset and remove its backing RLX candle memory.

userIdagentIddatasetId
update_private_memory_dataset_metadatamcp

Update private dataset display metadata such as name and description without changing its RLX backing identity.

userIdagentIddatasetIdnamedescription

Operations

refresh_market_datamcp

Operator tool: force-refresh stored candle history for a symbol/interval from the Rust data plane.

symbolintervaltargetBars

RL & Regimes

detect_market_regimemcp

Classify current market state into one of the known market regimes.

symbolintervalqueryLengthtimestamptoken_id
get_rl_training_batchmcp

Fetch a tensor-ready batch of trajectories for RL agent refinement.

symbolintervalqueryLengthforecastHorizonbatchSizeminSimilarity
detect_market_regime_latestmcp

Detect the most recent market regime for a specific pair.

symbolintervalqueryLengthtoken_id
get_rl_simple_samplesmcp

Fetch simple one-decision RL episodes for training or analysis.

symbolintervaltimestampqueryLengthforecastHorizonnumEpisodesminSimilarity

Signals

get_live_signalsmcp

Retrieve recently generated live trading signals across all pairs.

limit
get_live_trade_logmcp

Inspect recent live trade decision packets and execution recommendations for calibration and audit.

symbolactiondecisionModeresolvedOnlyhourslimit
get_live_trade_statsmcp

Summarize realized live-trade performance, including win rate and average edge by decision mode.

get_signal_audit_logmcp

Inspect recent live selector decisions, including skipped ticks and normalized skip reasons.

symbolintervalmarketIdhoursdecisionprimarySkipReasonlimittoken_id
get_signal_frequency_statsmcp

Measure how often strong live selector signals occur for a confidence and edge threshold.

symbolintervalhoursminConfidenceminEdgedecisionModetoken_id
get_live_edge_distributionmcp

Show the current model-vs-market YES edge distribution across cached Polymarket background watches.

symbolonlyActiveminTimeToCloseMinutesmaxTimeToCloseMinutesdefaultPMarketYestoken_id
get_live_provider_observabilitymcp

Return provider heartbeat telemetry, consumer readiness, and refresh health for live strategy consumers using cached background watches.

Polymarket

polymarket_multi_scale_probmcp

Calculate Polymarket probabilities by scanning multiple window lengths (q=12, 24, 48, 96) and weighting them by analogue density and similarity.

symbolstrikePricecurrentPricetimeToCloseMinutes
get_polymarket_probabilitiesmcp

Compute TTC-aware 5m/15m Polymarket probabilities using the ai_patterns historical analog engine.

userIdsymbolstrikePricecurrentPricetimeToCloseMinutesanchorTimestampregimeFilterextremeVolatilityModetargetThresholdsPctmodel5mmodel15mtoken_id
get_live_polymarket_trade_decisionmcp

Auto-discover the active BTC Up/Down 15m Polymarket market, combine live Polymarket pricing with pattern memory and intrabar momentum, and return BUY_YES, BUY_NO, or SKIP with entry guardrails.

symbolintervalmarketWindowminEdgeminCombinedConfidenceallowDegradedSearchnowMstoken_id
get_polymarket_background_statusmcp

Inspect background Polymarket watches and cached server-side probability snapshots.

upsert_polymarket_background_watchmcp

Create or update a server-side Polymarket background watch so remote agents can consume hot cached probabilities.

symbolstrikePriceregimeFilterextremeVolatilityModetargetThresholdsPctmodel5mmodel15mmarketIdcloseTimeMspMarketYesisActiveconditionIdtokenIdYestokenIdNo
refresh_polymarket_backgroundmcp

Force an immediate refresh cycle for all configured Polymarket background watches.

polymarket_backtestmcp

Run a calibrated walk-forward Polymarket profitability backtest on historical candles. Splits data into train (calibration) and test (out-of-sample evaluation) sets. Returns winRate, ROI, Sharpe ratio, Brier score, equity curve, and performance by confidence bucket. Use this to validate whether the VBRL pattern engine has a profitable edge for a given symbol/horizon.

symbolintervalqfpMarketminEdgetopKstartTsendTsstepinitialCapitalpositionSizetrainRatiocalibratecalibBinstoken_id
polymarket_horizon_scanmcp

Scan multiple forecast horizons (f=1..10 bars) in parallel to find the optimal prediction window for a symbol. Returns a ranked table of {f, winRate, ROI, Sharpe} and a plain-English recommendation. Use this before betting to determine which horizon the model is most accurate at. Example: for BTCUSDT/15m the optimal horizon may be f=3 (45 minutes) rather than f=1.

symbolintervalqpMarketminEdgetopKtrainRatiohorizonsinitialCapitalpositionSizetoken_id
polymarket_model_healthmcp

Quick health check for the VBRL Polymarket model on a specific symbol. Runs a fast horizon scan (f=1,3,5) and returns: best horizon, calibration bias (raw upProb vs actual win rate), whether the model is profitable, and a concise recommendation for the agent. Use this as a first step before calling polymarket_backtest or get_polymarket_probabilities.

symbolintervalpMarkettoken_id
backtest_polymarket_selectormcp

Backtest the hardened Polymarket BTC 15m selector used by trading agents. Builds multi-q analogue consensus, calibrates probabilities on an in-sample window, then evaluates out-of-sample with realistic binary-share execution: effective ask includes spread, slippage, and fee bps. Returns calibratedProbability/EV, skip counts, win rate, ROI, Sharpe, Brier scores, and optional trades.

pMarketYespMarketNominEdgeinitialCapitalpositionSizespreadBpsslippageBpsfeeBpssymbolintervalqValuesftopKstartTsendTsmaxBarssteptrainRatiocalibBinsminAgreeminAvgSimilarityminMatchesPerScalerequireConsensusincludeTradestoken_id
optimize_polymarket_selectormcp

Run reproducible walk-forward optimization for the Polymarket selector. Scans minAgree, minAvgSimilarity, and minEdge grids while reusing the same historical backtest data, rejects sparse parameter sets, and returns a ranked leaderboard plus recommended selector parameters.

pMarketYespMarketNoinitialCapitalpositionSizespreadBpsslippageBpsfeeBpssymbolintervalqValuesftopKstartTsendTsmaxBarsstepcalibBinsminMatchesPerScalerequireConsensusminAgreeGridminAvgSimilarityGridminEdgeGridfoldsminTradestoken_id
explain_polymarket_signalmcp

Explain one live Polymarket BTC Up/Down signal before execution. Scans q=[24,40,48,72,96] style analogues, reports scale agreement, calibratedProbability, effective ask, edge, EV, Kelly fraction, and explicit skip reasons such as TTC outside 35-55m, weak similarity, insufficient consensus, or edge below threshold.

pMarketYespMarketNominEdgeinitialCapitalpositionSizespreadBpsslippageBpsfeeBpssymbolintervalqValuesstrikePricecurrentPricetimeToCloseMinutesanchorTimestamptopKminAgreeminAvgSimilarityminMatchesPerScalecalibrationShifttoken_id
sweep_polymarket_selectormcp

Run a parameter sweep across q × f × sim × minEdge combinations for the Polymarket selector. Fetches RLX backtest data once per (q, f) pair and applies all sim/minEdge combos in-memory. Returns all rows sorted by Sharpe with pre-formatted gbrainText and gbrainReward fields ready for brain-trading gbrain_learn calls. Use this to build the GBRAIN pattern-discovery loop.

symbolintervalqGridfGridsimGridminEdgeGridtopKmaxBarssteptrainRatiocalibBinsminTradespMarketYesspreadBpsslippageBpsfeeBpspositionSizeinitialCapitaltoken_id
resolve_polymarket_outcomemcp

Feed back a resolved Polymarket market outcome to update calibration tracking. Call after a market closes: outcome=1 (YES won) or outcome=0 (NO won). This improves model validation over time.

marketIdoutcomepVbrlpMarket
polymarket_vbrl_signalmcp

VBRL (Vector-Based RL) signal for a Polymarket BTC Up/Down market. Finds the k most similar historical BTC patterns using the HNSW analogue engine, maps each to a binary YES/NO vote (would BTC have cleared the strike after f bars?), and aggregates via similarity-weighted kernel (VBRL formula) to produce a calibrated probability. Returns individual analogue votes with their weights, VBRL reasoning trace, a BUY_YES / BUY_NO / SKIP recommendation with edge vs market price, and a plain-English summary. Use this when you need the RL agent's reasoning — not just a probability number — before placing a bet.

symbolintervalcurrentPricestrikePricetimeToCloseMinutesqftopKminSimilarityanchorTimestamppMarkettoken_id

Polymarket TTC Workflow

Advanced Probability Engine

Integrate Time-To-Close aware probabilities directly into trading agents. The MCP layer provides background watchers that maintain hot caches of pattern metrics specifically filtered for active prediction markets.

ensemble.closeAboveStrikeProb
ensemble.touchStrikeProb
ensemble.signal

Quick Start (Claude / Desktop)

mcp-config.json
Integration Config
{
  "mcpServers": {
    "ai_patterns_neural_link": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-server/dist/index.js"],
      "env": {
        "RLX_SEARCH_BASE_URL": "$BASE_URL",
        "SUPABASE_URL": "YOUR_URL"
      }
    }
  }
}