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.
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.
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.
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.
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.
- 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.
Whenever a new draft is generated, you can see the exact differences compared to the previous version, making improvements transparent.
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.
The app saves progress into a local SQLite checkpoint database, so you can pause, close, and resume without losing work.
- Enter the essay topic:
"The Impact of Technology on Education". - The agent generates a Plan (editable).
- (Optional) With Tavily, it fetches research notes and sources.
- The agent writes the first Draft.
- The agent provides a Critique (editable).
- Based on the critique, it produces an improved second Draft.
- You now have multiple drafts, critiques, and references to choose from.
- Python 3.10+
- Streamlit
- LangGraph
- LangChain OpenAI
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.pyThen open http://localhost:8501 in your browser.
MIT License
Built with LangGraph + Streamlit


