The blog post creator agent is a python script that uses the DuckDuckGo Search API and OpenAI's GPT-3 model to automate the creation of blog posts.
Blog.generator.demo.mp4
Try it here
- Fetches search results from DuckDuckGo based on a given keyword.
- Parses the links from the search results.
- Extracts the text content from each link.
- Generates a blog post based on the given keyword and internet search results as input to the LLM
- Visit the web app by clicking this link https://ai-blog-post-generator.streamlit.app/
- Enter the number of web references you want to use. (Max 10).
- Enter your OpenAI API key
- Enter the keyword you want to generate a blog post for.
- Click on the "Generate blog post" button.
The agent basically consists of the following components
- Document loading: The first step which is most necessary is to perform an internet search, and then load the retrieved texts from the internet into a document using a DocumentLoader.
- Splitting the documents: The next step is to split the documents into smaller chunks. Splitting documents enables faster searching and also enables us to fit as much relevant data into the context window of the LLM that we are going to use.
- Storage: The split documents have to be stored in a Vector database/Vector store. But before we save the chunks of documents we need to first embed them using OpenAIEmbeddings and then we can store the embeddings into our Vector Store. Embeddings are easily searchable because we can compute similarity scores easily which enables semantic search across the document chunks.
- Retrieval: When a user enters keywords to generate a blog post for, we want to be able to get the necessary chunks of data from the Vector store which will be relevant to the keywords. This is enabled through the retriever which helps to extract information from the vector store given the keyword.
- Blog generation: To generate the blog post, we shall pass the retrieved document chunks and the user keyword/keywords as a prompt to the LLM which generates the final blog post.
- Clone the repository:
git clone https://github.com/jordan-jakisa/blog_post_writer.git
- Navigate to the project directory:
cd blog-post-creator
- Install the required dependencies:
pip install -r requirements.txt
- Enter the following commands to run the app:
streamlit run src/app.py
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License - see the LICENSE file for details.