This is a simple Streamlit application that analyzes a web page's content for potential Google AI Mode query fan-out. It works by "chunking" the page content and sending it to the Gemini API with a custom prompt to identify potential sub-queries, content gaps, and opportunities for better coverage.
-
Analyzes a given URL for its primary topic.
-
Predicts 8-10 likely "fan-out" queries that a large language model might generate to answer a user's comprehensive question.
-
Assesses the current content's coverage for each predicted query.
-
Identifies potential follow-up questions users might have.
-
Provides recommendations for filling content gaps.
First, clone this repository to your local machine using Git:
git clone [https://github.com/your-username/gemini-fanout-analyzer.git](https://github.com/your-username/gemini-fanout-analyzer.git)
cd gemini-fanout-analyzer
Make sure you have Python installed. Then, install the required libraries using the requirements.txt file:
pip install -r requirements.txt
You'll need a Gemini API key. You can get one by signing up for Google AI Studio.
To start the Streamlit application, run the following command in your terminal:
streamlit run streamlit_app.py
This will open the application in your web browser. Simply paste your Gemini API key and the URL you want to analyze into the text fields and click "Analyze URL" to see the results.
For better security, especially if you plan to share this app on GitHub, you can store your API key in a .streamlit/secrets.toml file instead of entering it directly into the app.
-
Create a
.streamlitfolder in your project directory. -
Inside the folder, create a file named
secrets.toml. -
Add the following content to the
secrets.tomlfile:
[gemini]
api_key = "YOUR_API_KEY_HERE"
Then, you can modify the streamlit_app.py script to read the key from this file, removing the need for the text input field:
import streamlit as st
# ... other imports
api_key = st.secrets["gemini"]["api_key"]
# ... rest of the code
This ensures your key is never committed to your Git repository.