Agent Integration

Connect AI coding agents to Σternal for regime-aware market context.

Why Agent Integration?

Modern AI coding agents can autonomously research, analyze, and execute complex tasks. When these agents have access to structured market context, they become significantly more capable of:

  • Making regime-aware investment decisions
  • Generating context-rich research reports
  • Backtesting strategies with historical regime awareness
  • Monitoring portfolio exposure to regime transitions

Σternal provides agents with the same structured context that professional analysts use—enabling autonomous systems to reason about markets with institutional-grade awareness.

Supported Agents

Σternal is designed to work with any AI agent that can make HTTP requests or use tool definitions. Native support is available for:

Claude logo

Claude Code/Cowork

Anthropic

Full tool use support via function definitions. Can decode markets, analyze regimes, and generate reports autonomously.

LangChain logo

LangChain

Agent Framework

Agent orchestration via chains and tools. Compose multi-step workflows using Σternal regime context.

OpenClaw logo

Clawbot / OpenClaw

Open Source

Open-source agent frameworks with MCP support. Run locally or in your own infrastructure.

Codex logo

OpenAI Codex

OpenAI

Function calling support for GPT-4 and future models. Integrate via the standard OpenAI tools format.

Tool Definitions

Agents interact with Σternal through structured tool definitions. Here's the core decode tool:

{
  "name": "eternal_decode",
  "description": "Analyze the current market environment for an asset and return regime context, historical parallels, and scenario considerations.",
  "parameters": {
    "type": "object",
    "properties": {
      "asset": {
        "type": "string",
        "description": "Ticker symbol (e.g., SPY, QQQ, TLT)"
      },
      "timeframe": {
        "type": "string",
        "enum": ["1M", "3M", "6M", "1Y"],
        "description": "Analysis timeframe"
      }
    },
    "required": ["asset", "timeframe"]
  }
}

Additional tools available:

eternal_chat
Follow-up questions within a decode session context
eternal_regimes
List all historical regimes in the library
eternal_prices
Retrieve OHLC price data for visualization

MCP Server

For agents that support the Model Context Protocol (MCP), Σternal provides a compliant server:

# Install the MCP server
pip install eternal-mcp

# Configure in your MCP settings
{
  "mcpServers": {
    "eternal": {
      "command": "eternal-mcp",
      "args": ["--api-key", "YOUR_API_KEY"],
      "env": {}
    }
  }
}

The MCP server exposes all Σternal capabilities as tools and resources that agents can discover and use automatically.

System Prompt Templates

When configuring agents to work with Σternal, include context about how to interpret regime analysis:

You have access to Σternal, a market regime analysis system. When analyzing markets:

1. ALWAYS decode the relevant asset before making investment-related statements
2. Reference the top regime match and similarity score
3. Consider historical parallels when discussing potential outcomes
4. Note confidence levels—lower confidence indicates transitional periods
5. Use the five dimensions (monetary, liquidity, inflation, growth, policy) to structure your analysis

Remember: Σternal provides context and structure, not predictions. Use decoded regimes to inform reasoning, not as direct trading signals.

Python SDK

For programmatic integration, use the official Python SDK:

pip install eternal-sdk
from eternal import Eternal

client = Eternal(api_key="YOUR_API_KEY")
client.base_url = "https://eternal-agents.com/developers"

# Decode current market environment
analysis = client.decode(asset="SPY", timeframe="6M")

print(f"Top Regime: {analysis.top_regime}")
print(f"Similarity: {analysis.similarity:.0%}")
print(f"Confidence: {analysis.confidence:.0%}")

# Access structured dimensions
for dim in analysis.environment:
    print(f"{dim.name}: {dim.value} ({dim.direction})")

# Follow-up questions
response = client.chat(
    session_id=analysis.session_id,
    question="How did similar environments transition historically?"
)

Agent Workflow Examples

Common patterns for agent integration:

Morning Brief Generation

Agent decodes key assets at market open, generates a regime-aware summary, and delivers via Slack/email.

Tools: eternal_decodeeternal_chatnotification service

Portfolio Review

Agent analyzes each position against current regime, identifies misalignments, and suggests rebalancing rationale.

Tools: portfolio dataeternal_decode (per asset) → analysis synthesis

Research Deep Dive

Agent explores historical parallels, compares to current environment, and generates a detailed research memo.

Tools: eternal_decodeeternal_chat (iterative) → document generation

Best Practices

Cache Decoded Context

Regime analysis is relatively stable intraday. Cache decode results for 4-6 hours to reduce API calls and maintain consistency across workflows.

Respect Confidence Levels

When confidence is low (<40%), instruct agents to be more conservative in their conclusions and flag uncertainty to human reviewers.

Use Session IDs

Maintain session continuity when asking follow-up questions. This preserves context and enables more coherent multi-turn analysis.

Log Everything

Store decoded analysis alongside agent outputs for audit trails. This enables post-hoc review of agent reasoning.

Ready to integrate?

Get an API key and start building regime-aware agent workflows today.