Jump to content

Vector database: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{stub}}
{{see also|AI terms}}
==Introduction==
==Introduction==
A [[vector database]] is a type of [[database]] specifically designed for storing and querying [[high-dimensional vector data]], which is often used in [[artificial intelligence applications]] ([[AI]] [[apps]]). These databases are gaining popularity due to their ability to extend [[large language models]] ([[LLMs]]) with [[long-term memory]] and provide efficient [[querying]] for AI-driven applications.
A [[vector database]] is a type of [[database]] specifically designed for storing and querying [[high-dimensional vector data]], which is often used in [[artificial intelligence applications]] ([[AI]] [[apps]]). These databases are gaining popularity due to their ability to extend [[large language models]] ([[LLMs]]) with [[long-term memory]] and provide efficient [[querying]] for AI-driven applications.
Line 18: Line 20:
==Example Code==
==Example Code==
To demonstrate the usage of a vector database, the following example shows how to use [[Chroma]] with [[JavaScript]]. First, create the client and define an [[embedding function]]. In this case, the [[OpenAI API]] is used to update the embeddings whenever a new data point is added. Each data point is a document with an ID and some text. The database can be queried by passing a string of text, and the result includes the data along with an array of distances, where smaller numbers indicate higher degrees of similarity.
To demonstrate the usage of a vector database, the following example shows how to use [[Chroma]] with [[JavaScript]]. First, create the client and define an [[embedding function]]. In this case, the [[OpenAI API]] is used to update the embeddings whenever a new data point is added. Each data point is a document with an ID and some text. The database can be queried by passing a string of text, and the result includes the data along with an array of distances, where smaller numbers indicate higher degrees of similarity.
[[Category:Terms]] [[Category:Artificial intelligence terms]]
370

edits