davidshtian / Bedrock-ChatBot-with-LangChain-and-Streamlit

A simple and clear example for implement a chatbot with Bedrock (Claude and Mistral) + LangChain + Streamlit.
62 stars 24 forks source link

Add Local FAISS Indexing for Persistent File Handling and Enhance Chatbot Responsiveness #6

Closed madtank closed 4 months ago

madtank commented 4 months ago

Description

This PR introduces a significant enhancement to our chatbot, incorporating local FAISS indexing for a persistent, efficient handling of document files, which improves the chatbot's response accuracy and performance. Additionally, a minor improvement to dynamic persona management has been implemented to refine interaction quality.

Key Features

Local FAISS Indexing: Users can now utilize bedrock_indexer.py to index files stored in the documents folder. This indexing is crucial for maintaining a persistent, efficient search base, allowing the chatbot to perform content-based responses without the need to re-index with each session. Dynamic Persona Adjustment: While a minor update, the chatbot's ability to adjust its persona based on interaction context has been refined, enhancing user engagement.

Usage

Users are required to execute the indexing script to prepare the environment for the chatbot's optimal performance. Here’s how to get started:

Indexing Files: Run python bedrock_indexer.py to index files located in the documents folder. Querying: Post-indexing, the chatbot is ready to handle queries with improved accuracy and relevance based on the indexed content. Implementation Details The indexing process leverages FAISS for its powerful, scalable indexing capabilities suitable for handling large datasets. Ensuring that the indices are persistent allows the chatbot to utilize previously indexed data, significantly reducing overhead on subsequent uses. Considerations Indexing is a prerequisite for the enhanced query capabilities. Users must run the indexing script prior to utilizing the chatbot for content-based responses. Future enhancements should aim to streamline the indexing process, making it more seamless and possibly automated during the chatbot initialization phase. Future Work Develop an automated system for indexing at chatbot startup, reducing the manual steps required by the user. Continue refining the dynamic persona features to better adapt to user interactions and preferences. How to Test Navigate to the chatbot directory and run the indexing script: python bedrock_indexer.py. Start the chatbot and test its response capabilities with various queries to evaluate the effectiveness of the FAISS indexing.

davidshtian commented 4 months ago

Thanks for the great contribution~