© 2025 InterSystems Corporation, Cambridge, MA. All rights reserved.Privacy & TermsGuaranteeSection 508Contest Terms
Initial Release
This project is a small end‑to‑end Retrieval-Augmented Generation (RAG) pipeline focused on InterSystems Business Services documentation.
It:
embed.py).upload_embeddings.py).search.py).business_service_chat.py)..txt / .md files in Documentation/BusinessService.embed.py):
BusinessService.parquet.text-embedding-3-small.BusinessService_embedded.parquet.upload_embeddings.py):
AIDemo.Embeddings).chunk_text + embedding as VECTOR(FLOAT, 1536).search.py):
VECTOR_DOT_PRODUCT and TO_VECTOR.business_service_chat.py):
search_embeddings as a tool (search_business_docs).Assuming a flat structure:
embed.pyupload_embeddings.pysearch.pybusiness_service_chat.pyDocumentation/BusinessService/.txt / .md docs go here)venv/dev.envOPENAI_API_KEY)pip install \
openai \
python-dotenv \
pandas \
pyarrow \
tiktoken \
langchain-text-splitters \
numpy \
iris
Note:
pyarrow(orfastparquet) is needed for Parquet support;pandaswill use one if available.
text-embedding-3-smallgpt-5-nano (or your preferred Responses-capable model)Set it either as a regular environment variable:
export OPENAI_API_KEY="sk-..."
or in .env (see below).
You need an IRIS instance with:
VECTOR)VECTOR column typesVECTOR_DOT_PRODUCT and TO_VECTOR functionsThe defaults in code:
IRIS_HOST = "localhost"IRIS_PORT = 8881IRIS_NAMESPACE = "VECTOR"IRIS_USERNAME = "superuser"IRIS_PASSWORD = "sys"TABLE_NAME = "AIDemo.Embeddings"EMBEDDING_DIMENSIONS = 1536 (matches text-embedding-3-small)Adjust these in the scripts if needed.
The scripts assume a .env file at:
venv/dev.envAt a minimum, put your OpenAI key there:
OPENAI_API_KEY=sk-...
# Optional: override default chat model
# OPENAI_RESPONSES_MODEL=gpt-5-nano
Both embed.py and search.py load it via:
from dotenv import load_dotenv
load_dotenv(dotenv_path="venv/dev.env")
If you prefer not to use .env, just export OPENAI_API_KEY directly in your shell.
Place your Business Service documentation as .txt or .md files in:
Documentation/BusinessService/
├── intro.md
├── settings.md
├── examples.txt
└── ...