Guides

Build A Custom AI Chatbot For Your Business Without The Hassles Of A Vector Database

This guide describes the role that vector databases play in creating chat-enabled applications, why they're crucial but also difficult to deal with, and how you can use existing APIs to get the same functionality but with added features for less cost and resources.
Shanif Dhanani
8.6 minutes

LLMs Create New Opportunities For Businesses

The release of ChatGPT has demonstrated the immense potential of large language models (LLMs) to help businesses increase productivity. Companies can now develop better customer support tools, create better internal search engines, answer common questions automatically, create ETL jobs that incorporate smart and automated decision-making, decrease research time, and much more, all with the help of LLMs. But in order to enable these business-specific use cases, LLMs require access to proprietary company data — documents, conversations, databases, product docs, and other sources of information that can help provide accurate, trustworthy information to handle user queries and requests.

This is where vector databases come in. The specialized systems can organize your textual data so that it's easy to retrieve relevant contextual information for a given topic based. They can find paragraphs in documents, rows in a Google Sheet, or files in a folder that are highly likely to contain the information needed by an LLM to answer a user's question without making up (or hallucinating) an answer. By using vector databases efficiently you can ensure that any answer that your users get from your chatbots are trustworthy and true to your company's policies and offerings.

Unfortunately, while vector databases are crucial for operating A.I. chatbots that can accurately answer questions from your team or your customers, they're not as easy to run and operate as you might think.

The Hidden Headaches of Vector Databases

On the surface, vector databases seem like a clean solution for easily creating a custom chatbot for your company's data. But the reality is that using a vector database isn't as easy as calling an API when you need to answer a question. They require a significant amount of investment in both time, personnel, and infrastructure to maintain and use in a chat-enabled application.

Data Integration Requires Constant Engineering Work

To function properly, vector databases need access to source content like Google Drive docs and internal databases. But they lack native connectors or pipelines, which means that engineering teams need to build custom scrapers or ETL jobs that can transfer data to them in a properly structured format and on a continuous basis. As new sources are added, more dev work is needed to continually integrate new types of data and data sources.

What does continuous engineering work look like?

For example, let's say that your company uses data from a Google Sheets file as the source of trusted information for a customer support chatbot. But your CSM team has started to keep track of FAQs in PDFs stored in Google Drive, and you now need to make sure your chatbot has access to that content to properly respond to your users. Even if your company was using a vector database to store data from Google Sheets, you'll need to write and maintain new software to access data from content in Google Drive.

You'll first need to create the ability for your chatbot to read in data from saved PDFs, which usually means implementing a new OAuth mechanism and reading in data from a new API. Then you'll need to create text embeddings from your content and index all of those embeddings into your vector database using its native API — and since many vector databases don't let you query for a list of the documents or document snippets that you've added to your index, you'll also need to build an entirely separate database just to keep track of which files you've actually added.

Finally, you'll need to ensure that you keep your index up to date, adding new content any time your source data changes, and removing old content whenever files are removed or changed. This constant updating of information means you'll need to implement scheduling infrastructure or webhooks that can track changes to your data and update your vector database's index appropriately. Because if you don't update your indexes, your vectors will become stale as your company's documents evolve, which means your users will get old or outdated information when they ask their questions.

Security and Access Controls Are Not Included

Vector databases also operate at the raw text layer without awareness of users or permissions. To support data access controls, you'll need to architect custom identity and authorization systems leveraging OAuth and SAML, and tightly integrate them with vector indexes. This complex task risks exposing sensitive information if not properly implemented.

This means that your engineering team now needs to incorporate existing permissions infrastructure, or create entirely new systems to track and manage who should have access to query and update your vector database.

Beefy Infrastructure And Ongoing Optimization

Running vector databases can also require provisioning sizable hardware clusters for indexing your content. And if you don't want to run your own hardware, you'll need to pay for a third party tool, but because most vector database providers still expect you to manage your index's size and fullness, you'll still need to monitor and optimize usage in your paid vector database service.

Pinecone, one of the leading vector database providers, still requires you to manage your indexes and infrastructure

No Turnkey LLM Integrations

Finally, vector databases just return text snippets. Additional infrastructure must be built to orchestrate interactions with downstream LLMs. So if you're building your own A.I. chatbot for your company, you'll not only need to integrate a vector database, but you'll also need to write the software that orchestrates data from your vector database with your LLM.

So while vector databases play a crucial role in ensuring your company can create a chatbot on its own data, you'll generally need to pour a lot of engineering resources into doing so, unless you go with an alternative solution that lets you combine the power of vector databases with the automation capabilities of a system that can automatically connect into your data, refresh it, maintain permissions, and integrate with an LLM.

APIs That Act As Vector Databases On Steroids

While vector databases provide important functionality for integrating business data with ChatGPT, managing them involves a lot of annoying heavy lifting. What if you could get all the benefits of vector search without the headaches?

That's where purpose-built APIs come in. Leading API platforms are emerging that handle the messy details of connecting to data sources, managing indexing and infrastructure, and orchestrating LLM queries on your behalf. These APIs act as "vector databases on steroids" by automating the challenging aspects of working with vector databases while also delivering greater functionality. Here are a couple of ways that purpose-built APIs can help:

Easy and Secure Data Connectors

API platforms can provide pre-built connectors to quickly integrate popular data sources using standard protocols like OAuth. New sources can be added through simple configuration versus custom coding, using either a simple point-and-click interface or a REST/JSON-based API interface that you're already familiar with. These platforms can automatically extract text/documents and handle identity management. This avoids building custom scrapers and access systems from scratch, which is costly and time-consuming.

Locusive's API provides access to built-in data connectors that let you easily refresh data

Fully Managed Indexing and Infrastructure

With APIs, document embedding and vector indexing runs continuously behind the scenes on managed infrastructure. This eliminates the overhead of provisioning and optimizing hardware clusters. The platforms also handle keeping indexes up-to-date by tracking changes across connected sources. No more re-indexing headaches as your data evolves, and no more having to worry about embeddings yourself.

Built-in LLM Integrations

If you're interested in using vector databases, it's likely you're looking to build some sort of integration with LLMs. The best APIs will have you covered, and will not only let you index and query documents, but will also have built-in support for invoking LLMs using indexed data. A single API call can allow retrieving relevant snippets from your documents and also generating an LLM response. If you're using an API system that allows lets you integrate with multiple data sources, and even other, third-party APIs, a single, consolidated API request to one system could even do the job of 20 separate API requests to multiple different systems.

Locusive's API makes it easy for you to integrate multpiple data sources and takes care of indexing, refreshing, permissions, and even invoking LLMs. You can start for free here.

Permissioning and Access Management

API platforms encapsulate identity providers and access policies so you don't have to build custom auth systems. Users and permissions are abstracted into a simple interface where a single user can connect to the tools that they have access to, and the API will use their access permissions to index and refresh data on a continuous basis.

Search results in less than a second

The best APIs will also result in fast searches no matter how large your dataset. It's important to ensure that your results come back as quickly as possible so your users can get their answer or find their documents quickly.

Locusive's API

At this point, you might be interested in getting started with an API that's built specifically to handle data ingestion, querying, and contextual information retrieval for your own chat-enabled applications. Fortunately, Locusive's API provides an easy way to help you get started with everything you need, without the hassles of operating your own vector database. The API lets you do everything you normally could with a traditional vector database, including indexing and querying data, but it handles all of the work of connecting to your data sources, ingesting and refreshing your data, and it even provides endpoints that let you automatically invoke an LLM using context from your data sources.

To start out, check out the Locusive API docs and Getting Started guide. With the right tools like Locusive's API, you can tap into the potential of ChatGPT without the headaches of running a vector database.