A local RAG (Retrieval-Augmented Generation) chatbot for querying EU documents. Built as a personal project to practice for AD (Administrator) EPSO competitions and to experiment with open source LLMs running entirely offline.
- Extracts text from EU PDFs into a single text file
- Chunks and embeds the text into a local ChromaDB vector store
- Lets you chat with the documents using a local Ollama model
- RAM: at least 8 GB (16 GB recommended — embedding + LLM inference run concurrently)
- Storage: ~2 GB for models + ChromaDB index
- Python 3.10+
- Ollama running locally with:
llama3.2:1b(or any compatible chat model)nomic-embed-text(embedding model)
pip install llama-index llama-index-llms-ollama llama-index-embeddings-ollama llama-index-vector-stores-chroma chromadb pypdfStep 1 — Place your PDF files in the project directory, then extract text:
python pdfReaderConverterText.pyStep 2 — Build the vector index (only needed once, or when PDFs change):
python eu_rag.py indexStep 3 — Start chatting:
python eu_rag.py chatWelcome to the EU documents chatbot! Ask me anything about the EU documents you uploaded. Type 'exit' to quit.
You: What is the green deal about? eli5
A: The EU's "green deal" is a plan to help Europe become more environmentally friendly. It wants
to reduce pollution, decrease energy costs for consumers, and boost economic growth.
Imagine you're an electric car owner. You own a brand-new electric car that gets really good gas
mileage. The government wants to make sure other cars on the road don't get better than yours.
This is what the "green deal" does - it helps make all cars cleaner and more efficient, so
everyone can have a good driving experience.
The plan also includes things like:
- Reducing energy costs for consumers
- Helping farmers grow food without hurting the environment
- Supporting industries that help reduce pollution
It's like a big team effort to make Europe's air and water cleaner, while still growing its
economy.
You: Cool. Ask me three questions about the European commission that would be in an EPSO exam for example for AD
A: 1. What is the primary role of the Directorate 'Quality of Legislation Team' within the
Commission's Legal Service?
2. According to the text, what specific factors are taken into account when ensuring the
quality of legislation adopted by the European Union?
3. Who or what authority would be responsible for initiating a preliminary reference procedure
in case of doubts about a national court's jurisdiction over EU competition law matters?