An intelligent AI-powered essay writing assistant that helps you plan, research, and write well-structured essays with multiple revisions.
- π€ AI-powered essay planning and writing
- π Automated research gathering using Tavily API
- π Multi-stage essay generation process:
- π Planning and outlining
- π Research and information gathering
- βοΈ Essay writing
- π Revision and improvement
- π Interactive Streamlit interface
- πΎ State persistence using SQLite
- π Multiple revision cycles for quality improvement
- Python 3.11+
- uv package manager
- OpenAI API key
- Tavily API key
- Clone the repository:
git clone https://github.com/AmirLayegh/agentic-essay-writer.git
cd essay-writer- Use uv sync command to create and activate a virtual environment:
uv sync- Set up environment variables by placing your API keys in a
.envfile in the root of the repository:
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
TAVILY_API_KEY="YOR_TAVILY_API_KEY"- Start the Streamlit application:
make run-st-app-
Open your web browser and navigate to the provided URL (typically http://localhost:8501)
-
Enter your essay topic in the text area and click "Generate Essay"
-
Monitor the progress through the different tabs:
- π Planning: View the essay outline
- π Research: See gathered information
- βοΈ Writing: Read the current draft
- π Revisions: Track improvements
- π Raw Data: Access detailed state information
-
Download your final essay using the download button
st_app.py: Main Streamlit application interfaceagent.py: Core essay writing agent implementationschemas.py: Data models and type definitionsprompts.py: AI model promptsmain.py: Command-line interface
The AI Essay Writer uses a sophisticated graph-based workflow:
- π Planning: Creates a detailed essay outline
- π Research: Gathers relevant information using Tavily API
- βοΈ Writing: Generates the initial essay draft
- π Revision: Performs multiple iterations of improvement
- π Finalization: Produces a polished essay
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Deeplearning.ai Course on AI agents in LangGraph
- OpenAI for providing the language models
- Tavily for the research API
- Streamlit for the web interface framework
- LangGraph for the workflow management

