Skip to content

Build an agent

Neureus agents run a ReAct (Reason + Act) loop — they think, select a tool, observe the result, and repeat until done. Each run is logged to an immutable audit trail.

  1. Create an agent

    Terminal window
    curl -X POST https://app.neureus.ai/agents \
    -H "Authorization: Bearer nru_your_key" \
    -H "Content-Type: application/json" \
    -d '{
    "name": "Support Agent",
    "description": "Answers customer questions using the knowledge base",
    "model": "claude-sonnet-4-6",
    "systemPrompt": "You are a helpful support agent. Use the provided tools to answer questions accurately.",
    "tools": [
    { "type": "rag_query", "config": {} }
    ]
    }'

    Response:

    { "agentId": "agent_abc123", "name": "Support Agent", "status": "active" }
  2. Run the agent

    Terminal window
    curl -X POST https://app.neureus.ai/agents/agent_abc123/run \
    -H "Authorization: Bearer nru_your_key" \
    -H "Content-Type: application/json" \
    -d '{
    "input": "What is your refund policy?",
    "sessionId": "session_user_456"
    }'

    The agent runs up to 10 ReAct iterations, then returns:

    {
    "output": "Our refund policy allows returns within 30 days of purchase...",
    "steps": 3,
    "runId": "run_xyz789"
    }
  3. View the audit log

    Terminal window
    curl https://app.neureus.ai/agents/agent_abc123/runs/run_xyz789 \
    -H "Authorization: Bearer nru_your_key"

    Returns each ReAct iteration: thought, tool selected, tool output, next thought.

Agent CRUD

GET /agents List all agents
GET /agents/:agentId Get an agent
PUT /agents/:agentId Update an agent
DELETE /agents/:agentId Delete an agent