nexo-core
The runtime engine of Nexo —
AgentRuntime,SessionManager,EventBus,Heartbeat, plus the LLM-facing tool registry and per-binding capability resolver. Every other crate in the workspace depends on this one.
This crate is part of Nexo — a multi-agent Rust framework with a NATS event bus, pluggable LLM providers (MiniMax, Anthropic, OpenAI-compat, Gemini, DeepSeek), per-agent credentials, MCP support, and channel plugins for WhatsApp, Telegram, Email, and Browser (CDP).
- Main repo: https://github.com/lordmacu/nexo-rs
- Runtime engine: this crate
- Public docs: https://lordmacu.github.io/nexo-rs/
What this crate does
Runtime
AgentRuntime— owns every agent's lifecycle, intake hot path (per-binding rate limiter, pairing gate, credential resolver, redaction, link-understanding pre-fetch), and the agent loop that drives turns + dispatches tool calls.SessionManager— per-(agent_id, channel, instance, sender_id)session, debounced inbound + queue cap.AgentBehaviortrait — what an agent actually does on each turn. The defaultLlmBehaviorruns the LLM agent loop; custom behaviours plug in here for non-LLM agents.
Tools
ToolRegistry+ per-session filtered cache (Phase 18 hot-reload aware).- Built-in tools —
web_search,web_fetch(Phase 21 + W-2),taskflow,memory_*,session_logs,delegation,heartbeat,mcp.*,forge_memory_checkpoint/memory_history(workspace-git memory). ToolHandlertrait for declaring new tools.
Memory + transcripts
- Transcript writer + FTS5 index for
session_logs search. - Redaction module — opt-in regex redactor with 6 built-in patterns (Bearer JWT, sk-/sk-ant- API keys, AWS access key, hex token, home path) + operator-defined extras.
- Workspace-git memory (Phase 10.9) — per-agent git repo for SOUL.md / MEMORY.md persistence, dreaming sweeps, forensics.
Capability resolution
EffectiveBindingPolicy(Phase 16) — merges agent-level- binding-level policy at intake; cached on
AgentContextfor the turn.
- binding-level policy at intake; cached on
- Per-agent credentials via
nexo-authresolver (Phase 17), wired into every tool that needs upstream API keys. - Hot-reload (Phase 18) —
ArcSwap<RuntimeSnapshot>for atomic config swap mid-session.
Phase 21 — link understanding
LinkExtractor— fetches user-shared URLs, runs the readability-shaped extractor (Phase 21 L-2), caches in an LRU. Surfaces summaries via the# LINK CONTEXTblock in the prompt.
Pairing (Phase 26)
PairingGateconsulted on every inbound before the per-sender rate limiter;PairingAdapterRegistryresolves the per-channel adapter for outbound challenge delivery.
Public API surface
This crate is large; the most operator-relevant types:
| Type | Purpose |
|---|---|
AgentRuntime |
Top-level runtime constructor |
AgentBehavior trait |
Plug-in custom non-LLM behaviours |
ToolHandler trait |
Register new tools |
EffectiveBindingPolicy |
Per-binding merged config |
LinkExtractor |
Fetch + extract URL contents |
WebSearchTool, WebFetchTool, TaskFlowTool, etc. |
Built-in tools |
redaction::Redactor |
Pre-persistence redaction |
Install
[]
= "0.1"
Documentation for this crate
- Architecture overview
- Agent runtime
- Transcripts (FTS + redaction)
- Link understanding
- Web fetch
- Per-agent credentials
- Hot-reload
- Agent-to-agent delegation recipe
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT license (LICENSE-MIT)
at your option.