|
1 | 1 | # GraphNews: A Multi-Agent Self-Correcting Editorial Team |
2 | 2 |  |
3 | 3 |  |
4 | | - |
| 4 | + |
5 | 5 |  |
6 | 6 |
|
7 | 7 | **GraphNews** is a sophisticated multi-agent system built with **LangGraph** that automates the end-to-end process of news research, curation, and newsletter drafting. Unlike standard linear AI chains, this project utilizes a **Cyclic Graph** architecture to implement a "Self-Correction" loop, ensuring high-quality, factual output through autonomous peer review. |
8 | 8 |
|
9 | 9 | ## Workflow Architecture |
10 | 10 | The system treats the editorial process as a state machine. Data flows through specialized nodes, maintaining a shared state to ensure context is preserved across the entire lifecycle: |
11 | 11 |
|
12 | | -1. **RESEARCHER:** Scours the web using **Tavily** for the top 10 . |
| 12 | +1. **RESEARCHER:** Scours the web using **Tavily** for the top 10 news items for the specified topic. |
13 | 13 | 2. **CURATOR:** Filters research results to select the top 5 most relevant sources. |
14 | 14 | 3. **WRITER:** Generates a structured Markdown draft based on curated items. |
15 | 15 | 4. **CRITIC:** Evaluates the draft. If the score is **< 8/10**, the draft is sent back to the **WRITER** with specific feedback for revision. |
@@ -62,15 +62,24 @@ TAVILY_API_KEY=your_key_here |
62 | 62 |
|
63 | 63 | ### 3. Run the system |
64 | 64 | ```bash |
| 65 | +# Default run (yesterday's news) |
65 | 66 | python main.py |
| 67 | +#Custom run with specific topic, destination and verbose logging |
| 68 | +python main.py --topic "Quantum Computing" --verbose --dest quantum_news.md |
66 | 69 | ``` |
| 70 | +## CLI Usage |
| 71 | +| Argument | Short | Description | Default | |
| 72 | +| :--- | :--- | :--- | :--- | |
| 73 | +| `--topic` | | The subject of the newsletter | Yesterday's News | |
| 74 | +| `--dest` | `-d` | Path to save the output file | `newsletter.md` | |
| 75 | +| `--verbose` | | Enable real-time agent logging | `False` | |
67 | 76 |
|
68 | 77 | ## Technical Challenges & Solutions |
69 | 78 | - The "Hallucination" Brake: Implemented a max revision counter within the Critic node logic to prevent infinite loops and runaway API costs. |
70 | 79 | - Deterministic State Control: Used LangGraph's TypedDict state to maintain a single source of truth, preventing context drift. |
71 | 80 |
|
72 | 81 | ## Roadmap |
73 | | - - Add CLI arguments to control news topic and source count. |
| 82 | + - Add argument to choose which LLM is used |
74 | 83 | - Integrate LangSmith for full-trace agent debugging and cost monitoring. |
75 | 84 | - Human-in-the-Loop: Add a LangGraph Checkpointer to pause for human approval before final output. |
76 | 85 |
|
0 commit comments