Introduction
Have you ever wished you could chat with your own notes, asking questions and getting instant, context-aware answers? In this project, I built a conversational AI chatbot that does exactly that—using your OneNote-style notes as its knowledge base. Powered by LangChain, FAISS, and Streamlit, this chatbot can be run both in the terminal and as a web app.
Motivation
As technical consultants, marketers, or support engineers, we often keep troubleshooting guides, customer notes, and solution summaries in text files or note-taking apps. Searching through these manually is tedious. What if you could just ask, “What should I do if the SSL status in Pardot shows ERROR?” and get a precise, referenced answer from your own notes?
How It Works
The chatbot uses retrieval-augmented generation:
- Load Notes: Your notes are stored in a plain text file (e.g.,
customer_xy_notes.txt
). - Split & Embed: The notes are split into chunks and embedded using HuggingFace models.
- Semantic Search: When you ask a question, the system finds the most relevant note snippets using FAISS.
- LLM Answering: A local LLM (via Ollama) generates an answer, referencing the retrieved context.
- Conversational Memory: The chatbot remembers previous questions and answers for context.
Example: Troubleshooting SSL Errors in Pardot
Here’s a sample note from the knowledge base:
Problem Summary
A new error appeared in the Domain Management section of Pardot. The SSL Status of a tracker domain was marked as “ERROR”.
…
Solution
A support ticket was opened with Salesforce, referencing this known issue. Salesforce confirmed the problem was not related to the certificate itself, but due to a glitch in their internal validation system. They manually reset the SSL status, and the domain now shows “Enabled” again.
When you ask the chatbot, “How do I fix SSL Status ERROR in Pardot?”, it will summarize the above and guide you to check the certificate, then contact Salesforce support if needed.
Running the Chatbot
Terminal Interface
python chatbot_terminal.py
Streamlit Web App
streamlit run streamlit_app.py
You’ll get a friendly chat UI in your browser:
Customizing for Your Notes
- Replace
customer_xy_notes.txt
with your own notes. - The chatbot will automatically use your content as its knowledge base.
Project Structure
chatbot_core_onenote.py
: Core logic (loading, embedding, retrieval, LLM).streamlit_app.py
: Web interface.chatbot_terminal.py
: Terminal interface.customer_xy_notes.txt
: Example notes file.
Why LangChain and Streamlit?
- LangChain: Makes it easy to combine retrieval and LLMs for question answering.
- FAISS: Fast, scalable semantic search.
- Streamlit: Instantly turns Python scripts into shareable web apps.
Conclusion
This project demonstrates how easy it is to build a personal knowledge chatbot using modern open-source tools. Whether you’re supporting customers, onboarding new team members, or just want smarter access to your notes, this approach can save you time and effort.
Try it out, and let me know what you build!