---
title: "Discussion on \"Building an Interactive Chatbot with Langchain, ChatGPT, Pinecone, and Streamlit\" | Hashnode"
description: "Discussion on \"Building an Interactive Chatbot with Langchain, ChatGPT, Pinecone, and Streamlit\". Creating a chatbot that leverages the power of Langchain, OpenAI's ChatGPT, Pinecone, and Streamlit Chat."
url: "https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Building an Interactive Chatbot with Langchain, ChatGPT, Pinecone, and Streamlit](https://blog.futuresmart.ai/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit?utm_source=hashnode&utm_medium=feed)

Creating a chatbot that leverages the power of Langchain, OpenAI's ChatGPT, Pinecone, and Streamlit Chat.

May 21, 2023 · 7 min read · blog.futuresmart.ai  
Read the article

-   [#langchain](https://hashnode.com/tag/langchain)
-   [#pinecone](https://hashnode.com/tag/pinecone)
-   [#chatgpt](https://hashnode.com/tag/chatgpt)
-   [#openai](https://hashnode.com/tag/openai)
-   [#chatbot](https://hashnode.com/tag/chatbot)

## Written by

[Pradip Nichite](https://hashnode.com/@pnichite)

@pnichite · India

  
[View profile](https://hashnode.com/@pnichite)

Lead Data Scientist | NLP | GPT-3 | GPT-4 | ChatGPT | AWS

🚀 I'm a Top Rated Plus NLP freelancer on Upwork with over $300K in earnings and a 100% Job Success rate. This journey began in 2022 after years of enriching experience in the field of Data Science. 📚 Starting my career in 2013 as a Software Developer focusing on backend and API development, I soon pursued my interest in Data Science by earning my M.Tech in IT from IIIT Bangalore, specializing in Data Science (2016 - 2018). 💼 Upon graduation, I carved out a path in the industry as a Data Scientist at MiQ (2018 - 2020) and later ascended to the role of Lead Data Scientist at Oracle (2020 - 2022). 🌐 Inspired by my freelancing success, I founded FutureSmart AI in September 2022. We provide custom AI solutions for clients using the latest models and techniques in NLP. 🎥 In addition, I run AI Demos, a platform aimed at educating people about the latest AI tools through engaging video demonstrations. 🧰 My technical toolbox encompasses: 🔧 Languages: Python, JavaScript, SQL. 🧪 ML Libraries: PyTorch, Transformers, LangChain. 🔍 Specialties: Semantic Search, Sentence Transformers, Vector Databases. 🖥️ Web Frameworks: FastAPI, Streamlit, Anvil. ☁️ Other: AWS, AWS RDS, MySQL. 🚀 In the fast-evolving landscape of AI, FutureSmart AI and I stand at the forefront, delivering cutting-edge, custom NLP solutions to clients across various industries.

## Responses 13

Markdown supported · ⌘↵ to post

[Suganya S](https://hashnode.com/@SuganyaS)

[Aug 28, 2024](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/66cead09eba2021faaf1d04d)

Good

[Archi Jham](https://hashnode.com/@archi101)

[Jun 14, 2024](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/666ccc39a812fab495d01084)

Brilliant

[Anupam Khan](https://hashnode.com/@anupammlearn)

[Apr 26, 2024](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/662b8c69fa8edef931f5adba)

good

[vinay Kumat](https://hashnode.com/@vinaygautam81)

[Apr 1, 2024](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/660ae0d96c9e777e7278daf3)

hello, its nice to see your chatbot video on youtube

[NUSABET - NUSA338.SITE - DAFTAR & LOGIN - RTP SLOT GACOR 100%](https://hashnode.com/@nusabet)

[Jan 9, 2024](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/659cfc5ed3023fdd6f820839)

NUSABET - Merupakan situs judi online terpercaya di indonesia yang menyediakan berbagai macam jenis permainan judi online terupdate diantaranya : Slot online, taruhan bola sbobet, live casino Online, sabung ayam, togel, & joker gaming. wa : +85581609991.

BONUS NEW MEMBER GACOR NUSABET :

🔱 EXTRA BONUS 220% SLOT GAMES🔱

🔱 MEGA BONUS 100% SLOT GAMES🔱

🔱 MEGA BONUS 50% SLOT GAMES🔱

🔱 BONUS 25 20 SLOT GAMES🔱

Link : [magic.ly/nusabet-official](https://magic.ly/nusabet-official)

[farhan oc](https://hashnode.com/@farhaneng)

[Dec 29, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/658e99b31692adb30db4b291)

[Pradip Nichite](https://hashnode.com/@pnichite)

ValueError: variable history should be a list of base messages.

Can you please help with it?

[Ekins Kuuzie](https://hashnode.com/@ZeusMD)

[Dec 3, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/656bc54c03318819fa39c768)

ValueError: variable history should be a list of base messages, got

I get this error when I try to run the code . Anyone else getting this error ? How do I resolve it ?

[farhan oc](https://hashnode.com/@farhaneng)

[Dec 28, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/656bc54c03318819fa39c768#reply-658d8291d5ca6e025266aa18)

I got same error, working on it, if i find a solution share with you :)

[farhan oc](https://hashnode.com/@farhaneng)

[Dec 29, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/656bc54c03318819fa39c768#reply-658eb5dc1692adb30db64d49)

conversation\_summary = ConversationChain( llm=llm, memory=ConversationBufferWindowMemory(k=10, return\_messages=True), prompt=prompt\_template, verbose=True )

update this line, it resolved my issue.

[brucehopkins](https://hashnode.com/@brucehopkins)

[Nov 29, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/656704112c98ee1a31323c5a)

i am also using ai chat for developing apk games. it works effectively

[Parna Mishra](https://hashnode.com/@parnamishra)

[Nov 28, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/6566219144ab01484e94c4f8)

I am getting the below error when main.py file

KeyError: 'st.session\_state has no key "responses". Did you forget to initialize it?

Can anyone please help me rectify this?

[Vamshi Krishna](https://hashnode.com/@krishna309)

[Jan 2, 2024](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/6566219144ab01484e94c4f8#reply-6593e4758010c2ed87e998c9)

Did you resolve this issue [Parna Mishra](https://hashnode.com/@parnamishra)

[Prasad Gujar](https://hashnode.com/@pg0409)

[Oct 21, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/65343c84aa602055e82fd1ad)

Awsome Article

[Akhil teja](https://hashnode.com/@iakhil)

[Sep 9, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64fc75a2d97346b470a1e767)

Amazing work! Hope to integrate into real-time customised products.

[Dinesh Singh](https://hashnode.com/@dineshsingh2003)

[Aug 9, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64d302c4c1b3ce0c7e934941)

NA

[Eric Hartford](https://hashnode.com/@quixi)

[Jul 6, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64a67574d6052e06fc15e717)

is it possible using faiss instead of pinecone?

[Thomas Wawra](https://hashnode.com/@superseoworld)

[Jun 25, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64981edeee8fae5a272da032)

With regards to the pinecone db: will openai get and store your data or will it be private?

[Mayur Ghadge](https://hashnode.com/@mayursinh9007)

[Jun 19, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64904c48aa3e031681680e57)

How to connect indexing.py file with main.py in streamlit. I am getting an error, can you please help me.

[Versace](https://hashnode.com/@Versace)

[Jun 29, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64904c48aa3e031681680e57#reply-649cde517fcfbd9ddc25bcc0)

i run the indexing.py file with the terminal and the pinecone write in the file

[Sarit Bahuguna](https://hashnode.com/@sarit545)

[Nov 30, 2023](https://hashnode.com/posts/building-an-interactive-chatbot-with-langchain-chatgpt-pinecone-and-streamlit/646a39eae56ee64c3d800e77/comment/64904c48aa3e031681680e57#reply-6568198884ca99a5e618353c)

**When I Run indexing.py file with the terminal** **This is Code indexing.py**

from langchain.document\_loaders import DirectoryLoader from langchain.text\_splitter import RecursiveCharacterTextSplitter import os

directory = '/data/SwiftProgrammingLanguage.pdf'

def load\_docs(directory): loader = DirectoryLoader(directory) documents = loader.load() return documents

documents = load\_docs(directory) len(documents)

def split\_docs(documents,chunk\_size=500,chunk\_overlap=20): text\_splitter = RecursiveCharacterTextSplitter(chunk\_size=chunk\_size, chunk\_overlap=chunk\_overlap) docs = text\_splitter.split\_documents(documents) return docs

docs = split\_docs(documents) print(len(docs))

\*\*when I run python3 indexing.py Getting error

python3 indexing.py

/Users/sarit.bahuguna/ai\_chatbot/data/SwiftProgrammingLanguage.pdf

**\[nltk\_data\] Error loading punkt: <urlopen error \[Errno 60\] Operation**
