Skip to content

About

Automated blog post generator using Streamlit, LangChain, Mistral AI, and DuckDuckGo web search. Generates short, researched blog posts from any topic.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

Repository files navigation

Live Demo

Features · How It Works · Quick Start · Structure

Python 3.11 LangChain Streamlit Mistral DuckDuckGo MIT


Enter a topic, get a researched blog post. BlogWriter searches the live web for current context, then drafts a short, high-impact post with Mistral AI.

Features

  • Live Web Research — DuckDuckGo (via ddgs) fetches real current context on any topic
  • Mistral AI — Drafts engaging posts with temperature 0.9 for creative output
  • Word & Token Counter — Exact word count plus a real token count from Mistral's tokenizer (mistral-common)
  • Copy, Download, Regenerate — Copy to clipboard, download as .md, or regenerate (capped at 3 per topic)
  • Cited Sources — Every post comes with an expandable list of the sources it was built from
  • Clean Split — Streamlit UI (frontend.py) separate from logic (backend.py)

How It Works

  1. You enter a topic in the Streamlit UI.
  2. backend.search_web() queries DuckDuckGo for live results.
  3. The results are injected into a Mistral prompt (backend.generate_blog()).
  4. The post is rendered with its sources, word/token stats, and export actions.

Quick Start

git clone https://github.com/kairav7220/BlogWriter.git
cd BlogWriter
pip install -r requirements.txt

Set your Mistral API key in .streamlit/secrets.toml:

MISTRAL_API_KEY="..."

Never commit this file — it is already in .gitignore.

Run the app:

streamlit run frontend.py

Project Structure

BlogWriter/
├── frontend.py          # Streamlit UI (theme, actions, session state)
├── backend.py           # Web search, Mistral generation, tokenizer
├── requirements.txt     # Python dependencies
├── CONTRIBUTING.md      # Contribution guide
├── .gitignore
├── .streamlit/
│   ├── config.toml      # App theme
│   └── secrets.toml     # Your API key (gitignored)
└── LICENSE

License

MIT © kairav7220

About

Automated blog post generator using Streamlit, LangChain, Mistral AI, and DuckDuckGo web search. Generates short, researched blog posts from any topic.

Topics

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages