Skip to main content

25 - Claude Agent SDK and Managed Agents: Production-Grade Agents

Claude Agent SDK e Managed Agents: Production-Grade Agents Il 29 settembre 2025, Claude Code SDK è stato ufficialmente rinominato Claude Agent SDK - un...

What do you think about this article?

At a Glance

Claude Agent SDK e Managed Agents: Production-Grade Agents Il 29 settembre 2025, Claude Code SDK è stato ufficialmente rinominato Claude Agent SDK - un...

Claude Agent SDK and Managed Agents: Production-Grade Agents

On September 29, 2025, Claude Code SDK was officially renamed Claude Agent SDK - a change that reflects the evolution from a simple CLI tool to a framework complete for creating AI agents who operate in production. As of April 2026, with the arrival of Managed Agents in public beta, the panorama changes further: fully managed harness, isolated sandbox, integrated tools, support for SSE streaming and persistent sessions. This article explores how to build production-grade agents in Python and TypeScript, integrate Spring Boot and Angular, and choose between local SDK and Managed Managed Agents.

What You Will Learn

  • Differences between Claude Code SDK and Claude Agent SDK
  • Basic architecture of SDK agents in Python and TypeScript
  • How to build specialized agents with ClaudeAgentOptions
  • Integrate agents with Spring Boot backend and Angular frontend
  • Programmatic subagents for complex orchestration
  • Managed Agents: when to use them and how to configure them
  • ant CLI: Command-line client for Claude API
  • Memory for Managed Agents (beta, April 23, 2026)
  • Comparison: Local SDK vs Hosted Managed Agents

Complete Series Overview (Claude Series, 25 items)

#ItemFocus
1Claude as Technical PartnerSetup and first steps
2Project Context and SetupCLAUDE.md and configuration
3Concept and RequirementsMVP and user personas
4Backend and Frontend ArchitectureSpring Boot and Angular
5Structure of the CodeOrganization and conventions
6Advanced Engineering PromptAdvanced techniques
7Testing and qualityStrategies and test generation
8Professional DocumentationREADME, API, ADR
9Deploy and DevOpsDocker, CI/CD, monitoring
10Evolution and MaintenanceRefactoring and scalability
11Real Project IntegrationClaude Code in production
12Claude Code CLICommands and configuration
13Agent SkillsModular capabilities
14Specialized SubagentsAgents with specific roles
15Hooks and AutomationEvent-driven workflows
16Ralph Wiggum MethodTest-driven development
17BMAD MethodStructured project management
18Multi-Agent OrchestrationAgent pipeline
19Collaborative WorkTeam and pair programming AI
20Security and Best PracticesHardening and compliance
21Monitoring and ObservabilityMetrics and debugging
22Token Economy and CostsBudget Optimization API
23Feedback Loop and Continuous ImprovementIteration and user feedback
24Advanced PatternsAgents with memory and context
25Claude Agent SDK & Managed Agents (you are here)Production-grade agents

1. From Claude Code SDK to Claude Agent SDK (September 29, 2025)

Until September 28, 2025, Anthropic's official framework was named Claude Code SDK. The term Code reflected the origin as tool for developers working with source code. In October 2025, the rebrand a Claude Agent SDK reported an expansion of scope: built agents with this SDK they no longer limit themselves to reading/modifying files, but operate as autonomous entities who orchestrate complex tasks, coordinate subagents, manage workflows and interact with external systems (databases, APIs, webhooks).

What remained the same

La surface API has not changed. If you have written code with Claude Code SDK until September 2025, your code continues to work unchanged. The rebrand it's mostly a matter of nomenclature and how the framework is perceived from the community.

What's new

The name Agent SDK emphasizes new capabilities that arrive progressively:

  • Managed Agents (April 2026): Cloud-hosted version of the framework with orchestrated harness
  • Memory persistence (April 2026): Automatically managed cross-session memory
  • Built-in tools: Pre-integrated standard tools (file operations, web fetch, SQL)
  • SSE streaming: Streaming agent responses in real time
  • Sandbox isolation: Agents run in isolated containers with resource constraints
  • ant CLI: Native command-line client for Claude API and Managed Agents

2. Architecture of the Agent SDK

The Agent SDK is available for Python e TypeScript. Both SDKs share the same conceptual architecture:

Core Components of the Agent SDK

ComponenteDescrizioneUso
ClaudeAgent Classe principale che rappresenta un agente Istanza di un agente con personalità e capabilità
ClaudeAgentOptions Configurazione dell'agente (system prompt, model, tools) Setup agentespecifico
Tool Azione che l'agente può eseguire (function call) Callback registrati dall'utente
Session Contesto conversazionale persistente Memoria inter-turno della conversazione
Message Unità di comunicazione (user input, agent response) Scambio di messaggi

Flusso di Esecuzione Base

Ecco il flusso base di un agente SDK:

  1. Inizializzazione: creare ClaudeAgent con ClaudeAgentOptions
  2. Registrazione tool: indicare all'agente quali azioni può eseguire
  3. User message: l'utente invia un prompt all'agente
  4. Agent reasoning: Claude legge il prompt e decide il prossimo step (thinking o tool use)
  5. Tool execution: se Claude decide di usare un tool, esegui la callback
  6. Feedback loop: passa il risultato del tool a Claude, che decide il next step
  7. Response: quando Claude decide di rispondere, restituisci il risultato all'utente

3. Agente Specializzato in Python: Test JUnit Generator

Vediamo come costruire un agente Python che genera test JUnit per classi Java Spring Boot. L'agente legge il codice sorgente, lo analizza e produce test completi.

Python: Agente Test JUnit Generator
#!/usr/bin/env python3
# test_generator_agent.py

from anthropic_agent import ClaudeAgent, ClaudeAgentOptions, Tool
from pathlib import Path
import json

# 1. Definire il system prompt dell'agente
SYSTEM_PROMPT = """
Sei un esperto di Java e Spring Boot che genera test JUnit5 di alta qualità.
Quando ricevi una classe Java, produci:
1. Unit test per ogni metodo pubblico
2. Mock delle dipendenze Autowired
3. Test per happy path e edge case
4. Assertions complete e meaningful
5. Supporto per Testcontainers se necessario (DB, Redis)

Segui le convenzioni:
- Nomi test: testMethodName_Condition_ExpectedResult
- Use @DisplayName per descrizioni leggibili
- Import Mockito per mock
- Import AssertJ per fluent assertion
"""

def read_java_file(path: str) -> str:
  """Tool callback: leggi un file Java"""
  file_path = Path(path)
  if not file_path.exists():
    return f"ERROR: File non trovato: {path}"
  with open(file_path, 'r') as f:
    return f.read()

def write_test_file(path: str, content: str) -> str:
  """Tool callback: scrivi il file di test"""
  file_path = Path(path)
  file_path.parent.mkdir(parents=True, exist_ok=True)
  with open(file_path, 'w') as f:
    f.write(content)
  return f"Test file scritto: {path}"

def analyze_class_structure(java_code: str) -> str:
  """Tool callback: analizza struttura della classe"""
  # In produzione, usaresti un parser Java vero (javalang, etc.)
  # Qui facciamo semplice regex per demo
  import re
  methods = re.findall(r'public\s+\w+\s+(\w+)\s*\(', java_code)
  fields = re.findall(r'@Autowired\s+private\s+\w+\s+(\w+);', java_code)
  return json.dumps({
    "methods": methods,
    "autowired_fields": fields,
    "line_count": len(java_code.split('\n'))
  })

# 2. Istanziare l'agente con tools
agent = ClaudeAgent(
  options=ClaudeAgentOptions(
    model="claude-opus-4-20250514",
    system_prompt=SYSTEM_PROMPT,
    max_tokens=8000
  )
)

# 3. Registrare i tool disponibili per l'agente
agent.register_tool(
  name="read_java_file",
  description="Leggi il contenuto di un file Java",
  callback=read_java_file,
  parameters={
    "path": {"type": "string", "description": "Percorso file .java"}
  }
)

agent.register_tool(
  name="write_test_file",
  description="Scrivi il file di test JUnit generato",
  callback=write_test_file,
  parameters={
    "path": {"type": "string", "description": "Percorso file test"},
    "content": {"type": "string", "description": "Contenuto test"}
  }
)

agent.register_tool(
  name="analyze_class_structure",
  description="Analizza la struttura della classe (metodi, dipendenze)",
  callback=analyze_class_structure,
  parameters={
    "java_code": {"type": "string", "description": "Codice sorgente Java"}
  }
)

# 4. Eseguire l'agente
if __name__ == "__main__":
  user_input = """
  Genera test JUnit5 completi per il file
  'backend/src/main/java/dev/federicocalo/portfolio/application/service/UserService.java'

  Salva il risultato in:
  'backend/src/test/java/dev/federicocalo/portfolio/application/service/UserServiceTest.java'

  Considera che la classe ha dipendenze Autowired su UserRepository e EmailService.
  """

  response = agent.run(user_input)
  print("Agent Response:")
  print(response)

4. Agente Specializzato in TypeScript: Angular Component Generator

Vediamo come costruire un agente TypeScript che genera componenti Angular 21 standalone con form reattivi, integrazione API e test.

TypeScript: Agente Angular Component Generator
#!/usr/bin/env node
// component-generator-agent.ts

import { ClaudeAgent, ClaudeAgentOptions } from "@anthropic-ai/claude-agent";
import { execSync } from "child_process";
import { promises as fs } from "fs";
import path from "path";

// 1. System prompt dell'agente
const SYSTEM_PROMPT = `
Sei un esperto di Angular 21 che genera componenti standalone di alta qualità.
Quando ricevi una richiesta, produci:

1. Componente TypeScript standalone (.ts)
   - Usa standalone: true
   - OnPush change detection
   - Signal per stato reattivo (computed, effect)
   - Dependency injection via constructor
   - Proper typing (no 'any')

2. Template HTML (.html)
   - Binding reattivo su signal
   - Form reattivo con Validators
   - ARIA label per accessibilità
   - ngNonBindable dove necessario

3. Stile CSS scoped (.css)
   - CSS custom properties da design system
   - Mobile-first responsive
   - Transizioni fluide

4. Test Jasmine (.spec.ts)
   - 80%+ code coverage
   - Mock di servizi
   - Test user interactions

Nomi: kebab-case per file, PascalCase per classi
`;

// Tool callbacks
async function executeCommand(cmd: string): Promise {
  try {
    const result = execSync(cmd, { encoding: 'utf-8' });
    return result;
  } catch (error: any) {
    return \`ERROR: \${error.message}\`;
  }
}

async function writeFile(filePath: string, content: string): Promise {
  try {
    const dir = path.dirname(filePath);
    await fs.mkdir(dir, { recursive: true });
    await fs.writeFile(filePath, content);
    return \`File scritto: \${filePath}\`;
  } catch (error: any) {
    return \`ERROR: \${error.message}\`;
  }
}

async function readAngularStyle(): Promise {
  try {
    const styleContent = await fs.readFile(
      'src/styles.css',
      'utf-8'
    );
    // Estrai solo le variabili CSS importanti
    const lines = styleContent.split('\n')
      .filter(l => l.includes('--color-') || l.includes('--space-'))
      .slice(0, 20);
    return lines.join('\n');
  } catch {
    return "/* Design system not found */";
  }
}

// 2. Istanziare agente TypeScript
const agent = new ClaudeAgent({
  model: "claude-opus-4-20250514",
  system_prompt: SYSTEM_PROMPT,
  max_tokens: 12000
});

// 3. Registrare tool
agent.registerTool({
  name: "execute_command",
  description: "Esegui comandi bash (ng, npm, git, etc.)",
  handler: executeCommand,
  parameters: {
    cmd: { type: "string", description: "Comando da eseguire" }
  }
});

agent.registerTool({
  name: "write_file",
  description: "Scrivi contenuto su file",
  handler: writeFile,
  parameters: {
    filePath: { type: "string", description: "Percorso del file" },
    content: { type: "string", description: "Contenuto" }
  }
});

agent.registerTool({
  name: "read_angular_style",
  description: "Leggi variabili CSS del design system",
  handler: readAngularStyle,
  parameters: {}
});

// 4. Eseguire agente
async function main() {
  const userInput = \`
  Genera un componente Angular standalone "UserProfileForm" con:
  - Form reattivo per edit profilo (nome, email, bio)
  - Validation di email
  - Submit con loading state
  - Scossa di errore animata se submit fallisce
  - Signal per reactive state
  - Dipendenza su UserService (mock)
  - Test completo
  - Usa design system da src/styles.css

  Salva in: src/app/pages/user-profile-form/
  Aggiungi la route in app.routes.ts come lazy-loaded
  \`;

  const response = await agent.run(userInput);
  console.log("Agent Output:");
  console.log(response);
}

main().catch(console.error);

5. Subagenti Programmatici: Orchestrazione Multi-Agente

Uno dei pattern più potenti dell'Agent SDK è la capacità di uno parent agent di spawmare subagenti per task paralleli. Questo permette decomposizione e parallelizzazione di lavoro complesso.

Python: Parent agent con 3 subagenti paralleli
#!/usr/bin/env python3
# orchestrator_agent.py

from anthropic_agent import ClaudeAgent, ClaudeAgentOptions
import asyncio
import json

# Parent agent: compone il task
def parent_agent():
  agent = ClaudeAgent(
    options=ClaudeAgentOptions(
      model="claude-opus-4-20250514",
      system_prompt="Sei il coordinatore di un team di agenti specializzati."
    )
  )
  return agent

# Tre subagenti specializzati
def code_review_agent():
  return ClaudeAgent(
    options=ClaudeAgentOptions(
      model="claude-sonnet-4-20250514",
      system_prompt="Sei esperto di code review. Analizza il codice per bug, security, performance.",
      max_tokens=4000
    )
  )

def test_generation_agent():
  return ClaudeAgent(
    options=ClaudeAgentOptions(
      model="claude-sonnet-4-20250514",
      system_prompt="Sei esperto di testing. Genera test JUnit5 con coverage 80%+.",
      max_tokens=4000
    )
  )

def documentation_agent():
  return ClaudeAgent(
    options=ClaudeAgentOptions(
      model="claude-sonnet-4-20250514",
      system_prompt="Sei esperto di documentazione tecnica. Produci README, Javadoc, API doc.",
      max_tokens=4000
    )
  )

# Orchestrazione: parent spawna 3 subagenti in parallelo
async def orchestrate_workflow(java_code: str) -> dict:
  """
  Parent decompone il task:
  1. Subagente 1: Code review del codice
  2. Subagente 2: Generazione test
  3. Subagente 3: Documentazione

  Esegui in parallelo, raccogli risultati.
  """

  # Create subagents
  reviewer = code_review_agent()
  tester = test_generation_agent()
  documenter = documentation_agent()

  # Task paralleli
  review_task = reviewer.run(f"Esamina questo codice Java:\n{java_code[:1000]}...")
  test_task = tester.run(f"Genera test per:\n{java_code[:1000]}...")
  doc_task = documenter.run(f"Documenta:\n{java_code[:1000]}...")

  # Attendi completamento di tutti i task
  results = await asyncio.gather(
    asyncio.create_task(review_task),
    asyncio.create_task(test_task),
    asyncio.create_task(doc_task)
  )

  return {
    "code_review": results[0],
    "tests_generated": results[1],
    "documentation": results[2]
  }

# Aggregazione: parent agent legge i risultati e produce summary
def aggregate_results(subagent_results: dict):
  parent = parent_agent()

  summary_prompt = f"""
  I seguenti subagenti hanno analizzato una classe Java:

  CODE REVIEW:
  {subagent_results['code_review']}

  TEST GENERATED:
  {subagent_results['tests_generated']}

  DOCUMENTATION:
  {subagent_results['documentation']}

  Produci un report esecutivo consolidato con:
  1. Severità complessiva degli issue
  2. Copertura test stimata
  3. Completezza documentazione
  4. Action items prioritizzati
  """

  return parent.run(summary_prompt)

# Main: esegui workflow
async def main():
  # Simula lettura codice
  java_code = """
  @Service
  public class UserService {
    @Autowired
    private UserRepository userRepository;

    public User findById(Long id) {
      return userRepository.findById(id).orElse(null);
    }

    public User save(UserRequest request) {
      User user = new User();
      user.setName(request.getName());
      user.setEmail(request.getEmail());
      return userRepository.save(user);
    }
  }
  """

  print("=== Orchestrating Multi-Agent Workflow ===\n")

  # Esegui workflow parallelo
  results = await orchestrate_workflow(java_code)

  print("Subagent Results:")
  print(json.dumps(results, indent=2))

  # Aggregazione finale
  print("\n=== Final Report ===")
  final_report = aggregate_results(results)
  print(final_report)

if __name__ == "__main__":
  asyncio.run(main())

6. Managed Agents (Public Beta, 8 Aprile 2026)

I Managed Agents rappresentano l'evoluzione cloud-native dell'Agent SDK. Invece di eseguire agenti localmente sul tuo server, gli agenti vengono eseguiti su infrastruttura gestita da Anthropic, con sandbox isolato, resource limits e orchestrazione automatica.

Caratteristiche Principali dei Managed Agents

Managed Agents vs SDK Locale

AspettoAgent SDK LocaleManaged Agents
Esecuzione On your server/laptop On Anthropic infrastructure
Insulation Shared with other processes Sandbox container isolated
Scalability Limited by local resources Unlimited auto-scaling
Persistent memory In-memory, lost on reboot Managed cross-session storage
Monitoring DIY (logging, metrics) Built-in dashboard
Cost API tokens only Token + compute hosting
Built-in tools Custom only File ops, web fetch, SQL, bash
SSE streaming Not supported Natively supported

Managed Agent configuration

A Managed Agent is defined by three components: Agent Config, Environment e Sessions.

Managed Agent: Configuration with YAML
# managed-agent-config.yaml
name: "github-pr-generator"
description: "Agente che monitora repo GitHub e genera PR automatiche"

agent:
  model: "claude-opus-4-20250514"
  system_prompt: |
    Sei un agente GitHub PR bot.
    Il tuo compito è monitorare repository per issue aperte,
    e generare PR che risolvono gli issue.

    Quando vedi un issue:
    1. Leggi il description completa
    2. Clona il repo localmente (tool: bash)
    3. Crea un branch per la soluzione
    4. Implementa fix
    5. Genera il PR con description dettagliata
  max_tokens: 8000

environment:
  container:
    image: "ubuntu:24.04"
    resources:
      cpu: "1000m"
      memory: "2Gi"
    env:
      GITHUB_TOKEN: "${SECRETS.GITHUB_TOKEN}"
      GITHUB_REPO: "myorg/myrepo"

  tools:
    enabled:
      - bash          # Esegui comandi Linux
      - file_ops      # Read/write file
      - web_fetch     # HTTP requests
      - git_cli       # Git commands

    webhooks:
      - event: "issues.opened"
        url: "/webhook/github-issue"
        auth: "bearer-token"

sessions:
  max_active: 10
  timeout: 3600
  memory:
    enabled: true
    retention_days: 30

Distributed System Pattern: Agent + Backend Integration

A common pattern is to integrate a Managed Agent with a Spring Boot backend via webhooks. When an event occurs (GitHub push, issue open, etc.), the webhook notifies the backend, which spawns a Managed Agent session.

Spring Boot Controller: GitHub Webhook → Managed Agent
@RestController
@RequestMapping("/api/v1/webhook")
@RequiredArgsConstructor
public class WebhookController {

  private final ManagedAgentClient agentClient;
  private final AuditService auditService;

  @PostMapping("/github/issue")
  public ResponseEntity<?> handleGitHubIssue(@RequestBody GitHubIssueEvent event) {
    // 1. Valida signature GitHub
    if (!isValidGitHubSignature(event)) {
      return ResponseEntity.status(401).build();
    }

    // 2. Spawna sessione Managed Agent
    String agentSessionId = agentClient.createSession("github-pr-generator");

    // 3. Invia messaggio all'agente
    String prompt = String.format("""
      Nuovo issue aperto su GitHub:
      Repo: %s
      Issue #%d: %s
      Description: %s
      URL: %s

      Analizza e genera una PR che risolva l'issue.
      Usa il webhook callback per notificarmi del completamento.
      """,
      event.getRepository(),
      event.getIssueNumber(),
      event.getTitle(),
      event.getDescription(),
      event.getUrl()
    );

    agentClient.sendMessage(agentSessionId, prompt);

    // 4. Log audit
    auditService.log(AuditEvent.builder()
      .type("AGENT_SPAWNED")
      .agentSessionId(agentSessionId)
      .payload(event)
      .build()
    );

    return ResponseEntity.accepted().build();
  }

  @PostMapping("/agent/complete")
  public ResponseEntity<?> handleAgentComplete(@RequestBody AgentCompleteEvent event) {
    // Callback: l'agente ha completato il task
    String prUrl = event.getPullRequestUrl();

    // Notifica l'utente via email/Slack
    notificationService.notifyPRCreated(prUrl);

    return ResponseEntity.ok().build();
  }

  private boolean isValidGitHubSignature(GitHubIssueEvent event) {
    // Verifica HMAC signature da GitHub
    return true; // implement properly
  }
}

7. ant CLI: Command-Line Client for Claude API

front is Anthropic's official command-line client for the Claude API and Managed Agents. It is ideal for automation from bash, CI/CD pipelines, and serverless scripting.

Ant CLI installation

Install ant CLI
# macOS con Homebrew
brew tap anthropics/ant
brew install ant

# Linux / WSL
curl -fsSL https://cli.anthropic.com/install.sh | sh

# Verifica installazione
ant --version

# Primo avvio: setup API key
ant config set api-key $ANTHROPIC_API_KEY

Main Front Commands

ant CLI Commands

CommandDescriptionExample
ant messages create Send a message to Claude API ant messages create --model claude-opus --message "Ciao"
ant agents list Lists configured Managed Agents ant agents list --format json
ant agents create Create a new Managed Agent from YAML ant agents create --config agent.yaml
ant sessions create Create a new session for an agent ant sessions create --agent-id abc123
ant sessions send-message Send message to a session ant sessions send-message --session-id xyz --message "..."
ant files upload File upload (for agent file ops) ant files upload --file mycode.java

Practical Example: CI/CD Pipeline with ant

.github/workflows/agent-code-review.yml
name: Agent Code Review with ant

on:
  pull_request:
    types: [opened, synchronize]

jobs:
  agent-review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Install ant CLI
        run: |
          curl -fsSL https://cli.anthropic.com/install.sh | sh
          ant --version

      - name: Get PR diff
        id: diff
        run: |
          git fetch origin main
          git diff origin/main...HEAD > /tmp/pr.diff
          echo "diff_size=$(wc -c < /tmp/pr.diff)" >> $GITHUB_OUTPUT

      - name: Send to Agent for Review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
        run: |
          PROMPT="Esamina il seguente diff e fornisci una code review:

          \$(cat /tmp/pr.diff)

          Output JSON con:
          - severity: critical/major/minor
          - file
          - line
          - issue
          - suggestion"

          ant messages create \
            --model claude-opus-4-20250514 \
            --message "\$PROMPT" \
            --format json > /tmp/review.json

      - name: Post Review Comment
        uses: actions/github-script@v7
        with:
          script: |
            const fs = require('fs');
            const review = JSON.parse(fs.readFileSync('/tmp/review.json', 'utf8'));

            const comment = \`## Agent Code Review

            \${review.content}
            \`;

            github.rest.issues.createComment({
              owner: context.repo.owner,
              repo: context.repo.repo,
              issue_number: context.issue.number,
              body: comment
            });

8. Memory for Managed Agents (Public Beta, April 23, 2026)

On April 23, 2026, the Memory features has entered public beta for Managed Agents. Memory allows agents to remember cross-session information, learning from previous interactions.

How Memory Works

When a Managed Agent interacts with a user:

  1. Before each session, the agent reads the memory context by the user
  2. Use this context to personalize responses and decisions
  3. After the session, can add new memory update for future sessions
  4. Memory persists on Anthropic servers with versioning and audit trails
Managed Agent with Memory: Tutoring Bot
# tutoring-agent-memory.yaml
name: "java-tutoring-agent"
description: "Tutore privato per Java & Spring Boot con memoria"

agent:
  model: "claude-opus-4-20250514"
  system_prompt: |
    Sei un tutore privato di Java e Spring Boot.
    Adatta lo stile di insegnamento al livello dello studente.

    Usa la memoria per ricordare:
    - Topics già insegnati e compresi
    - Aree di difficoltà
    - Preferenze didattiche (esempi vs teoria)
    - Progetti precedenti discussi

memory:
  enabled: true
  schema:
    student_level: "beginner|intermediate|advanced"
    topics_covered: ["string", "oop", "spring-boot"]
    difficult_areas: ["generics", "streams"]
    learning_style: "visual|textual|hands-on"
    projects: [{name, date, skills_practiced}]
    recent_questions: [{topic, answer}]

  management:
    auto_update: true
    retention_days: 365
    review_frequency: "per_session"

sessions:
  max_active: 1
  timeout: 1800

---

# Esempio: usare l'agente con memoria
POST /api/v1/agent/tutoring/sessions
Request:
{
  "user_id": "student123",
  "message": "Come creo un REST API in Spring Boot?",
  "memory_context": {
    "student_level": "beginner",
    "topics_covered": ["variables", "classes", "inheritance"],
    "difficult_areas": ["annotations"],
    "learning_style": "hands-on"
  }
}

Response:
{
  "session_id": "sess_abc123",
  "response": "Facciamo un esempio pratico...",
  "memory_update": {
    "topics_covered": [..., "rest-api", "spring-annotations"],
    "recent_questions": [
      {"topic": "REST API Spring Boot", "answer": "[summary]"}
    ]
  }
}

9. When to Use Agent SDK vs Managed Agents

The choice between Local SDK and Managed Agents depends on your specific use case.

Decision Matrix

Criterion Agent SDK Local Managed Agents
Rapid prototyping ✅ Ideal ⚠️ Initial setup
Agents on production 24/7 ⚠️ You have to manage infrastructure ✅ Ideal
Variable load (low → high) ⚠️ Operational overhead ✅ Auto-scaling
Cost per single task ✅ Tokens only ⚠️ Token + hosting
Access to local resource (DB, file) ✅ Direct ⚠️ Via configured tools
Cross-session memory ⚠️ DIY (Redis, DB) ✅ Built-in
Fine control over the tools ✅ Custom callbacks ⚠️ Pre-built tools
Isolation compliance ⚠️ Shared ✅ Sandbox

Hybrid Architecture Recommended

For production-scale systems, it is recommended combine both approaches:

  • Local Agent SDK: Fast ad-hoc agents in the backend (code review, validation, formatting)
  • Managed Agents: Long-running agents for complex orchestration (monitoring, workflow automation, customer support)
  • Communication: Backend Spring Boot coordinates both, messages passed via webhook/queue

10. Conclusion and Future Roadmap

The evolution from Claude Code SDK to Claude Agent SDK to Managed Agents represents one democratization of the creation of autonomous agents. In 9 months (from September 2025 to April 2026), the framework has progressed from a developer tool to an enterprise platform for production-grade agents.

Key Points

  • Agent SDK (Oct 2025): Unified Python + TypeScript framework
  • System prompts + tools: Define specialized agents with custom capabilities
  • Programmatic sub-agents: Parallel orchestration of agents
  • Managed Agents (Apr 2026): Cloud-hosted, sandbox, scalable
  • Memory (Apr 2026): Cross-session persistence
  • ant CLI: Native client for automation and CI/CD
  • Hybrid Choice: Combine Local + Managed SDK for maximum flexibility

Next Articles in the Series

In the next article (26 in the series) we will explore Auto Mode and ScheduleWakeup: the ability of agents to operate completely autonomously without human intervention, and to automatically wake up at specific times to perform scheduled tasks. We will discover how to build agents that monitor systems 24/7 and make autonomous decisions.

This is the 25th and penultimate part of the Claude series. The series was born as a guide for developers who want to integrate Claude AI into their workflows professional. With the arrival of Managed Agents, the panorama is complete: from prototyping local to enterprise-scale production, you have all the tools to build systems Autonomous, scalable and reliable AI.

Try These Tools

Free developer tools related to this topic.

Commenti

Caricamento commenti...

Sign in to comment

Discuss this article in the community

Join the Telegram group to discuss with other developers, ask questions and share your experiences.

Did you like this article?

Explore other content on the blog or discover my projects