NaderAfshar commited on
Commit
0bfc0d3
·
1 Parent(s): 5388afb

updated README

Browse files
Files changed (1) hide show
  1. README.md +41 -2
README.md CHANGED
@@ -8,7 +8,46 @@ sdk_version: 5.28.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
- short_description: Essay Writing Agent
12
  ---
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
+ short_description: Essay Writing Agent by Nader Afshar
12
  ---
13
 
14
+ # Research-Driven Essay Writing Agent
15
+
16
+ ## Description
17
+
18
+ This LangGraph-based agent is designed to generate well-researched, multi-draft essays based on a user-provided topic. Unlike typical language models that rely solely on their inherent knowledge, this agent leverages a research component to gather external information, aiming for more comprehensive and accurate essays. LangGraph is a framework for building stateful, multi-agent applications. It is designed to build, deploy and manage complex generative AI agent workflows.
19
+
20
+ ## Key Features
21
+
22
+ * **Autonomous Research:** The agent actively formulates search queries and retrieves information from external sources to supplement its writing process. This ensures that the generated essays are grounded in factual data and diverse perspectives.
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 essay 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 essay revisions, enabling a trade-off between generation speed and essay quality.
27
+
28
+ ## Workflow
29
+
30
+ 1. **Planning:** The agent creates a high-level outline of the essay based on the user's topic.
31
+ 2. **Research (Planning):** The agent formulates search queries to gather relevant information for the initial essay draft.
32
+ 3. **Drafting:** The agent generates the first draft of the essay, incorporating the research findings and the initial outline.
33
+ 4. **Critique:** The agent self-evaluates the essay, identifying areas for improvement.
34
+ 5. **Research (Critique):** The agent formulates new search queries to gather information that can aid in revising the essay based on the critique.
35
+ 6. **Revision:** The agent revises the essay based on the critique and the newly acquired information.
36
+ 7. Steps 3-6 repeat for a specified number of revisions.
37
+
38
+ ## Expected Behavior & Usage Notes
39
+
40
+ * **Initial Delay:** Due to the research component, expect an initial delay (can vary, but typically within 30 seconds to a minute) before the agent begins generating output. This is the time taken for the agent to formulate and execute its initial search queries.
41
+ * **Streaming Output:** The agent provides a streaming output of its process log, allowing you to observe the planning, research, and drafting stages in real-time.
42
+ * **Gradual Refinement:** The essay draft will evolve over time as the agent performs multiple research and revision cycles. The final draft is presented after all the revision steps are completed.
43
+ * **Resource Intensive:** The research-driven approach can be more time-consuming than simple LLM text generation. The overall generation time depends on the complexity of the topic and the number of revisions.
44
+ * **Dependencies:** Ensure you have the necessary API keys (Cohere, Tavily) and Python libraries installed as specified in the code.
45
+
46
+ ## How to Run
47
+
48
+ 1. Provide an essay topic in the input field.
49
+ 2. Specify the desired number of revisions.
50
+ 3. Click the "Generate Essay" button.
51
+ 4. Observe the agent's progress in the "Agent Process Log" and the final essay in the "Final Essay Draft" box.
52
+
53
+ This agent aims to produce higher-quality, more informative essays by integrating external research into the generation process. Please be patient during the generation process, as the research and revision steps contribute to a more thorough and refined final output.