Agent Team
A durable, role-typed team with a leader, analysts, a risk critic, a shared blackboard, a task board, a mailbox, and gates.
Operator manual · self-evolving runtime
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.
01 · README front door
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.
Live trading stays off until you sign for it. Mistakes go into memory, not into your wallet.
02 · what carries the product
A durable, role-typed team with a leader, analysts, a risk critic, a shared blackboard, a task board, a mailbox, and gates.
Reflection writes typed proposals between sessions. The operator signs. The runtime applies with a rollback snapshot.
Five typed markdown surfaces: global, mistakes, market regimes, skill learnings, and per-strategy. Read it, diff it, version it.
SKILL.md firstEvery capability is a directory with SKILL.md as the only definition surface. 25 ship today.
Trading primitives instead of raw tool calls: Risk Gate, Approval Gate, live/paper separation, virtual ledger, reconciliation.
Thin Python & TypeScript clients over the local daemon, plus a universal messaging gateway across eight platforms.
| Concern | Most agent frameworks | Nerya |
|---|---|---|
| Trading primitives | Tool calls against exchange SDKs | Risk Gate, Approval Gate, live/paper separation, virtual ledger, reconciliation |
| Memory | A vector blob, maybe | 5 typed markdown surfaces |
| Self-improvement | You write the prompts | Reflection writes proposals; operator signs; runtime applies with rollback |
| Multi-agent | Loose function calls | Durable team with leader, analysts, risk critic, blackboard, gates |
| Connectors | One SDK per venue | 6 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 |
| Ops | Write your own supervisor | One-liner installer + systemd / launchd / NSSM service |
03 · zero to a first fill
# 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:
uv if missing,~/.nerya/src and runs uv sync --extra trading,nerya shim into ~/.local/bin,~/nerya-ws,18317.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.
# 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
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.
┌──────────────────────────── 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
A TeamRun is a durable team config that persists across
turns. It carries the whole standing team and the rules that keep it
honest.
execution_planner cannot touch trading.
Three ship today: market_analysis_team,
strategy_design_team, and trade_decision_committee.
Drop new ones under nerya/teams/templates.
06 · the loop closes
After each closed session, reflection.py writes memory
entries. nerya/evolution/ reads those entries and produces
typed proposals.
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
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
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
Every capability lives under
nerya/skills/builtin/<name>_skill/.
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:
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
TradeIntent → RiskGate → ApprovalGate → PaperExecution | LiveConnector
│
▼
VirtualLedger · positions · PnL · reconciliation
eth_account.10 · author a missing venue
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
workspace/triggers/routes.yml maps a kind to a
target: the main agent, a sub-agent, or a direct skill.
Idempotency keys, dry-run, and dedupe are built in.
12 · one contract per platform
Telegram, Discord, Slack, Feishu, WeCom, DingTalk, WhatsApp, and a generic webhook share one universal messaging surface.
GET /gateway/platforms # support matrix
POST /gateway/inbound # normalized inbound messages
POST /gateway/send # outbound via native or webhook channels
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
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.
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",
)
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",
});
| Surface | Path | What it does |
|---|---|---|
| Python | sdk/python/nerya_sdk/ | Thin client: triggers, trading, LLM, strategy, memory. |
| TypeScript | @nerya/sdk | Same surface. Node, Bun, and Edge friendly. |
| MCP | nerya/mcp/ | Exposes every skill as an MCP tool for Claude Desktop, Cursor, etc. |
| ACP | nerya/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
runtime.live_trading_enabled: true and the Approval Gate signs off. Until then, orders fill in simulation.secret_ref and redacted previews. SecretVault resolves vault:// refs in-memory for one call, then discards them.limits.yml, live_trading_enabled, signer policy, or secret policy.15 · drive it from the terminal
| Command | What it does |
|---|---|
nerya setup --tui | Rich text setup wizard (password, LLM, gateway, memory, account). |
nerya setup --web | Same wizard in the browser at :18317/setup. |
nerya serve --port 18317 | Boot the local daemon (host service, dashboard proxy, SDK target). |
nerya … init --workspace ~/.nerya | Create a fresh workspace. |
nerya … skill list | Inspect installed skills. |
nerya … strategy history <id> | Review a strategy's session ledger. |
nerya … reflect | Write memory entries from closed sessions. |
nerya … evolve | Produce typed evolution proposals. |
nerya … proposals list | List pending proposals awaiting your signature. |
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 | What 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
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.
Built for operators who want an agent that thinks, trades, remembers, and grows up without ever holding the hot keys.