A Streamlit-based AI assistant that:
- Reads and processes PDF documents.
- Stores document chunks in a Chroma vector database.
- Uses NoSQL-style metadata for document context.
- Embeds and retrieves relevant content to answer user questions.
This project demonstrates:
- Vector embeddings with
nomic-embed-text - Chroma vector database for semantic search
- NoSQL-style metadata handling
- PDF ingestion, text splitting, and contextual retrieval
- Upload one or more PDFs.
- Get AI-generated answers that include:
- Red Flags / Risks
- Positive Aspects
- Recommendations
- View retrieved document chunks for transparency.
- Persistent local vector DB so embeddings aren't recalculated unnecessarily.
- Python 3.10+
- Ollama installed and running locally.
- The following Ollama models available:
llama3.2nomic-embed-text
-
Clone the repository
git clone https://github.com/Bredicus/pdf-assistant-demo.git cd pdf-assistant-demo -
Create and activate a virtual environment
python -m venv venv
-
Install dependencies
pip install -r requirements.txt
-
Ensure Ollama is running
ollama serve
-
Pull required models
ollama pull llama3.2 ollama pull nomic-embed-text
streamlit run app.pyThe app will open in your browser at http://localhost:8501.
pdf-assistant-demo/
│
├── app.py # Main Streamlit application
├── requirements.txt # Python dependencies
├── README.md # Project documentation
└── chroma_db/ # Persistent Chroma vector database (auto-created)
- Upload one or more PDF files.
- The app extracts text, splits it into chunks, and stores embeddings in Chroma.
- Ask a question about the content.
- The assistant retrieves relevant chunks and provides a structured answer:
- Risks
- Positives
- Recommendations