NERYA docs

Operator manual · self-evolving runtime

Run an agent that
rewrites itself.

Nerya ships its own agent kernel, LLM gateway, sub-agents, typed memory, triggers, an Agent Team orchestrator, a trading kernel, and an evolution pipeline, with no external framework attached at runtime. This manual walks the whole thing, from one-line install to signing an evolution diff.

0built-in skills
0venues via CCXT
0tests, no network
0local port · 18317

01 · README front door

No strategy? Ask the agent for one.

Nerya is a self-evolving AI trading team that runs on your laptop. Skill-first and trading-native. One sentence is enough to get a working strategy package.

“I have $500 in a live account. Make me money on BTC. Don't blow it up.”

The strategy_author skill turns that prompt into a working strategy package in a single chat turn: trigger, sub-agent prompt library, candle source, account binding, risk limits, session ledger. You approve it, and it runs. After each run, the agent journals every decision, reviews every fill, reflects between sessions, and drafts upgrade proposals. The operator signs the diff or rejects it.

Safe by default

Live trading stays off until you sign for it. Mistakes go into memory, not into your wallet.

02 · what carries the product

The six pillars

01

Agent Team

A durable, role-typed team with a leader, analysts, a risk critic, a shared blackboard, a task board, a mailbox, and gates.

02

Self-evolution

Reflection writes typed proposals between sessions. The operator signs. The runtime applies with a rollback snapshot.

03

Typed memory

Five typed markdown surfaces: global, mistakes, market regimes, skill learnings, and per-strategy. Read it, diff it, version it.

04

SKILL.md first

Every capability is a directory with SKILL.md as the only definition surface. 25 ship today.

05

Trading kernel

Trading primitives instead of raw tool calls: Risk Gate, Approval Gate, live/paper separation, virtual ledger, reconciliation.

06

SDK + gateway

Thin Python & TypeScript clients over the local daemon, plus a universal messaging gateway across eight platforms.

Why Nerya is different

ConcernMost agent frameworksNerya
Trading primitivesTool calls against exchange SDKsRisk Gate, Approval Gate, live/paper separation, virtual ledger, reconciliation
MemoryA vector blob, maybe5 typed markdown surfaces
Self-improvementYou write the promptsReflection writes proposals; operator signs; runtime applies with rollback
Multi-agentLoose function callsDurable team with leader, analysts, risk critic, blackboard, gates
ConnectorsOne SDK per venue6 native venues + 100+ via CCXT; ask the agent to author a missing one
Security“Don't log keys”Vault-only secrets, vault:// refs, prompt firewall, signer policy, sandbox
OpsWrite your own supervisorOne-liner installer + systemd / launchd / NSSM service

03 · zero to a first fill

Quick start

One-liner install

bash
# macOS / Linux
curl -LsSf https://raw.githubusercontent.com/NeryaAI/Nerya/main/install/install.sh | sh

# Windows PowerShell
iwr https://raw.githubusercontent.com/NeryaAI/Nerya/main/install/install.ps1 -UseBasicParsing | iex

The installer is idempotent. It:

  1. installs uv if missing,
  2. clones Nerya into ~/.nerya/src and runs uv sync --extra trading,
  3. drops a nerya shim into ~/.local/bin,
  4. initialises a workspace at ~/nerya-ws,
  5. registers a host service so the local API boots with the machine on port 18317.

Beginner mode

bash
nerya setup --tui      # rich text wizard: password, LLM key, gateway, memory, account
nerya setup --web      # same wizard in the browser at http://127.0.0.1:18317/setup

Every domain except the LLM model carries a safe default. Hit Enter through every prompt and you get a working install. Then open the dashboard and chat.

youI have $500 in a live account. Make me money on BTC. Don't blow it up.

neryaDrafts a demo_btc_5m_scalper package, wires up binance:BTCUSDT candles, binds paper_main, sets a 0.4% max-drawdown guard, schedules the trigger every 5 minutes, and asks you to approve.

Manual quick start (no installer)

bash
# 1. create a workspace
python -m nerya.cli.app init --workspace ~/.nerya

# 2. inspect installed skills
python -m nerya.cli.app skill list

# 3. run the vertical slice demo (simulation, no live keys)
python sdk/python/examples/price_tracker.py --workspace ~/.nerya

# 4. review the resulting strategy session
python -m nerya.cli.app strategy history btc_momentum --workspace ~/.nerya

# 5. reflect and generate evolution proposals
python -m nerya.cli.app reflect    --workspace ~/.nerya
python -m nerya.cli.app evolve     --workspace ~/.nerya
python -m nerya.cli.app proposals list --workspace ~/.nerya

04 · ground truth

Architecture

Code lives in the repo. Runtime state (strategies, journals, sessions, approvals, memory, vault, proposals) lives in your workspace directory. Tarball it, grep it, or rm -rf it.

runtime
┌──────────────────────────── Nerya runtime ────────────────────────────┐
│   ┌──────────────────┐   ┌─────────────┐   ┌──────────────────────┐    │
│   │ Trigger router   │──►│ Nerya kernel│──►│ Skills runtime         │   │
│   │ schedule / NL /  │   │  agent loop │   │ registry + dispatch    │   │
│   │ webhook / gateway│   │  + planner  │   │ permissions + manifest │   │
│   └──────────────────┘   └──────┬──────┘   └───────────┬──────────┘    │
│                                 ▼                      ▼               │
│   ┌─────────────┐   ┌─────────────┐   ┌──────────────────────────┐    │
│   │ LLM gateway │   │ Subagents + │   │  Trading kernel           │    │
│   │ tiers +     │   │ Agent Team  │   │  intents → Risk Gate →     │   │
│   │ budget +    │   │ blackboard +│   │  Approval Gate →           │   │
│   │ adapters    │   │ mailbox     │   │  paper / live execution    │   │
│   └─────────────┘   └─────────────┘   └──────────────┬───────────┘    │
│   ┌─────────────┐   ┌─────────────┐   ┌──────────┐    ▼               │
│   │ Messaging   │   │ Security    │   │ MCP /    │  Strategy history   │
│   │ gateway     │   │ vault +     │   │ ACP      │  + journals         │
│   │ pipeline    │   │ signer +    │   │ bridges  │                     │
│   └─────────────┘   └─────────────┘   └──────────┘                     │
└────────────────────────────────────────────────────────────────────────┘
                                    ▼
┌───────────────────────── Nerya workspace (files only) ────────────────┐
│  state/ journals/ inbox/ outbox/ memory/ vault/ approvals/             │
│  strategies/<id>/{strategy.yml, limits.yml, history/, sessions/}       │
│  skills/{enabled.yml, installed/, pending/}                            │
│  scripts/{pending/, approved/, rejected/}                             │
│  evolution/proposals/                                                  │
└────────────────────────────────────────────────────────────────────────┘

05 · a durable standing team

Agent Team

A TeamRun is a durable team config that persists across turns. It carries the whole standing team and the rules that keep it honest.

  • Typed members: strategy lead, market / on-chain / news / technical analysts, risk critic, execution planner, portfolio manager.
  • Per-role skill allowlist + denylist. execution_planner cannot touch trading.
  • Task board with dependencies, locks, priorities, owners.
  • Mailbox for inter-agent messaging, plus a shared blackboard for evidence.
  • Leader synthesis: the lead waits for required reports, resolves conflicts, emits a decision memo.
  • Gates: plan-artefact, all-tasks-complete, verification, optional human approval.
Templates

Three ship today: market_analysis_team, strategy_design_team, and trade_decision_committee. Drop new ones under nerya/teams/templates.

06 · the loop closes

Self-evolution

After each closed session, reflection.py writes memory entries. nerya/evolution/ reads those entries and produces typed proposals.

proposal types
learning_update         markdown patch to memory
prompt_patch            unified diff of an agent / subagent prompt
script_proposal         new script + manifest in workspace/scripts/pending/
skill_proposal          new skill directory in workspace/skills/pending/
trigger_route_patch     unified diff to workspace/triggers/routes.yml
strategy_config_patch   unified diff to strategies/<id>/strategy.yml
risk_limit_suggestion   advisory only; never overwrites limits.yml
Code-enforced immutables

No agent-authored patch touches accounts.yml, limits.yml, the vault, signer policy, or live_trading_enabled. promotion.py rejects any diff that tries. Every applied proposal carries a rollback.py snapshot.

07 · plain markdown, no black box

Memory

workspace/memory/
workspace/memory/
├── global.md                    runtime-wide
├── mistakes.md                  reflection writes, agent reads
├── market_regimes.md            weekly review + news skill
├── skill_learnings.md           per-skill insights
└── strategy_learnings/<id>.md    per-strategy

Plain markdown. You can read it, diff it, version-control it. Nothing reaches a prompt without passing the firewall first. The built-in notebook is always on; optional plug-ins add memsearch (Milvus + embedding model) or agentmemory (external service).

08 · SKILL.md is the only definition

Skills

Every capability lives under nerya/skills/builtin/<name>_skill/.

skill layout
SKILL.md       when to use, workflow, examples
scripts/       executable helpers, JSON in, JSON out
references/    lazy-loaded methodology and research playbooks
templates/     code and config templates

All 25 built-ins ship today:

tradingstrategy_authorbacktest triggerstasksmarkets market_data_routingnews_socialresearch analysismarket_researchquant_research equity_researchdcf_valuationsec_filings research_reportexpert_investorsagents teammemoryevolve llmcodingbrowser notify

See the full skill reference: all 25 built-ins grouped by family, with when-to-use and flow for each.

09 · every order earns its fill

Trading kernel

order path
TradeIntent → RiskGate → ApprovalGate → PaperExecution | LiveConnector
                                                 │
                                                 ▼
                          VirtualLedger · positions · PnL · reconciliation
  • Risk Gate checks live status, limits, ledger, confidence, slippage, staleness, duplicates, conflicts. One failure stops the order.
  • Approval Gate routes over-threshold intents to the operator queue.
  • One JSONL session per run records trigger, context, decision, intent, risk verdict, execution, messages, outcome, review, and reflection.
  • CCXT adapter for Binance, Bybit, OKX, Hyperliquid. On-chain: BSC (PancakeSwap v2), Solana (Jupiter), generic EVM via eth_account.

10 · author a missing venue

Adding a new exchange

You don't have to wait for a release. Ask the agent.

youAdd Bitget perpetual futures. Here are the API docs: https://bitgetlimited.github.io/apidoc/en/

The coding skill checks the CCXT bridge first (100+ venues already wired). If your venue is one of them, the agent registers an alias and you're done. If not, the agent drops a new workspace/providers/<id>/provider.py exposing a SPEC constant, calls ConnectorRegistry.reload_providers() for hot-reload, and verifies with connector_view. No daemon restart, no source-tree commit.

11 · what wakes the agent

Triggers

workspace/triggers/routes.yml maps a kind to a target: the main agent, a sub-agent, or a direct skill.

cronwebhookgateway inbound price breakoutfunding spikenews keyword whale walletsession closemanual operator

Idempotency keys, dry-run, and dedupe are built in.

12 · one contract per platform

Gateway

Telegram, Discord, Slack, Feishu, WeCom, DingTalk, WhatsApp, and a generic webhook share one universal messaging surface.

http
GET  /gateway/platforms     # support matrix
POST /gateway/inbound       # normalized inbound messages
POST /gateway/send          # outbound via native or webhook channels
Tokens never sit in config

Plaintext tokens get rewritten as vault:// refs the moment you submit them. Trade notifications fan out through messaging/pipeline.py to every configured channel.

13 · the surface your scripts import

SDKs

The SDKs never touch keys, exchanges, or RPCs. They are thin clients over the local daemon, which enforces every skill permission, risk gate, and approval gate.

python
from nerya_sdk import connect

client = connect()
client.triggers.emit(
    source="script",
    kind="price.breakout",
    payload={"symbol": "BTC", "price": 82_000},
    target="subagent:market_analyst",
    strategy_id="btc_momentum",
)
typescript
import { connect } from "@nerya/sdk";

const nerya = connect({
  baseUrl: "http://127.0.0.1:18317",
  caller: "script:my_bot",
});
await nerya.trading.submitIntent({
  strategy_id: "btc_momentum",
  account_id: "paper_main",
  market: "PAPER:BTCUSDT",
  side: "buy",
  size: 0.01,
  size_unit: "base",
  order_type: "market",
  confidence: 0.6,
  reasoning: "ts-sdk demo",
});
SurfacePathWhat it does
Pythonsdk/python/nerya_sdk/Thin client: triggers, trading, LLM, strategy, memory.
TypeScript@nerya/sdkSame surface. Node, Bun, and Edge friendly.
MCPnerya/mcp/Exposes every skill as an MCP tool for Claude Desktop, Cursor, etc.
ACPnerya/acp/Agent-to-agent bridges for inter-swarm communication.

The recipes page has runnable Python and TypeScript examples: price-breakout slices, tiered news watchers, funding and whale triggers, and more.

14 · the hot keys stay cold

Security & safety

  • Go live the moment runtime.live_trading_enabled: true and the Approval Gate signs off. Until then, orders fill in simulation.
  • No raw secrets reach agent context, only secret_ref and redacted previews. SecretVault resolves vault:// refs in-memory for one call, then discards them.
  • No direct exchange calls from agent-authored code. Every external call goes through a registered skill, then a connector, then a signer.
  • Scripts run in a sandbox: whitelisted imports, JSON I/O, manual approval before first run, no bypass of the Trading SDK or Risk Gate.
  • Evolution can mutate prompts, scripts, skills, routes, and strategy configs, but never limits.yml, live_trading_enabled, signer policy, or secret policy.

15 · drive it from the terminal

CLI reference

CommandWhat it does
nerya setup --tuiRich text setup wizard (password, LLM, gateway, memory, account).
nerya setup --webSame wizard in the browser at :18317/setup.
nerya serve --port 18317Boot the local daemon (host service, dashboard proxy, SDK target).
nerya … init --workspace ~/.neryaCreate a fresh workspace.
nerya … skill listInspect installed skills.
nerya … strategy history <id>Review a strategy's session ledger.
nerya … reflectWrite memory entries from closed sessions.
nerya … evolveProduce typed evolution proposals.
nerya … proposals listList pending proposals awaiting your signature.
Ports

One local port by default: 18317 (daemon, host service, dashboard proxy, SDK target). The dashboard ships under dashboard/ on :18380. Point clients at a new URL via the NERYA_API environment variable.

16 · what ships in nerya/* today

Module map

ModuleWhat it owns
agent/Kernel, planner, context builder, memory, working memory, reflection.
subagents/Per-role runtimes with allow/denylists, budget caps, parallel dispatcher, aggregator.
teams/Durable Agent Team: config, store, mailbox, blackboard, templates, orchestrator, gates.
triggers/Cron + trigger router, schedules.yml, idempotency, dry-run.
skills/SKILL.md kernel + 25 built-in skills.
trading/TradeIntent, RiskGate, ApprovalGate, paper execution, virtual ledger, PnL, reconciliation.
connectors/CCXT adapter, native EVM/BSC/Solana, dynamic provider spec.
llm/ModelRouter, OpenAI/Anthropic/Gemini/Ollama adapters, credential pool, tiers, budget.
security/Vault, signer, prompt firewall, redaction, output validator, script sandbox.
evolution/Reflection engine, typed proposals, operator-signed promotion, snapshot rollback.
messaging/Universal gateway across Telegram, Discord, Slack, Feishu, WeCom, DingTalk, WhatsApp, webhooks.
mcp/, acp/FastMCP server + ACP adapter for external agent ecosystems.

17 · what works, what's next

Status & license

  • Vertical slice end-to-end: init → skill list → trigger → sub-agent turn → TradeIntent → Risk Gate → first fill → history → review → reflect → proposals.
  • Agent Team Phase 1-4 live: durable core, templates, orchestrator, planner/kernel integration, skill + HTTP surface.
  • CEX live-signed orders for Binance, Bybit, OKX, Hyperliquid. DEX swaps for BSC PancakeSwap v2 and Solana Jupiter.
  • Cross-platform one-line installer with service registration.
  • Dashboard (Next.js 14): Setup, Chat, Strategies, Self-Evolution, Memory, Skills, Workflows, Inbox, Portfolio, Gateway, Env Vault, Settings.
  • Agent Team Phase 5: snapshot and replay.
  • More native gateway adapters: Feishu rich cards, Discord slash commands, WhatsApp Business.
License

Nerya is released under the PolyForm Noncommercial License 1.0.0. Free for personal use, research, nonprofits, and schools. Commercial use needs a separate license. Open a GitHub issue describing your use case.

Ready to run it?

Built for operators who want an agent that thinks, trades, remembers, and grows up without ever holding the hot keys.