Giter Site home page Giter Site logo

aj890 / chatting-with-docs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from douglasmakey/chatting-with-docs

0.0 0.0 0.0 814 KB

This is an ultra-simple example of using Langchain, Chroma and OpenAI for chatting with your documents

Python 100.00%

chatting-with-docs's Introduction

πŸ“– Chatting with Docs: A Learning Journey with AI

Hey there! I've been dabbling with Langchain and ChromaDB to chat about some documents, and I thought I'd share my experiments here. It's all pretty new to me, but I'm excited about where it's headed.

This project serves as an ultra-simple example of how Langchain can be used for RetrievalQA for documents, currently using ChatGPT as a LLM.

✨ Current Features:

  • Langchain Chats: I've been playing with Langchain to chat about some docs, and it's pretty fun!
  • Models: I am using ChatGPT as LLM model and bge-base-en as the embedding model.
  • ChromaDB Storage: I'm using ChromaDB to keep the document vectors. It seems to work well for this purpose.
  • My Little and Simple Scrapers: Right now, I've got a couple of simple scrapers for AWS FAQs and Baldur’s Gate 3 a great game. Just the start of my data adventures!

🌱 What's Next?

Honestly, I'm still figuring things out. But I do hope to add a few more scrapers and see where this goes.

If you're curious or have some friendly tips, feel free to drop a message or a suggestion. Always happy to learn and chat! πŸ˜„

Concepts

RAG

RAG, or Retrieval-Augmented Generation, serves as an innovative AI framework designed to extract factual information from an external knowledge base. This framework is essential for grounding large language models (LLMs) in the most accurate and current information available on specific subjects. By doing so, it ensures that the generated content is not only relevant but also reliable and well-informed.

rag.png

Installation

First clone the repository to your local machine.

git clone [email protected]:douglasmakey/chatting-with-docs.git

Then navigate into the project directory and install the dependencies.

cd chatting-with-docs
pip install -r requirements.txt

Usage

The project provides two main commands: feed, scraping and app.

Scraping Command

The scraping command is used to scrape websites using the internal scraper implementations provided by the project.

# BG3 because YOLO !!
python main.py scraping --target bg3 --output-dir "docs/bg3"

Feed Command

The feed command allows you to feed documents into a ChromaDB database. Here's how to use it:

python main.py feed --from-path <path> --collection-name <name> --split-documents
  • from-path: Path to the folder with the documents.
  • collection-name: The name of the collection to create.
  • split-documents: Split documents into chunks (optional).
  • data-type: The type of data to feed (default: pdf) (optional).
  • chromadb-persitent-path: The path to the ChromaDB persistent storage (default: db) (optional).

App Command

python main.py app

Examples

# Feed documents from a folder
python main.py feed --from-path /path/to/documents --collection-name my_collection

# Feed pdf documents from a folder and split them into chunks
python main.py feed --from-path /path/to/documents --collection-name my_collection --split-documents

# Feed text documents from a folder
python main.py feed --from-path /path/to/documents --collection-name my_collection --data-type txt

# Feed with the documents from BG3 scraper
python main.py feed --from-path /docs/bg3 --collection-name bg3 --no-split-documents

# Run the Streamlit app
python main.py app

Screenshots

Alt text

Contribution

Feel free to submit issues or pull requests. Your contributions are appreciated!

License

This project is licensed under the MIT License.

chatting-with-docs's People

Contributors

douglasmakey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.