Configuration Overview

NOMOS provides flexible configuration through both YAML files and Python API, supporting everything from no-code to full-code development approaches.

Field Naming Compatibility

Flexible Field NamingNOMOS supports both compact and descriptive field names for better flexibility and easier migration from older configurations.
Compact FormDescriptive FormDescriptionUsage
idstep_id / flow_idUnique identifierSteps and flows
descdescriptionHuman-readable descriptionSteps and flows
toolsavailable_toolsAvailable tools listSteps
pathsroutesStep transitionsSteps
totargetRoute target stepRoutes
whenconditionRoute conditionRoutes
egexamplesDecision examplesSteps
steps:
  - id: start
    desc: Greet the user
    tools: [greet]
    paths:
      - to: end
        when: User is done
    eg:
      - context: "User says hello"
        decision: "Greet warmly"

YAML Configuration

Basic Agent Configuration

name: utility-bot
persona: You are a helpful utility bot that can perform various calculations.

# Step definitions
steps:
  - step_id: start
    description: Handle user requests for mathematical operations.
    available_tools:
      - sqrt
      - calculate_area
    routes:
      - target: end
        condition: User is done with calculations

  - step_id: end
    description: Say goodbye to the user.

start_step_id: start
max_errors: 3
max_iter: 5

# LLM configuration
llm:
  provider: openai
  model: gpt-4o-mini

Advanced Configuration Example

# Agent identity
name: barista
persona: |
  You are a helpful barista assistant at Starbucks.
  You are kind, polite, and professional.

start_step_id: start

# Step workflow
steps:
  - step_id: start
    description: |
      Greet customers and understand their needs.
      Use available tools to show menu options if needed.
    available_tools:
      - get_available_coffee_options
    routes:
      - target: take_coffee_order
        condition: Customer is ready to place an order
    examples:
      - context: "Customer asks for coffee options"
        decision: "Call get_available_coffee_options tool"
        visibility: "always"

  - step_id: take_coffee_order
    description: |
      Take customer orders including type, size, and modifications.
    available_tools:
      - get_available_coffee_options
      - add_to_cart
      - remove_item
      - clear_cart
    routes:
      - target: finalize_order
        condition: User wants to finalize the order
      - target: end
        condition: Customer wants to cancel

  - step_id: finalize_order
    description: |
      Get order summary and confirm with customer.
    available_tools:
      - get_order_summary
      - finalize_order
    routes:
      - target: end
        condition: Order is finalized or canceled
      - target: take_coffee_order
        condition: Customer wants to modify order

  - step_id: end
    description: Clear cart and end conversation graciously.
    available_tools:
      - clear_cart

# Enhanced flows
flows:
  - flow_id: order_management
    description: "Complete coffee ordering workflow"
    enters:
      - take_coffee_order
    exits:
      - finalize_order
      - end
    components:
      memory:
        llm:
          provider: openai
          model: gpt-4o-mini
        retriever:
          method: embedding

# Tool configuration
tools:
  tool_files:
    - barista_tools.py
  tool_defs:
    add_to_cart:
      args:
        - key: coffee_type
          desc: "Type of coffee (e.g., Espresso, Latte)"
        - key: size
          desc: "Size (Small, Medium, Large)"

# LLM configuration
llm:
  provider: openai
  model: gpt-4o-mini

# Server configuration
server:
  port: 8000
  workers: 1

# Session storage
session:
  store_type: memory
  default_ttl: 3600

Python API Configuration

Basic Python Setup

from nomos import Agent, AgentConfig, Step, Route
from nomos.llms import OpenAI
from nomos.models.flow import FlowConfig

def get_time():
    """Get the current time."""
    from datetime import datetime
    return f"Current time: {datetime.now()}"

# Define steps
steps = [
    Step(
        step_id="start",
        description="Greet and offer to tell time or do calculations.",
        available_tools=["get_time"],
        routes=[
            Route(target="calculation", condition="User wants math"),
            Route(target="end", condition="User is done")
        ],
    ),
    Step(
        step_id="calculation",
        description="Perform mathematical calculations.",
        available_tools=["sqrt", "pow"],
        routes=[Route(target="end", condition="Calculation complete")],
    ),
    Step(
        step_id="end",
        description="Say goodbye.",
    ),
]

# Define flows
flows = [
    FlowConfig(
        flow_id="math_workflow",
        description="Handle mathematical calculations",
        enters=["calculation"],
        exits=["end"],
        components={
            "memory": {
                "llm": {"provider": "openai", "model": "gpt-4o-mini"}
            }
        }
    )
]

# Create configuration
config = AgentConfig(
    name="clockbot",
    persona="You are a friendly assistant for time and calculations.",
    steps=steps,
    flows=flows,
    start_step_id="start",
    llm={"provider": "openai", "model": "gpt-4o-mini"},
    max_errors=3,
    max_iter=5,
)

# Create and use agent
agent = Agent.from_config(config, tools=[get_time])
session = agent.create_session()

LLM Configuration

Supported Providers

llm:
  provider: openai
  model: gpt-4o-mini
Requires: OPENAI_API_KEY

Tool Configuration

Integrated Tool Configuration (v0.2.4+)

tools:
  tool_files:
    - "barista_tools.py"           # Python module
    - "tools.my_tools"             # Package path

  external_tools:
    # Python package tools
    - tag: "@pkg/itertools.combinations"
      name: "combinations"

    # CrewAI tools
    - tag: "@crewai/FileReadTool"
      name: "file_read_tool"

    # LangChain tools
    - tag: "@langchain/google_search"
      name: "google_search"

    # MCP tools
    - tag: '@mcp/https://gitmcp.io/dowhiledev/nomos'
      name: gitmcp

    # API tools - Single endpoint
    - tag: "@api/GET/https://api.github.com/users/{username}"
      name: "get_github_user"

    # API tools - Multiple endpoints
    - tag: "@api/https://jsonplaceholder.typicode.com"
      name: "posts_api"
      map:
        get_posts: "GET/posts"
        get_post: "GET/posts/{id}"
        create_post: "POST/posts"
        update_post: "PUT/posts/{id}"
        delete_post: "DELETE/posts/{id}"
      headers:
        Authorization: "Bearer ${API_TOKEN}"

  tool_defs:
    add_to_cart:
      desc: "Add item to cart"
      args:
        - key: coffee_type
          desc: "Type of coffee (e.g., Espresso, Latte)"
          type: str
        - key: size
          desc: "Size (Small, Medium, Large)"
          type: str

    get_github_user:
      desc: "Get GitHub user information"
      args:
        - key: username
          desc: "GitHub username"
          type: str
        - key: per_page
          desc: "Number of results per page"
          type: int
          default: 30

    get_posts:
      desc: "Get all posts from API"
      args:
        - key: page
          desc: "Page number"
          type: int
          default: 1
        - key: limit
          desc: "Number of posts per page"
          type: int
          default: 10

Custom Tool Files

# tools/my_tools.py
def greet(name: str) -> str:
    """Return a personalized greeting."""
    return f"Hello {name}!"

def calculate_tip(bill: float, percentage: float = 15.0) -> float:
    """Calculate tip amount."""
    return bill * (percentage / 100)

# Export tools for discovery
tools = [greet, calculate_tip]

Configuration Validation

Always ValidateUse nomos validate before deploying to catch configuration errors early.

Validation Command

nomos validate config.agent.yaml --verbose

What Gets Validated

Syntax & Structure

YAML syntax, required fields, data types

Reference Integrity

Step IDs, route targets, flow references

Best Practices

Configuration recommendations

Field Compatibility

Both compact and descriptive naming

Example Validation Output

 Configuration is valid!

Configuration Details:
├─ Agent Name: barista
├─ Number of Steps: 4
├─ Start Step ID: start
├─ LLM Provider: openai
└─ Session Store: memory

Warnings:
 Step 'calculation' has no examples - consider adding some

Recommendations:
 Add persona for more engaging interactions
 Consider using flows for complex workflows

Session Store Configuration

session:
  store_type: memory
  default_ttl: 3600
Sessions stored in memory, lost on restart.

Environment Variables

VariableDescriptionRequired
OPENAI_API_KEYOpenAI API keyIf using OpenAI
MISTRAL_API_KEYMistral API keyIf using Mistral
GOOGLE_API_KEYGoogle API keyIf using Gemini
HUGGINGFACE_API_TOKENHuggingFace tokenIf using HuggingFace
DATABASE_URLDatabase connectionIf using production session store
REDIS_URLRedis connectionIf using Redis caching

Configuration Examples

Schema Generation

Generate JSON schema for IDE support:
nomos schema --output agent.schema.json
Use in your YAML files:
# yaml-language-server: $schema=./agent.schema.json
name: my-agent
# Your configuration gets autocompletion and validation