How wombyz/gpt4all_langchain_chatbots works
This repository is a set of GPT4All usage examples: standalone generation, a basic LangChain prompt workflow, and knowledge-base query/chat workflows. Users provide a prompt or question; the knowledge workflows retrieve context from a FAISS index before generating an answer. The chatbot also includes document-loading and index-building functions, though its current execution loads a saved index. Edges reflect visible calls and reads; the index-building path is included as a documented-in-code capability, but its calls are commented out.
Main entry points: custom_knowledge_chatbot.py Conversational Chatbot · custom_knowledge_query.py Knowledge Query · full_sotu_index FAISS Index · pygpt4all_setup.py Direct Generation
Components 15
Standalone GPT4All
- Direct Generation
pygpt4all_setup.py - Nomic Prompt
nomic_setup.py
LangChain Examples
- Basic Prompt Chain
basic_langchain_setup.py
Knowledge Workflows
- Conversational Chatbot
custom_knowledge_chatbot.py - Knowledge Query
custom_knowledge_query.py - Document Loading
custom_knowledge_chatbot.py - Chunking and Indexing
custom_knowledge_chatbot.py - Query Indexing Functions
custom_knowledge_query.py - FAISS Index
full_sotu_index - State of Union Text
docs/state_of_the_union.txt - Shortened State of Union Text
docs/shortened_sotu.txt
Other components
- User
- GPT4All Runtime
- LangChain GPT4All
- LlamaCpp Embeddings
Connections 22
- User → Basic Prompt Chain: enters question
basic_langchain_setup.py - Basic Prompt Chain → LangChain GPT4All: runs chain
basic_langchain_setup.py - LangChain GPT4All → GPT4All Runtime: generates answer
- User → Conversational Chatbot: enters questions
custom_knowledge_chatbot.py - Conversational Chatbot → FAISS Index: loads and retrieves
custom_knowledge_chatbot.py - Conversational Chatbot → GPT4All Runtime: generates answers
custom_knowledge_chatbot.py - Conversational Chatbot → LlamaCpp Embeddings: initializes embeddings
custom_knowledge_chatbot.py - Document Loading → State of Union Text: loads text
custom_knowledge_chatbot.py - Chunking and Indexing → Document Loading: splits loaded text
custom_knowledge_chatbot.py - Chunking and Indexing → LlamaCpp Embeddings: embeds chunks
- Chunking and Indexing → FAISS Index: creates index
- User → Knowledge Query: runs question
custom_knowledge_query.py - Knowledge Query → FAISS Index: loads index
custom_knowledge_query.py - Knowledge Query → LlamaCpp Embeddings: initializes embeddings
custom_knowledge_query.py - Knowledge Query → GPT4All Runtime: runs answer chain
custom_knowledge_query.py - Query Indexing Functions → Shortened State of Union Text: loads text
- Query Indexing Functions → LlamaCpp Embeddings: embeds chunks
- Query Indexing Functions → FAISS Index: creates index
- User → Direct Generation: starts generation
pygpt4all_setup.py - Direct Generation → GPT4All Runtime: generates text
pygpt4all_setup.py - User → Nomic Prompt: starts prompt
nomic_setup.py - Nomic Prompt → GPT4All Runtime: opens and prompts
nomic_setup.py