Embedded Python refers to the integration of the Python programming language into the InterSystems IRIS kernel, allowing developers to operate with data and develop business logic for server-side applications using Python.
Embedded Python has been around for a while. You probably followed the tutorials and learned about it. However, if you've tried to combine Python and ObjectScript in real development work, you probably ran into situations where you get an error message like this:
I recently had to refresh my knowledge of the HealthShare EMPI module and since I've been tinkering with IRIS's vector storage and search functionalities for a while I just had to add 1 + 1.
For those of you who are not familiar with EMPI functionality here's a little introduction:
Enterprise Master Patient Index
In general, all EMPIs work in a very similar way, ingesting information, normalizing it and comparing it with the data already present in their system. Well, in the case of HealthShare's EMPI, this process is known as NICE:
The Interoperability user interface now includes modernized user experiences for the DTL Editor and Production Configuration applications that are available for opt-in in all interoperability products. You can switch between the modernized and standard views. All other Interoperability screens remain in the Standard user interface. Please note that changes are limited to these two applications and we identify below the functionality that is currently available.
Every so often, I would encounter a request for some GPG support, so I had several code samples written for a while, and I thought to combine all of them and add missing GPG functionality for a fairly complete coverage. That said, this Business Operation primarily covers data actions, skipping management actions such as key generation, export, and retrieval as they are usually one-off and performed manually anyways. However, this implementation does support key imports for obvious reasons. Well, let's get into it.
https://www.youtube.com/embed/e1nLoI5apGg [This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]
I got the PROTECT error while running functions. But, I could able to call the classmethods and methods in class definition with classMethodObject, classMethodValue etc.. from python. without any errors python code
Are you using Jupyter Notebooks with IRIS? Are you using the vscode-iris-jupyter-server VS Code extension for your notebooking? If so, please let me know either via direct message or with a comment on this post. I'd like to hear more about how our customers are working with tool specifically, and with data science more generally.
I'm exploring this right now: given a bunch of types defined as Pydantic models, how can I come up with an equivalent %RegisteredObject/%SerialObject and convert to/from (e.g., to support persistence and match validation as much as possible)?
People who know Python better than I do (e.g., your average undergraduate from this decade): is this a stupid idea or a cool idea? Has anyone else done this before?
Traditional keyword-based search struggles with nuanced, domain-specific queries. Vector search, however, leverages semantic understanding, enabling AI agents to retrieve and generate responses based on context—not just keywords.
This article provides a step-by-step guide to creating an Agentic AI RAG (Retrieval-Augmented Generation) application.
Implementation Steps:
Create Agent Tools
Add Ingest functionality: Automatically ingests and index documents (e.g., InterSystems IRIS 2025.1 Release Notes).
https://www.youtube.com/embed/HicTI-bRa8M [This is an embedded link, but you cannot view embedded content directly on the site because you have declined the cookies necessary to access it. To view embedded content, you would need to accept all cookies in your Cookies Settings]
You can learn a lot from a first impression; we want to hear about yours.
As a continuation of our User Insights Interview program (see this post for more details), we’re expanding our scope to include Python developers, particularly those of you who are new to working with InterSystems technology. We’re looking to conduct one-on-one interviews to hear your honest thoughts about getting started: What made sense, what didn’t, and where we could improve.
In this article, I will introduce my application iris-AgenticAI .
The rise of agentic AI marks a transformative leap in how artificial intelligence interacts with the world—moving beyond static responses to dynamic, goal-driven problem-solving. Powered by OpenAI’s Agentic SDK , The OpenAI Agents SDK enables you to build agentic AI apps in a lightweight, easy-to-use package with very few abstractions. It's a production-ready upgrade of our previous experimentation for agents, Swarm. This application showcases the next generation of autonomous AI systems capable of reasoning, collaborating, and executing complex tasks with human-like adaptability.
Application Features
Agent Loop 🔄 A built-in loop that autonomously manages tool execution, sends results back to the LLM, and iterates until task completion.
Python-First 🐍 Leverage native Python syntax (decorators, generators, etc.) to orchestrate and chain agents without external DSLs.
Handoffs 🤝 Seamlessly coordinate multi-agent workflows by delegating tasks between specialized agents.
Function Tools ⚒️ Decorate any Python function with @tool to instantly integrate it into the agent’s toolkit.
Vector Search (RAG) 🧠 Native integration of vector store (IRIS) for RAG retrieval.
Tracing 🔍 Built-in tracing to visualize, debug, and monitor agent workflows in real time (think LangSmith alternatives).
MCP Servers 🌐 Support for Model Context Protocol (MCP) via stdio and HTTP, enabling cross-process agent communication.
Chainlit UI 🖥️ Integrated Chainlit framework for building interactive chat interfaces with minimal code.
Stateful Memory 🧠 Preserve chat history, context, and agent state across sessions for continuity and long-running tasks.
I just realized I never finished this serie of articles!
In today's article, we'll take a look at the production process that extracts the ICD-10 diagnoses most similar to our text, so we can select the most appropriate option from our frontend.
Looking for diagnostic similarities:
From the screen that shows the diagnostic requests received in HL7 in our application, we can search for the ICD-10 diagnoses closest to the text entered by the professional.
Firstly, we need to understand what prompt words are and what their functions are.
Prompt Engineering
Hint word engineering is a method specifically designed for optimizing language models. Its goal is to guide these models to generate more accurate and targeted output text by designing and adjusting the input prompt words.
Since the introduction of Embedded Python there has always been doubt about its performance compared to ObjectScript and on more than one occasion I have discussed this with
With the introduction of vector data types and the Vector Search functionality in IRIS, a whole world of possibilities opens up for the development of applications and an example of these applications is the one that I recently saw published in a public contest by the Ministry of Health from Valencia in which they requested a tool to assist in ICD-10 coding using AI models.
How could we implement an application similar to the one requested? Let's see what we would need:
I have an Embedded Python method, which is essentially a call to one third-party module.
Most of the time, the method takes <0.1 seconds to execute, but sometimes it takes 30 or 60 seconds.
The server is relatively idle (20-30% CPU load).
How can I debug this issue further? Ideally, I want to know where this library spends the time. The library is mainly Python code (it's boto3, so it's not a Python C API proxy library).
I'm proud to announce the new release of iris-pex-embedded-python (v2.3.1) with a new command line interface.
This command line is called iop for Interoperability On Python.
First I would like to present in few words the project the main changes since the version 1.
A breif history of the project
Version 1.0 was a proof of concept to show how the interoperability framework of IRIS can be used with a python first approach while remaining compatible with any existing ObjectScript code.
What does it mean? It means that any python developer can use the IRIS interoperability framework without any knowledge of ObjectScript.
Example :
from grongier.pex import BusinessOperation
class MyBusinessOperation(BusinessOperation):
def on_message(self, request):
self.log.info("Received request")
as it took me some time to figure out what's wrong, I would like to share this experience, so that you do not fall into the same trap.
I've just noticed that if you name your package "code" (all lowercase), in a class using some embedded python using [Language = python], you'll face the <THROW> *%Exception.PythonException <PYTHON EXCEPTION> 246 <class 'ModuleNotFoundError'>: No module named 'code.basics'; 'code' is not a package
Using embedded Python while building your InterSystems-based solution can add very powerful and deep capabilities to your toolbox.
I'd like to share one sample use-case I encountered - enabling a CDC (Change Data Capture) for a mongoDB Collection - capturing those changes, digesting them through an Interoperability flow, and eventually updating an EMR via a REST API.
Just curious what the process is for debugging either a .py file that is uploaded to a specific namespace/location or a python classmethod defined in a .cls file.
My method can be run via the "Debug" breadcrumb but it doesnt hit breakpoints it just runs without a debugger. Also objectscript methods debug correctly