An AI-powered tool that generates personalized bot and conversation starters based on url. This project uses OpenAI and LlamaIndex.
This AI url bot does the research for you. You input a name, and within seconds, the bot searches the url, generating personalized questions based on someo website.
- Extract URL data using
trafilaturaAPI. - Process and index the data using LlamaIndex and OpenAI embeddings
- Generate interesting facts about the website
- Answer specific questions about the url.
- Interact with the bot through a command-line interface
url_bot/
├── requirements.txt # Dependencies
├── config.py # Configuration settings
├── modules/
│ ├── __init__.py
│ ├── data_extraction.py # Url data extraction
│ ├── data_processing.py # Data splitting and indexing
│ ├── llm_interface.py # LLM setup and interaction
│ └── query_engine.py # Query processing and response generation
└── main.py # Main script to run without Gradio
- Python 3.11+
- OpenAI API Key
- Clone the repository:
git clone https://github.com/ismatim/urlbot.git
cd urlbot- Create a virtual environment:
uv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
uv pip install -r requirements.txtRun the bot using the command line:
python main.py --url "https://www.linkedin.com/in/username/"This is a starter template with placeholder functions. Your task is to implement the following components:
-
In
config.py:- Define the prompt templates for facts generation and question answering
-
In
modules/data_extraction.py:- Implement the
extract_websitefunction
- Implement the
-
In
modules/data_processing.py:- Implement the
split_datafunction - Implement the
create_vector_databasefunction - Implement the
verify_embeddingsfunction
- Implement the
-
In
modules/llm_interface.py:- Implement the
create_openai_embeddingfunction - Implement the
create_openai_llmfunction - Implement the
change_llm_modelfunction
- Implement the
-
In
modules/query_engine.py:- Implement the
generate_initial_factsfunction - Implement the
answer_user_queryfunction
- Implement the
-
Update
modules/__init__.pyto import your implemented functions -
In
main.py:- Implement the
process_urlfunction - Implement the
chatbot_interfacefunction
- Implement the
uvx --from git+https://github.com/ismatim/urlbot urlbot <YOUR_URL_HERE>This project is licensed under the MIT License - see the LICENSE file for details.
- Openai for providing the LLM and embedding models
- LlamaIndex for the data indexing and retrieval framework