Skip to content

Add Anthropic Claude sample to agentflow4j-samples #62

Description

@ahmed-sekka

Problem

agentflow4j-samples ships demos against Mistral and Ollama. There is no sample showing AgentFlow4J wired to Anthropic Claude — one of the most widely used providers.

Task

Add ClaudeResearchDemo.java to agentflow4j-samples:

  • Two-agent graph: a researcher (ExecutorAgent) + a writer (ExecutorAgent)
  • CoordinatorAgent with RoutingStrategy.llmDriven(chatClient)
  • BudgetPolicy capping the run at $0.10
  • Falls back to stubs when ANTHROPIC_API_KEY is not set (same pattern as existing demos)

Spring AI dependency to add

<dependency>
    <groupId>org.springframework.ai</groupId>
    <artifactId>spring-ai-starter-model-anthropic</artifactId>
</dependency>

Acceptance criteria

  • Demo runs with ANTHROPIC_API_KEY set
  • Demo runs in stub mode without any API key
  • Follows the existing demo structure (see MistralIntegrationDemo.java)
  • Listed in the samples table in docs/samples.md

Notes

Good first issue — the pattern is established in MistralIntegrationDemo.java, this is a straight adaptation.

Metadata

Metadata

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions