To implement a hands-on project from the AI Engineering Hub repository and run it on your local laptop, I'll guide you step-by-step. Since you're new to LLMs (Large Language Models), agents, and the setup required, I'll explain everything simply.
We'll focus on a project from the repository, Agentic RAG , as it combines LLMs, agents, and retrieval-augmented generation (RAG). Here's how to proceed:
Step 1: Understand the Requirements
You'll need:
Python (version 3.11 or later).
Basic Python knowledge (I'll guide you through the commands).
A modern laptop with at least 8GB RAM. If your laptop has less, you can still try but performance may vary.
Internet access to download dependencies and APIs.
Step 2: Install Python and Dependencies
1. Install Python 3.11 or Later
Download Python from https://www.python.org/downloads/ .
During installation, check the box "Add Python to PATH" .
Verify installation:
bash Copy code
python --version
It should show 3.11.x or later.
2. Set Up a Virtual Environment
This keeps your project dependencies separate from your system Python.
bash Copy code
# Create a virtual environment
python -m venv agentic-rag-env
# Activate the virtual environment
# On Windows:
agentic-rag-env\Scripts\activate
# On macOS/Linux:
source agentic-rag-env/bin/activate
3. Install Required Dependencies
Run the following command to install the libraries needed for the project:
bash Copy code
pip install crewai crewai-tools chonkie[semantic] markitdown qdrant-client fastembed streamlit
These libraries include:
CrewAI : Framework for building AI agents.
Qdrant : A vector database for storing and retrieving embeddings.
Streamlit : A framework to create interactive web apps.
FastEmbed : For efficient embeddings.
Step 3: Set Up API Keys
Some parts of the project require external APIs. For example:
FireCrawl API for web search.
Sign up at FireCrawl .
Get your API key and note it down.
Save it in a .env file in the project directory:
env Copy code
FIRECRAWL_API_KEY=<your_api_key>
(Optional) Other APIs like Serper (for search) or Cohere (for LLMs) may be required for advanced features.
Step 4: Clone the Repository
Download the repository to your local machine:
bash Copy code
git clone https://github.com/patchy631/ai-engineering-hub.git
cd ai-engineering-hub/agentic_rag
Step 5: Understand the Project Structure
app_deep_seek.py : Runs the app with the deep-seek-r1 model.
app_llama3.2.py : Runs the app with the llama 3.2 model locally.
config/agents.yaml : Configuration for the agents (retriever, synthesizer, etc.).
Step 6: Set Up Models Locally
If you want to run LLMs like Llama 3.2 or Llama 3.3 locally:
Install Ollama :
bash Copy code
curl -fsSL https://ollama.com/install.sh | sh
Download the Llama Model :
bash Copy code
ollama pull llama3.2
Step 7: Run the App
To run the app using deep-seek-r1:
bash Copy code
streamlit run app_deep_seek.py
To run the app using llama 3.2:
bash Copy code
streamlit run app_llama3.2.py
Step 8: Access the App
Once the app starts, it will display a URL in the terminal, such as:
plaintext Copy code
Local URL: http://localhost:8501
Open the URL in your web browser to interact with the app.
Step 9: Explore and Experiment
Try asking questions to the app.
If it can't find an answer in the PDF/document search, it will fallback to web search (using FireCrawl API).
Modify the agent behavior by editing config/agents.yaml.
Step 10: Troubleshooting
Common Issues:
Dependency Errors :
Ensure all required libraries are installed. Run:
bash Copy code
pip install -r requirements.txt
If a package fails, install it individually:
bash Copy code
pip install <package_name>
API Key Issues :
Double-check your API keys in the .env file.
Performance :
If your laptop struggles, consider using models with lower resource requirements (like llama 3.2).
Step 11: Learn the Basics of AI Agents
To better understand what you're working with:
LLM (Large Language Model) : These are advanced AI models that generate text based on input. Example: Llama 3.2.
Agents : These are components that perform specific tasks, like retrieving documents or synthesizing responses.
RAG (Retrieval-Augmented Generation) : Combines LLMs with a knowledge base to retrieve information before generating responses.
Step 12: Next Steps
Experiment with different projects in the repository (e.g., "Local ChatGPT" or "Document Chat RAG").
Contribute to the repository by improving documentation or fixing issues.
Expand your knowledge of LLMs and agents by referring to tutorials in the repository.
Let me know if you face any issues or need further assistance! 😊