Spaces:
Sleeping
Sleeping
NaderAfshar
commited on
Commit
·
43aecb1
1
Parent(s):
664e9ba
Updated the README file
Browse files
README.md
CHANGED
|
@@ -13,41 +13,77 @@ short_description: Report Writing Agent by Nader Afshar
|
|
| 13 |
|
| 14 |
# Research-Driven Report Writing Agent
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
|
| 23 |
-
* **Iterative Drafting and Critique:** The agent follows a structured workflow of planning, drafting, self-critiquing, and revising the essay. This iterative process, driven by the LangGraph framework, leads to progressively refined outputs.
|
| 24 |
-
* **Multi-Source Integration:** The agent synthesizes information from multiple research sources, enriching the report with a broader range of content.
|
| 25 |
-
* **Structured Output Logging:** The agent provides detailed logs of its internal processes, including planning steps, search queries, retrieved information, drafts, and critiques. This transparency allows users to understand the agent's reasoning and research methodology.
|
| 26 |
-
* **Customizable Revisions:** Users can control the number of report revisions, enabling a trade-off between generation speed and essay quality.
|
| 27 |
|
| 28 |
-
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
6. **Revision:** The agent revises the report based on the critique and the newly acquired information.
|
| 36 |
-
7. Steps 3-6 repeat for a specified number of revisions.
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
-
1.
|
| 49 |
-
2. Specify the desired number of revisions.
|
| 50 |
-
3. Click the "Generate Report" button.
|
| 51 |
-
4. Observe the agent's progress in the "Agent Process Log" and the final report in the "Final Report Draft" box.
|
| 52 |
|
| 53 |
-
|
|
|
|
|
|
| 13 |
|
| 14 |
# Research-Driven Report Writing Agent
|
| 15 |
|
| 16 |
+
# 🔎 Research Agent
|
| 17 |
|
| 18 |
+
The **Research Agent** is an autonomous, multi-step research system built using [LangGraph](https://github.com/langchain-ai/langgraph), [Cohere](https://cohere.com), and [Tavily](https://www.tavily.com/). It mimics the behavior of a human research assistant — planning, researching, drafting, critiquing, and revising — to produce high-quality **research reports** on any topic the user provides.
|
| 19 |
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## 🧠 What Sets It Apart?
|
| 23 |
+
|
| 24 |
+
Unlike typical AI content generators, this agent performs **real-time research** to ensure that reports are grounded in current, verifiable information.
|
| 25 |
+
|
| 26 |
+
### ✨ Highlights:
|
| 27 |
+
- Uses **Cohere’s `command-a-03-2025` LLM** for language generation, outlining, and critique.
|
| 28 |
+
- Uses **Tavily** to perform real-time, internet-based research (not just LLM memory).
|
| 29 |
+
- Produces **structured, refined research reports**, not informal essays or chatbot replies.
|
| 30 |
+
- Streams its **research and reasoning process** live so users can follow along.
|
| 31 |
+
|
| 32 |
+
---
|
| 33 |
+
|
| 34 |
+
## 🧩 How It Works
|
| 35 |
+
|
| 36 |
+
1. **User provides a topic or research question** through the UI.
|
| 37 |
+
2. The agent:
|
| 38 |
+
- **Plans** the structure of the research.
|
| 39 |
+
- **Conducts multiple web searches** via Tavily.
|
| 40 |
+
- **Drafts a full report** using retrieved content and context.
|
| 41 |
+
- **Critiques** and **revises** the report internally.
|
| 42 |
+
3. The output includes:
|
| 43 |
+
- A live, streaming **log of the research process**.
|
| 44 |
+
- A clean, **final research report** as a separate result.
|
| 45 |
+
|
| 46 |
+
---
|
| 47 |
|
| 48 |
+
## ⏳ Why It Takes Time
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
The Research Agent behaves more like a human researcher than a chatbot:
|
| 51 |
|
| 52 |
+
- It may take **~30 seconds before the first visible output**, while:
|
| 53 |
+
- Querying the web.
|
| 54 |
+
- Organizing thoughts.
|
| 55 |
+
- Planning the structure.
|
| 56 |
+
- It takes **1–2 minutes or more** to complete a full research and writing cycle with critique + revision.
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
🧠 **This is intentional**: speed is traded for depth, accuracy, and reasoning.
|
| 59 |
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## 🖥 Interface
|
| 63 |
+
|
| 64 |
+
Built with **Gradio**, the app includes:
|
| 65 |
+
|
| 66 |
+
- A **textbox** for entering a topic or question.
|
| 67 |
+
- A **streaming log** of research, planning, and revision steps.
|
| 68 |
+
- A **final output panel** for the completed research report.
|
| 69 |
+
|
| 70 |
+
---
|
| 71 |
+
|
| 72 |
+
## 🛠️ Technologies Used
|
| 73 |
+
|
| 74 |
+
| Component | Purpose |
|
| 75 |
+
|----------------|------------------------------------------|
|
| 76 |
+
| LangGraph | Agent state machine + step logic |
|
| 77 |
+
| Cohere LLM | `command-a-03-2025` model for text tasks |
|
| 78 |
+
| Tavily Search | Real-time research via web search |
|
| 79 |
+
| LangChain Core | Messaging and prompt orchestration |
|
| 80 |
+
| Gradio | Interactive web interface |
|
| 81 |
+
|
| 82 |
+
---
|
| 83 |
|
| 84 |
+
## 🚀 Getting Started
|
| 85 |
|
| 86 |
+
1. Install dependencies:
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
+
```bash
|
| 89 |
+
pip install -r requirements.txt
|