Skip to content

Latest commit

 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

📝 Essay Agent

Essay Agent is an intelligent assistant for writing essays, built with LangGraph and Streamlit.
It guides you through the full cycle of essay creation: planning, researching, drafting, and critiquing.

The unique part: you can pause the process after the Plan or the Critique, edit them yourself, and then continue.
This way, you get high-quality drafts while staying in full control of the final output.

UI Screenshot 1 UI Screenshot 2 UI Screenshot 3


What the Agent Can Do

🗂 Plan Generation

You provide a topic, and the agent creates a detailed outline with key points and section suggestions.
This serves as the backbone of your essay.

🔍 Smart Research

If you supply a Tavily API key, the agent automatically searches for relevant content and sources.
It collects summaries, snippets, and links to external references that you can use in your essay.

✍️ Draft Writing

Using the plan and collected context, the agent writes a full 5-paragraph draft.
If you specify multiple revisions (max_revisions), it iteratively improves the essay based on feedback.

🧪 Critique & Feedback

The agent acts like a teacher: it critiques each draft, highlighting strengths, weaknesses, style, depth, and areas for improvement.
You can edit the critique before moving on.

⏸️ Interactive Pauses

  • Pause after Plan → review and edit the outline before drafting begins.
  • Pause after Critique → modify the critique before the next draft is generated.
  • Continue with Resume or Save & Continue buttons in the UI.

🔄 Diff Between Drafts

Whenever a new draft is generated, you can see the exact differences compared to the previous version, making improvements transparent.

📊 Progress Tracking

A live progress bar shows the current stage (Plan → Research → Draft → Critique → Research Critique → End).
You also get toast notifications as the pipeline moves through each stage.

💾 State Saving

The app saves progress into a local SQLite checkpoint database, so you can pause, close, and resume without losing work.


Example Workflow

  1. Enter the essay topic: "The Impact of Technology on Education".
  2. The agent generates a Plan (editable).
  3. (Optional) With Tavily, it fetches research notes and sources.
  4. The agent writes the first Draft.
  5. The agent provides a Critique (editable).
  6. Based on the critique, it produces an improved second Draft.
  7. You now have multiple drafts, critiques, and references to choose from.

⚙ Requirements


Environment Variables

Copy .env.example.env and fill in your keys:

OPENAI_API_KEY=sk-...

# Optional (for research)
TAVILY_API_KEY=tvly-...

# Optional (for deterministic thread IDs)
THREAD_SALT=essay_agent

##🚀 Installation & Run

# Clone the repo
git clone https://github.com/<your-username>/<repo-name>.git
cd <repo-name>

# Create virtual environment
python -m venv .venv
source .venv/bin/activate      # macOS/Linux
# .venv\Scripts\activate       # Windows

# Install dependencies
pip install -r requirements.txt

# Create .env file from example
cp .env.example .env
# Fill in your API keys

# Run the app
streamlit run app.py

Then open http://localhost:8501 in your browser.

License

MIT License

Credits

Built with LangGraph + Streamlit

About

Essay assistant with LangGraph + Streamlit

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages