Skip to content

πŸ€– πŸ“ An AI-powered essay writing assistant that helps you plan, research, and write well-structured essays using OpenAI and Tavily APIs. Built with Streamlit and LangGraph.

Notifications You must be signed in to change notification settings

AmirLayegh/agentic-essay-writer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✍️ Agentic AI Essay Writer Powered by LangGraph and Streamlit

An intelligent AI-powered essay writing assistant that helps you plan, research, and write well-structured essays with multiple revisions.

Essay Writer Workflow GUI

🌟 Features

  • πŸ€– 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

πŸ”‘ Prerequisites

  • Python 3.11+
  • uv package manager
  • OpenAI API key
  • Tavily API key

πŸ› οΈ Installation

  1. Clone the repository:
git clone https://github.com/AmirLayegh/agentic-essay-writer.git
cd essay-writer
  1. Use uv sync command to create and activate a virtual environment:
uv sync
  1. Set up environment variables by placing your API keys in a .env file in the root of the repository:
OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
TAVILY_API_KEY="YOR_TAVILY_API_KEY"

πŸ’» Usage

  1. Start the Streamlit application:
make run-st-app
  1. Open your web browser and navigate to the provided URL (typically http://localhost:8501)

  2. Enter your essay topic in the text area and click "Generate Essay"

  3. 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
  4. Download your final essay using the download button

πŸ—οΈ Project Structure

  • st_app.py: Main Streamlit application interface
  • agent.py: Core essay writing agent implementation
  • schemas.py: Data models and type definitions
  • prompts.py: AI model prompts
  • main.py: Command-line interface

πŸš€ How It Works (Powered by LangGraph)

Essay Writer Workflow Graph

The AI Essay Writer uses a sophisticated graph-based workflow:

  1. πŸ“ Planning: Creates a detailed essay outline
  2. πŸ” Research: Gathers relevant information using Tavily API
  3. ✍️ Writing: Generates the initial essay draft
  4. πŸ”„ Revision: Performs multiple iterations of improvement
  5. πŸ”„ Finalization: Produces a polished essay

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments πŸ™

  • 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

About

πŸ€– πŸ“ An AI-powered essay writing assistant that helps you plan, research, and write well-structured essays using OpenAI and Tavily APIs. Built with Streamlit and LangGraph.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published