Find Meaning in Your Data with Vector Search in InterSystems IRIS

January 16, 2025

Imagine searching data by meaning, not just keywords. With vector search in InterSystems IRIS, this is possible! You can build smarter applications, deliver personalized experiences, and unlock the true potential of your data. 

Are you a new InterSystems IRIS user? Keep reading to learn what a vector database is and how the new Vector Search feature in InterSystems IRIS can transform your applications!

What is a Vector Database?

The Basic Concept

A vector database stores data as mathematical vectors, enabling comparisons based on semantic similarity.

 Why does it matter?

  • Vectors transform complex data (text, images, etc.) into representations that algorithms can process.
  • Unlike traditional databases, which rely on exact matches, vector databases allow searches based on context and meaning.

Practical Example:

  • Question: "What products are similar to this item?"
  • Answer: The system finds similar items based on their features, not just their names.

To imagine this better, here’s a visual representation of vectors connected in a 3D graph.

Vectors connected in a 3D graph

How Do Vectors Work?

How does vector search work?

  1. Encoding: Data (text, images, etc.) is converted into vectors by machine learning models.
  2. Storage: These vectors are stored in a specialized database.
  3. Comparison: Vector search uses metrics like Euclidean distance to find the closest results.

This enables a deeper understanding of relationships between concepts, such as recognizing that 'car' and 'fuel efficiency' are more closely related than 'truck' and 'fuel efficiency.'

To illustrate this further, here is an example of vectors in 2D space being compared based on proximity and angle: the smaller angle between 'car' and 'fuel efficiency' indicates a stronger connection compared to the larger angle between 'truck' and 'fuel efficiency.

Vectors in 2D space being compared based on proximity and angle:

The Revolution with InterSystems IRIS

What’s new in InterSystems IRIS?


The IRIS Data Platform now supports the native VECTOR data type, allowing you to:

  • Store vectors directly in the database.
  • Perform vector searches without external tools.
  • Easily integrate with generative AI and NLP applications.

Exclusive Benefit
InterSystems IRIS combines enterprise database scalability with vector innovation to deliver unmatched performance for your applications.

Real-World Use Cases

Where to use Vector Search in IRIS?


1. Smarter chatbots: Deliver contextual, accurate, and relevant responses.
2. Personalized recommendations: Provide unique user experiences.
3. Image analysis: Quickly find visual similarities.

Practical Example:
An online store can use vectors to recommend products similar to a selected item based on features, not just keywords.

How to Get Started

Simple Steps with InterSystems IRIS:


1. Define the VECTOR data type in SQL to store vectors.
2. Use native functions, such as DISTANCE(), to compare vectors and find similarities.
3. Develop directly in Python within InterSystems IRIS to create custom embeddings and integrate AI into your environment.

Example 1: Creating embeddings directly in Python within InterSystems IRIS

Creating embeddings directly in Python within InterSystems IRIS

InterSystems IRIS allows you to run Python code directly, integrating AI and machine learning applications with your database.

Example 2: Saving vectors in InterSystems IRIS

Saving vectors in InterSystems IRIS

Conclusion

Ready to move beyond keyword-based search and discover the true potential of your data? Explore the power of vector search in InterSystems IRIS today! For more details, check the official documentation from InterSysyems.

About the author

Flavio Naves Junior has been a Software Developer with First Line Software for two years. With more than seven years of experience working with InterSystems, Flavio’s expertise helps our team stay ahead of the curve. As an FLS Ambassador Tech Titan, he provides technical advice and precision to the wider tech community.

Let’s talk!

Have any questions? Fill out the form and our team will be in touch!