Langchain with InterSystems IRIS
Langchain with support for InterSystems IRIS
Install
pip install langchain-iris
Example
import os
from dotenv import load_dotenv
from langchain.docstore.document import Document
from langchain.document_loaders import TextLoader
from langchain.text_splitter import CharacterTextSplitter
from langchain.embeddings.openai import OpenAIEmbeddings
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.embeddings.fastembed import FastEmbedEmbeddings
from langchain_iris import IRISVector
loader = TextLoader("state_of_the_union.txt")
documents = loader.load()
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)
docs = text_splitter.split_documents(documents)
CONNECTION_STRING = 'iris://_SYSTEM:SYS@localhost:1972/USER'
load_dotenv(override=True)
embeddings = OpenAIEmbeddings()
COLLECTION_NAME = "state_of_the_union_test"
db = IRISVector.from_documents(
embedding=embeddings,
documents=docs,
collection_name=COLLECTION_NAME,
connection_string=CONNECTION_STRING,
)
query = "What did the president say about Ketanji Brown Jackson"
docs_with_score = db.similarity_search_with_score(query)
for doc, score in docs_with_score:
print("-" * 80)
print("Score: ", score)
print(doc.page_content)
print("-" * 80)
Metadata
Release files for langchain-iris 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| langchain_iris-0.2.2.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| langchain_iris-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / langchain_iris-0.2.2.tar.gz
| Download URL | langchain_iris-0.2.2.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
687223c810e38dc8846bff9ad39d802343a0d10c70c8bf9ee0ecf849bdd9a737
|
|
BLAKE2b-256 checksum How to use checksums |
19b79f293ef16a22268411969714c2b5ca1d0634c5dc08f41355791663554e19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 9, 2025.
Transparency logRelease files / langchain_iris-0.2.2-py3-none-any.whl
| Download URL | langchain_iris-0.2.2-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25f2d58d2af66072d1bc5eff16dcc6b8ae813f5791d5dc0f6e6efacd26240f67
|
|
BLAKE2b-256 checksum How to use checksums |
da8d55b01e82af298c159dfdb5cb39237e845c9d0a86763b758064674e77ffe6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 9, 2025.
Transparency log