All projectsAI · Multi-agent

tech-news-agent.

Spring AIgpt-4o-miniTavilyGitHub MCPJava 21
01

What it does

Multi-agent pipeline that turns a tech topic into a fact-checked, LinkedIn-ready post: an OrchestratorAgent runs a ReAct loop coordinating five specialized agents (Scout, Reporter, Editor, FactChecker, LinkedInWriter), with an automatic retry if the fact-check confidence score is too low. Spring Boot, Spring AI, OpenAI GPT-4o-mini, Tavily Search API, GitHub MCP Server, Java 21.

02

How it works

One POST to /api/news/generate starts the run. The OrchestratorAgent does not follow a fixed script: it runs a ReAct loop, reasoning about the state, calling a tool or an agent, observing the result, and deciding the next step.

ScoutAgent gathers material through Tavily web search, a page-fetch tool, and GitHub data served over the GitHub MCP server. ReporterAgent extracts the facts, EditorAgent shapes them, and FactCheckerAgent scores the result.

If the fact-check confidence falls below 0.6, facts are re-extracted and the loop runs again. That decision belongs to the model — nothing in the Java hardcodes it. A ContextSizeAdvisor guards against token overflow, and each agent keeps its own system prompt under resources/prompts.

LinkedInWriterAgent produces the final post. The response carries the post, a verified article marked up with [HIGH], [MEDIUM], and [UNVERIFIED], the overall confidence, the fact counts, and the processing time; a run takes 30–90 seconds.

03

Design decisions

  1. 01The orchestrator runs a ReAct loop: it reasons, calls tools, observes results, and decides the next step.
  2. 02The retry is decided by the model: if fact-check confidence falls below 0.6, facts are re-extracted; nothing in Java hardcodes the loop.
  3. 03Tools: Tavily web search, a page-fetch tool, and GitHub data through the GitHub MCP server.
  4. 04A ContextSizeAdvisor guards against token overflow; each agent has its own system prompt under resources/prompts.
  5. 05One POST /api/news/generate call returns the post, a verified article with [HIGH], [MEDIUM], and [UNVERIFIED] markers, overall confidence, fact counts, and processing time; a run takes 30–90 seconds.
04

Stack

Language
Java 21
Framework
Spring Boot 3.5.0, Spring AI 1.0.0
Model
OpenAI gpt-4o-mini
Tools
Tavily Search API, GitHub MCP Server v0.6.2
HTTP client
Spring WebFlux (WebClient)
Build
Maven
05

Source

More work

See the other systems, or say hello.