Using IRIS as a vector database
InterSystems IRIS embedded vector search capabilities lets us search unstructured and semi-structured data. Data is converted to vectors (also called ‘embeddings’) and then stored and indexed in InterSystems IRIS for semantic search, retrieval-augmented generation (RAG), text analysis, recommendation engines, and other use cases.
This is a simple demo of IRIS being used as a vector database and similarity search on IRIS.
Prerequisites:
- Python
- InterSystems IRIS for Health - as it will be used as the vector database
Repository: https://github.com/piyushisc/vectorsearchusingiris
Steps to follow:
- Clone the repo.
- Open VS Code, connect to desired instance and namespace of IRIS and compile the classes.
- Open IRIS Terminal and invoke the command
do ##class(vectors.vectorstore).InsertEmbeddings(), which reads the text from the filetext.txtand generate embeddings and store them in IRIS. - Invoke the command
do ##class(vectors.vectorstore).VectorSearch("search_terms")with desired words to perform similarity search. IRIS will return top three closest match:
Discussion (0)1