Creating and Configuring Agents

Agents are the core abstraction in Nestor. Each agent has a role, an LLM adapter, a set of tools, and configurable guardrails.

Creating Agents

Use the CLI to create a new agent with an interactive wizard or flags:

# Interactive wizard
nestor agent create

# With flags
nestor agent create \
  --name coder \
  --adapter claude \
  --model claude-sonnet-4-6 \
  --description "A senior developer that writes clean TypeScript"

# List all agents
nestor agent list

# Show agent config
nestor agent config coder

Configuration

Agent configuration is stored in .nestor/agents/{name}.yaml. Here is a complete example:

# .nestor/agents/coder.yaml
name: coder
description: Senior TypeScript developer
adapter: claude
model: claude-sonnet-4-6

# System prompt / role instructions
instructions: |
  You are a senior TypeScript developer.
  Write clean, well-tested code.
  Always explain your reasoning.

# Tool access
tools:
  - file_read
  - file_write
  - shell_exec
  - web_search

# Guardrails
guardrails:
  max_iterations: 25
  max_tokens_per_turn: 8192
  require_approval:
    - file_write
    - shell_exec
  blocked_commands:
    - rm -rf
    - sudo

# Cost budget
budget:
  max_per_session: 5.00
  max_per_day: 20.00
  currency: USD

# Memory configuration
memory:
  enabled: true
  context_window: 200000
  rag_enabled: true

LLM Adapters

Nestor supports 6 LLM providers through a unified adapter interface:

AdapterProviderModels
claudeAnthropicclaude-sonnet-4-6, claude-opus-4-6, haiku
openaiOpenAIgpt-4o, gpt-4o-mini, o1, o3
geminiGooglegemini-2.5-pro, gemini-2.5-flash
grokxAIgrok-3, grok-3-mini
mistralMistralmistral-large, codestral
ollamaLocalllama3.2, codellama, deepseek-coder

All adapters implement the same LlmAdapter interface, so switching between providers is a one-line config change.

Model Router

The model router automatically selects the best model based on task complexity and budget:

# In agent config, use "auto" to enable routing
adapter: auto
model_preferences:
  - claude-sonnet-4-6   # preferred
  - gpt-4o              # fallback
  - ollama/llama3.2     # local fallback

Tools

Agents interact with the world through tools. Nestor provides built-in tools and supports custom tools via MCP (Model Context Protocol).

Built-in Tools

ToolDescription
file_readRead files from the working directory
file_writeCreate or modify files
shell_execExecute shell commands (sandboxed)
web_searchSearch the web for information
web_fetchFetch content from URLs

Requiring Approval

For sensitive tools, you can require user approval before execution:

guardrails:
  require_approval:
    - file_write      # ask before writing files
    - shell_exec      # ask before running commands

Skills

Skills are reusable capabilities defined as SKILL.md files with system prompts, tool configurations, and instructions.

# Install a skill from the registry
nestor skill install code-reviewer

# Install from git
nestor skill install https://github.com/user/my-skill.git

# List installed skills
nestor skill list

Memory

Agents maintain memory across sessions using a combination of:

memory:
  enabled: true
  context_window: 200000    # max tokens in context
  rag_enabled: true          # enable codebase RAG
  rag_paths:                 # directories to index
    - src/
    - docs/

Cost Budgets

Prevent runaway costs with per-session and per-day budgets:

budget:
  max_per_session: 5.00    # hard stop at $5/session
  max_per_day: 20.00       # daily limit across all sessions
  warn_at: 0.80            # warn at 80% of budget

When the budget is reached, the agent gracefully stops and reports its progress.

Trust Score

Every agent gets a trust score from A to F, computed from real execution history:

GradeRangeMeaning
A90-100Highly reliable, consistently accurate
B80-89Reliable with minor issues
C70-79Functional but needs improvement
D60-69Unreliable, frequent errors
F0-59Should not be used autonomously

The score is based on:

Tip: Use nestor agent trust coder to view a detailed trust breakdown for any agent.