Himanshu Saleria

Engineering
December 3, 2024

Himanshu Saleria

December 3, 2024
Engineering

OpenAI Assistants, Vector Stores and File Storage Tool

In the realm of AI-driven solutions, OpenAI-powered assistants are revolutionizing the way users interact with software, providing insightful, contextually accurate responses to a variety of queries. These assistants leverage tools like vector stores, making it easier than ever to handle complex data queries efficiently. This blog explores the power of OpenAI assistants, the role of vector stores, and how a continuously updating database enables AI models to deliver timely, relevant responses to users.

What Are OpenAI Assistants?

OpenAI assistants are AI models designed to understand and respond to natural language queries. They’re used in many applications, from customer support chatbots to personal assistants that help answer FAQs, streamline workflows, or guide users through complex tasks. These assistants are highly customizable, allowing developers to configure them for specific use cases, adjusting parameters to optimize interactions for user needs.

What are Vector Stores?

One of the critical components in creating an effective OpenAI assistant is the vector store. At its core, a vector store is a database that stores embeddings, or vector representations, of text data. Here’s how it works:

Data Storage and Management

When files are uploaded to a vector store, they are automatically chunked into smaller sections, converted into vector embeddings, and stored in a vector database. Each chunk represents a piece of information from the document, optimized for retrieval.

Efficient Data Retrieval

When a user query is submitted, the assistant references the vector store to find relevant data chunks. This approach allows the assistant to process and respond to queries much faster than it would by searching through raw text data.

File Search Tool for Enhanced Query Processing

File Search tool is responsible for Data Storage and Management and Efficient Data Retrieval. You can upload your files to File storage tool and it converts the text in the file into chunks, creates embeddings and stores it into the vector store.

When a user asks a query, it matches the query with vector store and get the relevant information to be shown to the user.

FThe file search tool in OpenAI optimizes query responses by leveraging retrieval best practices. These optimizations make vector stores ideal for applications that require precise, real-time responses.

File Search tool

FileSearch is a tool by OpenAI that is based on vector stores as explained in the last section. The FilesSearch tool implements several retrieval best practices out of the box to help you extract the right data from your files to augment the model’s responses. Some of the techniques it implements are:

  • Query Optimization: User queries are rewritten and optimized for better search results.
  • Parallel Processing: Complex queries are broken down and processed in parallel for efficient data retrieval.
  • Keyword and Semantic Search: The tool performs both keyword-based and semantic searches to ensure a broad and accurate data retrieval.
  • Result Reranking: Retrieved results are reranked to select the most relevant responses, ensuring accuracy in answers.

The default settings for the FileSearch tool are as follows, though they can be customized as needed:

  • The chunk size is set to 800 tokens, with an overlap of 400 tokens between chunks to ensure context continuity.
  • The embedding model used is text-embedding-3-large, which operates at 256 dimensions for optimal vector representation.
  • The tool can incorporate up to 20 chunks into the context for each query to enhance response accuracy.

Current Limitations

  • The tool currently has limited support for deterministic pre-search filtering using custom metadata.
  • Parsing capabilities for images within documents, including charts, graphs, and tables, are limited.
  • It offers restricted retrieval options for structured file formats, such as CSV or JSONL.
  • The tool is optimized for search queries and currently provides minimal support for summarization. For more details, please refer to the list of supported file types.

Refusal condition

A "refusal condition" refers to the built-in safeguards or rules that guide the AI model to refuse certain types of requests or actions. These refusal conditions are designed to ensure that the AI behaves responsibly and adheres to ethical guidelines, preventing it from generating harmful, inappropriate, or unsafe content. More details here: OpenAI Platform

OpenAI pricing

  1. Token Usage
  2. Tokens represent segments of words, with each token generally corresponding to around four characters of English text. For example, the phrase “ChatGPT is great!” consists of about six tokens. The total cost of an API call is based on the combined number of tokens used in both the input (prompt) and the output (response).
  3. Pricing Tiers
  4. OpenAI provides different model options, such as GPT-4 and GPT-3.5, each with unique capabilities and associated costs. Users can select a model that best suits their requirements and budget.
  5. File Search
  6. For file-based data training, there is an additional charge based on the storage size of the vector store. File Search costs $0.10 per GB of vector store storage per day, with the first GB provided at no cost. The storage size depends on the final size of the vector store after parsing, chunking, and embedding each file.

Continuous Updating Data: Keeping Responses Relevant

One of the challenges in using AI assistants is maintaining the relevance of the data they pull from, especially in fast-changing domains. Here’s how continuous updates work:

  1. Dynamic Data Refreshing: New information can be added to the vector store as it becomes available. By periodically uploading new data or removing outdated information, the vector store remains current, allowing the assistant to provide responses that reflect the latest knowledge.
  2. Automating Updates: Using Vector Store APIs, you can update vector store. This ensures that the assistant database is continuously refreshed without manual intervention, improving response accuracy and saving time.

Summary

In this blog, we explored the transformative role of OpenAI-powered assistants and how they are reshaping user interaction by delivering accurate, contextually relevant responses across various applications. OpenAI assistants leverage vector stores, which serve as efficient, structured databases that store vector representations of data, enabling faster and more accurate query responses. We looked at the capabilities of the FileSearch tool, which enhances data retrieval through techniques like query optimization, parallel processing, and result reranking, making it ideal for applications needing real-time, precise information.

Additionally, we discussed the importance of continuous database updates to maintain relevance in dynamic environments. By incorporating dynamic data refreshing and automated updates, vector stores ensure that OpenAI assistants access the latest information, resulting in timely, accurate responses for users. Together, these advancements make OpenAI assistants powerful tools for enhancing user experience through intelligent, responsive AI-driven interactions.

Supercharge your retention with in-app social features

Deploy customised features on top of chat and feed in 15 minutes using LikeMinds SDK.

Schedule a demo!
Image showing Resource Library, which is a inApp feed usecase.

Share now

NEWSLETTER

Get a front row seat to everything happening at LikeMinds including some curated expert insights each week, delivered straight to your inbox.
We promise to not spam. 🤝🏻

Sign Up Now!

Follow us

OpenAI Assistants, Vector Stores and File Storage Tool

Himanshu Saleria
/
December 3, 2024
/

In the realm of AI-driven solutions, OpenAI-powered assistants are revolutionizing the way users interact with software, providing insightful, contextually accurate responses to a variety of queries. These assistants leverage tools like vector stores, making it easier than ever to handle complex data queries efficiently. This blog explores the power of OpenAI assistants, the role of vector stores, and how a continuously updating database enables AI models to deliver timely, relevant responses to users.

What Are OpenAI Assistants?

OpenAI assistants are AI models designed to understand and respond to natural language queries. They’re used in many applications, from customer support chatbots to personal assistants that help answer FAQs, streamline workflows, or guide users through complex tasks. These assistants are highly customizable, allowing developers to configure them for specific use cases, adjusting parameters to optimize interactions for user needs.

What are Vector Stores?

One of the critical components in creating an effective OpenAI assistant is the vector store. At its core, a vector store is a database that stores embeddings, or vector representations, of text data. Here’s how it works:

Data Storage and Management

When files are uploaded to a vector store, they are automatically chunked into smaller sections, converted into vector embeddings, and stored in a vector database. Each chunk represents a piece of information from the document, optimized for retrieval.

Efficient Data Retrieval

When a user query is submitted, the assistant references the vector store to find relevant data chunks. This approach allows the assistant to process and respond to queries much faster than it would by searching through raw text data.

File Search Tool for Enhanced Query Processing

File Search tool is responsible for Data Storage and Management and Efficient Data Retrieval. You can upload your files to File storage tool and it converts the text in the file into chunks, creates embeddings and stores it into the vector store.

When a user asks a query, it matches the query with vector store and get the relevant information to be shown to the user.

FThe file search tool in OpenAI optimizes query responses by leveraging retrieval best practices. These optimizations make vector stores ideal for applications that require precise, real-time responses.

File Search tool

FileSearch is a tool by OpenAI that is based on vector stores as explained in the last section. The FilesSearch tool implements several retrieval best practices out of the box to help you extract the right data from your files to augment the model’s responses. Some of the techniques it implements are:

  • Query Optimization: User queries are rewritten and optimized for better search results.
  • Parallel Processing: Complex queries are broken down and processed in parallel for efficient data retrieval.
  • Keyword and Semantic Search: The tool performs both keyword-based and semantic searches to ensure a broad and accurate data retrieval.
  • Result Reranking: Retrieved results are reranked to select the most relevant responses, ensuring accuracy in answers.

The default settings for the FileSearch tool are as follows, though they can be customized as needed:

  • The chunk size is set to 800 tokens, with an overlap of 400 tokens between chunks to ensure context continuity.
  • The embedding model used is text-embedding-3-large, which operates at 256 dimensions for optimal vector representation.
  • The tool can incorporate up to 20 chunks into the context for each query to enhance response accuracy.

Current Limitations

  • The tool currently has limited support for deterministic pre-search filtering using custom metadata.
  • Parsing capabilities for images within documents, including charts, graphs, and tables, are limited.
  • It offers restricted retrieval options for structured file formats, such as CSV or JSONL.
  • The tool is optimized for search queries and currently provides minimal support for summarization. For more details, please refer to the list of supported file types.

Refusal condition

A "refusal condition" refers to the built-in safeguards or rules that guide the AI model to refuse certain types of requests or actions. These refusal conditions are designed to ensure that the AI behaves responsibly and adheres to ethical guidelines, preventing it from generating harmful, inappropriate, or unsafe content. More details here: OpenAI Platform

OpenAI pricing

  1. Token Usage
  2. Tokens represent segments of words, with each token generally corresponding to around four characters of English text. For example, the phrase “ChatGPT is great!” consists of about six tokens. The total cost of an API call is based on the combined number of tokens used in both the input (prompt) and the output (response).
  3. Pricing Tiers
  4. OpenAI provides different model options, such as GPT-4 and GPT-3.5, each with unique capabilities and associated costs. Users can select a model that best suits their requirements and budget.
  5. File Search
  6. For file-based data training, there is an additional charge based on the storage size of the vector store. File Search costs $0.10 per GB of vector store storage per day, with the first GB provided at no cost. The storage size depends on the final size of the vector store after parsing, chunking, and embedding each file.

Continuous Updating Data: Keeping Responses Relevant

One of the challenges in using AI assistants is maintaining the relevance of the data they pull from, especially in fast-changing domains. Here’s how continuous updates work:

  1. Dynamic Data Refreshing: New information can be added to the vector store as it becomes available. By periodically uploading new data or removing outdated information, the vector store remains current, allowing the assistant to provide responses that reflect the latest knowledge.
  2. Automating Updates: Using Vector Store APIs, you can update vector store. This ensures that the assistant database is continuously refreshed without manual intervention, improving response accuracy and saving time.

Summary

In this blog, we explored the transformative role of OpenAI-powered assistants and how they are reshaping user interaction by delivering accurate, contextually relevant responses across various applications. OpenAI assistants leverage vector stores, which serve as efficient, structured databases that store vector representations of data, enabling faster and more accurate query responses. We looked at the capabilities of the FileSearch tool, which enhances data retrieval through techniques like query optimization, parallel processing, and result reranking, making it ideal for applications needing real-time, precise information.

Additionally, we discussed the importance of continuous database updates to maintain relevance in dynamic environments. By incorporating dynamic data refreshing and automated updates, vector stores ensure that OpenAI assistants access the latest information, resulting in timely, accurate responses for users. Together, these advancements make OpenAI assistants powerful tools for enhancing user experience through intelligent, responsive AI-driven interactions.

Supercharge your retention with in-app social features

Deploy customised features on top of chat and feed in 15 minutes using LikeMinds SDK.

Let's start!