LlamaIndex integration with OmegaEngine governance - RAG safety and compliance
Project description
llamaindex-omega
LlamaIndex Integration for OmegaEngine
Documentation • Playground • Issues
✨ Features
- 🔗 Query Engine Wrapper — Add governance to any LlamaIndex query
- 📊 Retrieval Guard — Validate retrieved context before synthesis
- 🛡️ Response Validator — Check LLM outputs against policies
- 📈 Observability — Full audit trail for RAG pipelines
- ⚡ Async Support — Native async/await compatibility
📦 Installation
pip install llamaindex-omega
🚀 Quick Start
Governed Query Engine
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
from llamaindex_omega import GovernedQueryEngine
# Load your documents
documents = SimpleDirectoryReader("data").load_data()
index = VectorStoreIndex.from_documents(documents)
# Wrap with OmegaEngine governance
query_engine = GovernedQueryEngine(
index.as_query_engine(),
api_key="your-omega-api-key",
policy_id="rag_policy",
)
# All queries are now governed
response = query_engine.query("What are the quarterly results?")
print(response)
Response Callback
from llamaindex_omega import OmegaCallbackHandler
callback = OmegaCallbackHandler(
api_key="your-omega-api-key",
log_retrievals=True,
log_responses=True,
)
# Attach to your service context
from llama_index.core import Settings
Settings.callback_manager.add_handler(callback)
🛡️ Retrieval Guard
Validate retrieved context before it's sent to the LLM:
from llamaindex_omega import GovernedRetriever
guard = GovernedRetriever(
api_key="your-omega-api-key",
block_pii=True,
block_sensitive_topics=["financial", "medical"],
)
# Wrap your retriever
safe_retriever = guard.wrap(index.as_retriever())
# Retrieved nodes are validated before synthesis
nodes = safe_retriever.retrieve("Tell me about the patient")
📊 Audit Trail
Every query is logged with:
- ✅ Original query
- ✅ Retrieved context (optionally)
- ✅ Generated response
- ✅ Policy evaluation result
- ✅ Risk score
- ✅ Latency metrics
# Access audit data
print(response.metadata["omega_audit_id"])
print(response.metadata["omega_decision"])
🔌 Works With All LlamaIndex Features
- ✅ VectorStoreIndex
- ✅ KnowledgeGraphIndex
- ✅ DocumentSummaryIndex
- ✅ Chat Engine
- ✅ Agents
- ✅ SubQuestionQueryEngine
📄 License
Licensed under the Apache License 2.0.
Built with ❤️ by the OmegaEngine team
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 llamaindex_omega-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llamaindex_omega-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f09421af8641ff4ce6391148fc316396c8202b82b02fcd62e97a5648a4b52b16
|
|
| MD5 |
22d888454453d632c97694b3ed98b1e0
|
|
| BLAKE2b-256 |
2f5f4906eab6f7ccb9b51b35b773f0a2ab54a9c5981c110de4c223962a19767a
|