Transactional Graph + Vector retrieval system for InterSystems IRIS with hybrid search, openCypher, and GraphQL APIs
Project description
IRIS Vector Graph
The ultimate Graph + Vector + Text Retrieval Engine for InterSystems IRIS.
IRIS Vector Graph is a general-purpose graph utility built on InterSystems IRIS that supports and demonstrates knowledge graph construction and query techniques. It combines graph traversal, HNSW vector similarity, and lexical search in a single, unified database.
Why IRIS Vector Graph?
- Multi-Query Power: Query your graph via SQL, openCypher (v1.3 with DML), or GraphQL — all on the same data.
- Transactional Engine: Beyond retrieval — support for
CREATE,DELETE, andMERGEoperations. - Blazing Fast Vectors: Native HNSW indexing delivering ~1.7ms search latency (vs 5.8s standard).
- Zero-Dependency Integration: Built with IRIS Embedded Python — no external vector DBs or graph engines required.
- Production-Ready: The engine behind iris-vector-rag for advanced RAG pipelines.
Installation
pip install iris-vector-graph
Note: Requires InterSystems IRIS 2025.1+ with the irispython runtime enabled.
Quick Start
# 1. Clone & Sync
git clone https://github.com/intersystems-community/iris-vector-graph.git && cd iris-vector-graph
uv sync
# 2. Spin up IRIS
docker-compose up -d
# 3. Start API
uvicorn api.main:app --reload
Visit:
- GraphQL Playground: http://localhost:8000/graphql
- API Docs: http://localhost:8000/docs
Unified Query Engines
openCypher (Advanced RD Parser)
IRIS Vector Graph features a custom recursive-descent Cypher parser supporting multi-stage queries and transactional updates:
// Complex fraud analysis with WITH and Aggregations
MATCH (a:Account)-[r]->(t:Transaction)
WITH a, count(t) AS txn_count
WHERE txn_count > 5
MATCH (a)-[:OWNED_BY]->(p:Person)
RETURN p.name, txn_count
Supported Clauses: MATCH, OPTIONAL MATCH, WITH, WHERE, RETURN, UNWIND, CREATE, DELETE, DETACH DELETE, MERGE, SET, REMOVE.
GraphQL
query {
protein(id: "PROTEIN:TP53") {
name
interactsWith(first: 5) { id name }
similar(limit: 3) { protein { name } similarity }
}
}
SQL (Hybrid Search)
SELECT TOP 10 id,
kg_RRF_FUSE(id, vector, 'cancer suppressor') as score
FROM nodes
ORDER BY score DESC
Scaling & Performance
The integration of a native HNSW (Hierarchical Navigable Small World) functional index directly into InterSystems IRIS provides massive scaling benefits for hybrid graph-vector workloads.
By keeping the vector index in-process with the graph data, we achieve subsecond multi-modal queries that would otherwise require complex application-side joins across multiple databases.
Performance Benchmarks (2026 Refactor)
- High-Speed Traversal: ~1.84M TEPS (Traversed Edges Per Second).
- Sub-millisecond Latency: 2-hop BFS on 10k nodes in <40ms.
- RDF 1.2 Support: Native support for Quoted Triples (Metadata on edges) via subject-referenced properties.
- Query Signatures: O(1) hop-rejection using ASQ-inspired Master Label Sets.
Why fast vector search matters for graphs
Consider a "Find-and-Follow" query common in fraud detection:
- Find the top 10 accounts most semantically similar to a known fraudulent pattern (Vector Search).
- Follow all outbound transactions from those 10 accounts to identify the next layer of the money laundering ring (Graph Hop).
In a standard database without HNSW, the first step (vector search) can take several seconds as the dataset grows, blocking the subsequent graph traversals. With iris-vector-graph, the vector lookup is reduced to ~1.7ms, enabling the entire hybrid traversal to complete in a fraction of a second.
Interactive Demos
Experience the power of IRIS Vector Graph through our interactive demo applications.
Biomedical Research Demo
Explore protein-protein interaction networks with vector similarity and D3.js visualization.
Fraud Detection Demo
Real-time fraud scoring with transaction networks, Cypher-based pattern matching, and bitemporal audit trails.
To run the CLI demos:
export PYTHONPATH=$PYTHONPATH:.
# Cypher-powered fraud detection
python3 examples/demo_fraud_detection.py
# SQL-powered "drop down" example
python3 examples/demo_fraud_detection_sql.py
To run the Web Visualization demos:
# Start the demo server
uv run uvicorn src.iris_demo_server.app:app --port 8200 --host 0.0.0.0
Visit http://localhost:8200 to begin.
iris-vector-rag Integration
IRIS Vector Graph is the core engine powering iris-vector-rag. You can use it in your RAG pipelines like this:
from iris_vector_rag import create_pipeline
# Create a GraphRAG pipeline powered by this engine
pipeline = create_pipeline('graphrag')
# Combined vector + text + graph retrieval
result = pipeline.query(
"What are the latest cancer treatment approaches?",
top_k=5
)
Documentation
- Detailed Architecture
- Biomedical Domain Examples
- Full Test Suite
- iris-vector-rag Integration
- Verbose README (Legacy)
Changelog
v1.4.6 (2025-01-31)
- Fix LONGVARCHAR REPLACE: CAST val to VARCHAR for JSON aggregation (IRIS stream limitation)
v1.4.5 (2025-01-31)
- Large Value Support:
rdf_props.valchanged from VARCHAR(4000) to LONGVARCHAR (up to 2GB) - JSON Documents: Store JSON documents and large text in node properties
- upgrade_val_column(): Migrate existing databases to LONGVARCHAR
v1.4.4 (2025-01-31)
- Bulk Loading Support:
%NOINDEXINSERTs,disable_indexes(),rebuild_indexes() - Fast Ingest: Skip index maintenance during bulk loads, rebuild after
v1.4.3 (2025-01-31)
- Composite Indexes: Added (s,key), (s,p), (p,o_id), (s,label) based on TrustGraph patterns
- 12 indexes total: Optimized for label filtering, property lookups, edge traversal
v1.4.2 (2025-01-31)
- Performance Indexes: Added indexes on rdf_labels, rdf_props, rdf_edges for fast graph traversal
- ensure_indexes(): New method to add indexes to existing databases
- Composite Index: Added (key, val) index on rdf_props for property value lookups
v1.4.1 (2025-01-31)
- Embedding API: Added
get_embedding(),get_embeddings(),delete_embedding()methods - Schema Prefix in Engine: All engine SQL now uses configurable schema prefix
v1.4.0 (2025-01-31)
- Schema Prefix Support:
set_schema_prefix('Graph_KG')for qualified table names - Pattern Operators Fixed:
CONTAINS,STARTS WITH,ENDS WITHnow work correctly - IRIS Compatibility: Removed recursive CTEs and
NULLS LAST(unsupported by IRIS) - ORDER BY Fix: Properties in ORDER BY now properly join rdf_props table
- type(r) Verified: Relationship type function works in RETURN/WHERE clauses
Author: Thomas Dyar (thomas.dyar@intersystems.com)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iris_vector_graph-1.4.6.tar.gz.
File metadata
- Download URL: iris_vector_graph-1.4.6.tar.gz
- Upload date:
- Size: 445.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
771444b4a8dfaeab8b3b1ee30414049e2bfd249e2b5f68b356978139e6d92893
|
|
| MD5 |
a158c0446eeebfb4aa6012a050f2b9ce
|
|
| BLAKE2b-256 |
b277732c145a8bfeff30b6d5a8c11a77f4608623448f1ae8abd3e3c2334d4498
|
File details
Details for the file iris_vector_graph-1.4.6-py3-none-any.whl.
File metadata
- Download URL: iris_vector_graph-1.4.6-py3-none-any.whl
- Upload date:
- Size: 55.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30625370d07c82f4b708efd989c6cdaaf9e7686af17e106c7d9fa5a6a563f398
|
|
| MD5 |
be79db438fa642af7c377525b3031ed7
|
|
| BLAKE2b-256 |
43cfc3840ecba3fcdd49ade6342ed290ecb36bb6f96f4f755e80d1b62d2b3782
|