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
Release files for llamaindex-omega 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llamaindex_omega-0.3.0.tar.gz | 564.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llamaindex_omega-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 580.8 kB
Release files / llamaindex_omega-0.3.0.tar.gz
| Download URL | llamaindex_omega-0.3.0.tar.gz |
|---|---|
| Size | 564.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5155834b39c603932764301b22befb236b9afcdc4767604c4f0b37b68a36b9d7
|
|
BLAKE2b-256 checksum How to use checksums |
b6861f4e6732c6dd8318cfc0714fe37658f5865d4e0626eed2f5f8c8a6d2f9f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / llamaindex_omega-0.3.0-py3-none-any.whl
| Download URL | llamaindex_omega-0.3.0-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7780eacc02f04fd7f6b1b8ef7f3002a32353b2eb1e4efeceeb7b33760d073bbe
|
|
BLAKE2b-256 checksum How to use checksums |
56b82508d9e408a045eee30fccdef86ab2ce398901d0161a11ca4636f2d11890
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|