๐ Curious about how to build an ๐๐ ๐๐ต๐ฎ๐๐ฏ๐ผ๐? Here's how I am creating one for a client for my AI consulting business๐ ๐ ๐๐ถ๐ฟ๐๐, ๐๐ต๐ฒ ๐ง๐ฒ๐ฐ๐ต ๐ฆ๐๐ฎ๐ฐ๐ธ ๐น Streamlit - I use this to display the chat interface itself ๐น OpenAI - Grab an API key for GPT3.5+ for prompt processing/generation ๐น LangChain - Open-source for building chatbot application ๐น Pinecone - Vector DB to store customer's document data ๐น FastAPI - Use this as the API framework ๐บ๏ธ ๐ฆ๐ฒ๐ฐ๐ผ๐ป๐ฑ, ๐๐ป๐ฑ๐ฒ๐ฟ๐๐๐ฎ๐ป๐ฑ ๐๐ต๐ฒ ๐ณ๐น๐ผ๐ 1. The user sends a request prompt request via Streamlit chat interface 2. FastAPI receives the endpoint that invokes the LLM agent 3. The LLM agent doesn't generate the prompt right away, it selects Tools 4. Tools include (A) querying Snowflakes or (B) retrieving docs from Pinecone 4A. If Agent uses SQL, it creates an SQL script executable in Snowflakes 4B. If Agent needs contexts, use retriever to get docs from Pinecone 5. Agent responses with user question + chat history (memory) + context ๐ก ๐๐ผ๐ป๐๐ถ๐ฑ๐ฒ๐ฟ๐ฎ๐๐ถ๐ผ๐ป๐ Prototyping is the easy part, but implementation at the enterprise level is the most challenging part of the work. โ Security is the biggest issue for chatbots. User can use prompt injection to shutdown an SQL DB or service if the agent has permission to do so. โ Managing multiple data from multiple clients. Not all users should have access to all the data in the vector store. You have to create a new index per client or use a namespace per client to separate client data. โ Prompt evaluation in scale. You can't use generic LLM data like MMLU for evaluating chatbot as the task involved is specialized. Work with an SME and train a separate LLM that evaluates responses. Or gather user-based signals to gauge the level of engagement with a chatbot. ๐ LLM is a game-changer. And, I will show you how to leverage one for your company's use case. Make sure you follow me Daniel Lee and smash the ๐ ๐ Join AI School to learn AI and sign up for the newsletter at https://lnkd.in/dRUqb5cJ ๐ Land Data/AI jobs with datainterview.com. I am teaching ๐๐ฆ ๐๐ป๐๐ฒ๐ฟ๐๐ถ๐ฒ๐ ๐๐ผ๐ผ๐๐ฐ๐ฎ๐บ๐ฝ ๐ in 4 weeks! Join me: https://lnkd.in/eiA5Ntdp
This is wonderful, Daniel. Humata is a no-code way to create an AI chatbot grounded on your own data. See more here: https://www.linkedin.com/feed/update/urn:li:activity:7193942801183584256/
There are several AI chatbot builders that do not require Langchain or Pinecone. It has very few lines of prompting and is simple to do. What are your thoughts on Orimon, New Oaks, Retune, and Chatbase?
See also performance comparison to build LLM/RAG apps with vector databases, at https://mltblog.com/3weQ2UP
I like how you broke it down, Daniel Lee. I have worked with similar architecture. My biggest pain point: - Agent routing issues when accessing tools. How does your agent handle routing issues?
Very informative
Loved the way you articulated all the points ๐
Fantastic breakdown! Your approach to building an AI Chatbot is incredibly thorough and well-considered. Thanks for sharing your expertise! ๐
Very informative
Thanks. Fascinating stuff.
AI Engineer @ Centific
2moInsightful!