Metadata-Version: 2.4
Name: rotalabs-context
Version: 1.0.0
Summary: Context intelligence for AI agents - Ingest, search, and subscribe to shared context across your AI systems
Project-URL: Homepage, https://rotalabs.ai
Project-URL: Repository, https://github.com/rotalabs/rotalabs-context
Project-URL: Documentation, https://rotalabs.ai/docs/context
Author-email: Subhadip Mitra <subhadip@rotalabs.ai>, Rotalabs Research <research@rotalabs.ai>
License-Expression: AGPL-3.0-or-later
License-File: LICENSE
Keywords: ai-agents,context,context-engine,embeddings,etl,knowledge-graph,rag,semantic-search
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Requires-Dist: pydantic>=2.0.0
Provides-Extra: airflow
Requires-Dist: apache-airflow>=2.5.0; extra == 'airflow'
Provides-Extra: all
Requires-Dist: httpx>=0.25.0; extra == 'all'
Requires-Dist: numpy>=1.24.0; extra == 'all'
Requires-Dist: rotalabs[telemetry]>=1.0.0; extra == 'all'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: mypy>=1.5.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: local
Requires-Dist: numpy>=1.24.0; extra == 'local'
Requires-Dist: sentence-transformers>=2.2.0; extra == 'local'
Provides-Extra: platform
Requires-Dist: httpx>=0.25.0; extra == 'platform'
Provides-Extra: telemetry
Requires-Dist: rotalabs[telemetry]>=1.0.0; extra == 'telemetry'
Description-Content-Type: text/markdown

# rotalabs-context

> Context intelligence for AI agents — Ingest, search, and subscribe to shared context across your AI systems.

Part of the [Rotalabs](https://rotalabs.ai) trust intelligence research ecosystem.

## Installation

```bash
pip install rotalabs-context
```

With local embedding support:
```bash
pip install rotalabs-context[local]
```

With Rotascale platform integration:
```bash
pip install rotalabs-context[platform]
```

## Quick Start

```python
from rotalabs_context import ContextEngine

# Local mode (zero config, SQLite backend)
ctx = ContextEngine()

# Platform mode (connects to Rotascale)
ctx = ContextEngine(
    api_key="rot_...",
    base_url="https://api.rotascale.com",
)

# Ingest context
result = ctx.ingest(
    records=[
        {"content": "User reported login issue", "title": "Support ticket #1234"},
        {"content": "Auth service latency spike at 2pm UTC", "title": "Incident report"},
    ],
    source="helpdesk",
    tags=["support", "auth"],
    scope="team:support",
)

# Search
results = ctx.search("login issues", top_k=5, mode="semantic")
for hit in results:
    print(f"{hit.score:.2f} — {hit.title}")

# Subscribe to context updates
ctx.on("context.created", filter={"tags": ["support"]}, callback=my_handler)
```

## Features

- **Ingest**: Push data from any pipeline; we add the "C" (embeddings, entities, relationships)
- **Search**: Semantic + keyword + hybrid search across all ingested context
- **Subscribe**: Real-time context propagation via events
- **ACLs**: Scope-based access control (global, team, agent, project, user)
- **Pluggable backends**: SQLite (local), PostgreSQL (self-hosted), Rotascale Platform (managed)

## Pipeline Adapters

```python
# Airflow
from rotalabs_context.adapters import AirflowContextOperator

# In your DAG
ingest_task = AirflowContextOperator(
    task_id="ingest_to_context",
    source="airflow-etl",
    tags=["daily-batch"],
)
```

## License

AGPL-3.0 — See [LICENSE](LICENSE) for details.
