Metadata-Version: 2.5
Name: continuous-intelligence-layer
Version: 0.2.0
Summary: Multi-Agent Intelligent Validation & RCA Framework
Project-URL: Homepage, https://github.com/Jugal-lachhwani/Multi_agent_intelligence_layer
Project-URL: Repository, https://github.com/Jugal-lachhwani/Multi_agent_intelligence_layer
Author-email: dmlabs <dmlabs6@gmail.com>
License-Expression: MIT
License-File: LICENSE
Keywords: agents,langgraph,llm,observability,opentelemetry,rca,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.11
Requires-Dist: colorama>=0.4.6
Requires-Dist: langchain-community>=0.2.0
Requires-Dist: langchain-openai>=0.1.0
Requires-Dist: langchain>=0.2.0
Requires-Dist: langgraph>=0.2.0
Requires-Dist: opentelemetry-api>=1.25.0
Requires-Dist: opentelemetry-sdk>=1.25.0
Requires-Dist: pydantic>=2.7.0
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: requests>=2.31.0
Requires-Dist: rich>=13.7.0
Requires-Dist: traceloop-sdk>=0.62.0
Provides-Extra: dev
Requires-Dist: build>=1.2.0; extra == 'dev'
Requires-Dist: ipykernel; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Description-Content-Type: text/markdown

# Continuous Intelligence Layer

A zero-infrastructure, OpenTelemetry-based observability and validation
layer for agentic AI systems — LangGraph/LangChain, CrewAI, and direct
OpenAI/Anthropic SDK agents. Instrument your agent with one function call
and get automatic execution tracing, LLM-judged input/output/tool
evaluations, and root-cause analysis, sent to your AgentOPS API.

## Install

```bash
pip install continuous-intelligence-layer
```

One package, one dependency (`traceloop-sdk`) bundles instrumentation for
every supported framework/provider — LangGraph/LangChain, CrewAI, OpenAI,
Anthropic, and more. No framework-specific extras to install.

## Usage

Call `init()` once, at the very top of your script, before importing or
running your agent framework. Everything else about your agent code is
unchanged — the right instrumentation activates automatically for whatever
framework/LLM-provider libraries are already importable in your process.

```python
from continuous_intelligence_layer import init

ctx = init(
    api_key="ao_...",                    # from your AgentOPS project
    service_name="my-agent",             # groups traces into a project
    base_url="https://your-agentops-api", # your AgentOPS API's base URL
    evaluation_api_key="sk-...",         # LLM key used to run evaluations/RCA
)

# ... run your agent as normal — nothing else changes ...
```

`init()` returns `{"execution_id": str, "output_path": str}`.

Boundaries the auto-instrumentation doesn't detect on its own — plain Python
orchestration, or an agent loop that isn't LangGraph — won't become bindable
nodes unless you wrap them in `@workflow`/`@task`/`@tool` (from
`traceloop.sdk.decorators`). LLM calls and LangGraph nodes need no code
changes at all.

### Parameters

| Parameter | Default | Description |
|---|---|---|
| `api_key` | *required* | AgentOPS project API key |
| `service_name` | `"continuous-intelligence-layer"` | Project name traces are grouped under |
| `base_url` | `"http://localhost:8080"` | Your AgentOPS API base URL |
| `evaluation_api_key` | `""` | LLM API key used to run automatic evaluations/RCA (required if `run_evaluations=True`) |
| `evaluation_provider` | `"openai"` | Provider for the evaluator/RCA LLM |
| `run_evaluations` | `True` | Run Input/Output/Tool evaluators + RCA automatically after each trace |
| `session_id` | auto-generated | Groups multiple runs into one conversation/session |
| `cia_config_path` | `"CIA.yaml"`/`"cia.yaml"` next to your script | Path to your project's evaluation config — see below |
| `instruments` | auto-detect all | Optional set of instrument names (e.g. `{"langchain", "openai"}`) to narrow which frameworks get instrumented |

### CIA.yaml — per-node evaluation config (optional)

Every node gets free deterministic checks (status/latency/output-shape) by
default. To also opt specific nodes into LLM judgment, write a `CIA.yaml`
next to your agent's entry script — `init()` reads and sends it to your
AgentOPS project automatically:

```yaml
project: my-agent
contract:
  terminal_node: response_composer
nodes:
  response_composer:
    output: "A short reply that directly answers the customer's question."
    latency_ms: 6000
```

Every field is optional. A node with no `output:` description still gets
deterministic checks, just never an LLM judgment call.

Trace data is always POSTed to your API's `/traces/ingest` — the SDK never
writes to a database directly from the agent's machine.

Trace data is only sent at process **shutdown**, not per-span in real time —
make sure your process exits normally (or call the framework's shutdown
hook) so the trace flushes.
