Improving the performance of the GPT-4-powered chatbot by 1900% with Pinecone, LangChain, and embeddings
Spren
Project Overview
Spren saw potential in utilizing generative AI to provide users with recommendations and answers to their questions and increase user engagement. They had an idea to integrate the GPT model into their chat. The model would then combine user context with an industry-specific knowledge base to provide users with reliable answers and recommendations.
Our tasks
GPT Integration
A generative AI chatbot was meant to be implemented into an existing iOS mobile app. It was necessary to connect the internal database, GPT (APIs, agents), and the application’s front-end.
GPT Optimization
To achieve a satisfying level of performance and accuracy, it was necessary to run several experiments, testing different prompts and model parameters. The goal was to shorten the response time to a minimum.
Back-end Optimization
At the same time, it was important to implement several architectural and infrastructural backend solutions inside the app that would handle the chatbot in the most efficient way without causing any delays on the user’s side.
01
Goals
Increasing user engagement
Making data more understandable
Improving the app’s performance

The Neoteric team were excellent as a staff-augment to our engineering team. The leadership group took the time to understand our needs and recommend the right augment skillsets. Their engineers work hard and fast, always keeping us on our toes! We’re pleased with the combined end product and look forward to working with the Neoteric team again.

Vivek Menon, Co-founder of Spren
02
Challenges

Long response time
Unstructured data
GPT hallucinating
03
Our approach
Testing different models
Increasing model performance by using embeddings


Filtering the knowledge base with a relevance score
Basing architecture on LangChain
Technology we used
Copilot
Pinecone
LangChain
GPT-3.5
GPT-4
04
Results
Shortening the bot’s time of response by 95%
Thanks to implemented solutions and optimizations, we managed to decrease the bot’s response time in the mobile app from ~40 seconds to ~2 seconds. This significantly improves the usability of the solution to the end users.
Delivering an MVP ready to be tested with users
One of the goals at this stage of the project was to validate the assumptions and test the idea of introducing an AI-powered assistant to the app. The MVP that we helped to deliver enabled successful tests with users and further product development.


