diff --git a/.gitignore b/.gitignore index af731f2..148e6c2 100644 --- a/.gitignore +++ b/.gitignore @@ -151,3 +151,4 @@ cython_debug/ # option (not recommended) you can uncomment the following to ignore the entire idea folder. #.idea/ /vector_db +.DS_Store diff --git a/README.md b/README.md index 0159f76..dea0a5b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,15 @@ # DocsChat 📚🗣️ -This repository contains code for a chatbot application that allows users to interact with documents using conversational queries. - `docchat` is a command-line interface that let's you start a local streamlit server and interact with your documents. +The chatbot utilizes a conversational retrieval chain to answer user queries based on the content of embedded documents. It leverages various NLP techniques, including language models and embeddings, to provide relevant responses. + +## Features + +- **Document Embedding:** Embeds PDF documents for efficient retrieval of information. +- **Conversational Interface:** Allows users to interact with documents through a chat interface. +- **Settings:** Provides customizable settings for configuring document retrieval and model parameters. + ## Installation To run the application locally, follow these steps for installation. @@ -12,7 +18,7 @@ To run the application locally, follow these steps for installation. pip install DocChat ``` -Start the Ollama server: +Pulll Ollama llm: ```bash ollama pull llama3 @@ -20,6 +26,11 @@ ollama pull llama2 ollama pull gemma ollama pull mistral ollama pull codellama +``` + +Start the Ollama server: + +```bash ollama run llama3 ``` @@ -29,12 +40,31 @@ Run the application: docchat ``` -## Overview +## Configure -The chatbot utilizes a conversational retrieval chain to answer user queries based on the content of embedded documents. It leverages various NLP techniques, including language models and embeddings, to provide relevant responses. +![DocChat](assets/docchat.png) -## Features +### PDF sources -- **Document Embedding:** Embeds PDF documents for efficient retrieval of information. -- **Conversational Interface:** Allows users to interact with documents through a chat interface. -- **Settings:** Provides customizable settings for configuring document retrieval and model parameters. +- Configure the PDF source directory from which all PDFs should be read in recusively. +- Select a splitter, this has an influence on the chunks that we will make available to the LLM and thus also on the answers. By default no splitter is selected, this means a larger context. + +### Vector store + +![Vector store](assets/vectorestore.png) + +- Chroma DB in memory is used as a vector store, which stores the data in a Persit directory, so the data in the DB is also available after the restart. +- The Retriever search type has and the various parameters influence the search of documents in the Vectore Store. + +### Ollama + +![Ollama](assets/ollama.png) + +- Configure the ollama server connection and the model with which the server was started. +- the LLM parameters influence the embedding of the PDFs but also the answering of questions in the RAG pipeline. + +## Actions + +![Actions](assets/actions.png) + +There are two functions available, the sync of PDF documents into the Vectore Store. This can take some time depending on the system resources, embedding and splitter. The Delete DB function deletes the Chroma Collection. diff --git a/assets/actions.png b/assets/actions.png new file mode 100644 index 0000000..7c03586 Binary files /dev/null and b/assets/actions.png differ diff --git a/assets/docchat.png b/assets/docchat.png new file mode 100644 index 0000000..cabbac6 Binary files /dev/null and b/assets/docchat.png differ diff --git a/assets/ollama.png b/assets/ollama.png new file mode 100644 index 0000000..4e69642 Binary files /dev/null and b/assets/ollama.png differ diff --git a/assets/vectorestore.png b/assets/vectorestore.png new file mode 100644 index 0000000..aec400a Binary files /dev/null and b/assets/vectorestore.png differ diff --git a/src/docchat/app.py b/src/docchat/app.py index 991ea03..abd5e25 100644 --- a/src/docchat/app.py +++ b/src/docchat/app.py @@ -223,7 +223,7 @@ def run_chain(question: str, chat_history: list[str]) -> list[any]: def start_chatbot(): global config - st.title("DocsChat 📚🗣️") + st.title("DocChat 📚🗣️") # Initialize chat history if "messages" not in st.session_state: