Skip to content

mateusz29/chat-with-documents

Repository files navigation

Chat with PDF Documents 🤖📄

Ask questions and get answers directly from your PDFs. This is a Retrieval-Augmented Generation (RAG) system powered by OpenAI, LangChain, and Chroma vector database, with an intuitive Streamlit UI. The entire app is fully containerized for easy deployment.

Features

  • Upload one or more PDF documents and extract knowledge.
  • Semantic search using embeddings stored in ChromaDB.
  • Query your PDFs naturally with OpenAI-powered RAG.
  • Uses LangChain 1.0 to create the agent and orchestrate prompts.
  • Clean Streamlit interface for interactive chatting.
  • Fully containerized for easy deployment with Docker Compose.
  • Manage documents: add, delete, or clear chat history.

Example Usage

App Demo
Example: Upload PDFs, ask questions, and get answers.

Prerequisites

  • Docker & Docker Compose installed
  • .env file with your OpenAI API key:
OPENAI_API_KEY=your_api_key_here

Installation & Run

  1. Clone the repository:
git clone https://github.com/your-username/chat-with-documents.git
cd chat-with-documents
  1. Copy the example environment file:
cp .env.example .env
  1. Set your OpenAI API key:

Open the .env file and replace your_api_key_here with your actual OpenAI API key:

OPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  1. Build and start the containers:
docker-compose up --build
  1. Access the app:

Open http://localhost:8501 in your browser.

Usage

  1. Upload PDF files via the sidebar.
  2. Click Submit to process documents.
  3. Ask questions in the chat input at the bottom.
  4. Use sidebar buttons to Clear Chat or Delete Docs.
  5. Enjoy AI-powered answers directly from your PDFs!

Project Structure

.
├── app/                    # Streamlit app code
├── utils/                  # Helper modules (agent, config, pdf processor, etc.)
├── docker-compose.yml      # Container orchestration
├── Dockerfile              # App container configuration
├── .env.example            # Environment variables template
├── pyproject.toml          # Project dependencies
└── README.md

About

Ask questions and get answers from your PDFs. A RAG system powered by OpenAI, LangChain, and Chroma vector database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors