continuous-intelligence-layer 0.1.2__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/.gitignore +14 -0
  2. continuous_intelligence_layer-0.2.1/PACKAGE_README.md +86 -0
  3. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/PKG-INFO +45 -49
  4. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/__init__.py +45 -0
  5. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/_core/exporter.py +403 -0
  6. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/continuous_intelligence_layer/_core/graph_exporter.py +29 -8
  7. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/_core/span_data.py +295 -0
  8. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/anthropic/__init__.py +5 -0
  9. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/anthropic/init.py +23 -0
  10. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/crewai/__init__.py +5 -0
  11. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/crewai/init.py +22 -0
  12. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/init.py +291 -0
  13. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/langgraph/__init__.py +5 -0
  14. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/langgraph/init.py +23 -0
  15. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/openai/__init__.py +5 -0
  16. continuous_intelligence_layer-0.2.1/continuous_intelligence_layer/openai/init.py +23 -0
  17. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/graph_builder/__init__.py +2 -3
  18. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/graph_builder/builder.py +62 -17
  19. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/graph_builder/models.py +26 -0
  20. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/pyproject.toml +13 -52
  21. continuous_intelligence_layer-0.1.2/PACKAGE_README.md +0 -64
  22. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/__init__.py +0 -28
  23. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/_core/exporter.py +0 -517
  24. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/anthropic/__init__.py +0 -9
  25. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/anthropic/init.py +0 -224
  26. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/anthropic/instrumentation.py +0 -91
  27. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/crewai/__init__.py +0 -9
  28. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/crewai/init.py +0 -220
  29. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/crewai/instrumentation.py +0 -83
  30. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/langgraph/__init__.py +0 -12
  31. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/langgraph/init.py +0 -244
  32. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/langgraph/instrumentation.py +0 -71
  33. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/openai/__init__.py +0 -9
  34. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/openai/init.py +0 -221
  35. continuous_intelligence_layer-0.1.2/continuous_intelligence_layer/openai/instrumentation.py +0 -67
  36. continuous_intelligence_layer-0.1.2/evaluators/__init__.py +0 -32
  37. continuous_intelligence_layer-0.1.2/evaluators/base_evaluator.py +0 -181
  38. continuous_intelligence_layer-0.1.2/evaluators/crewai_input_evaluator.py +0 -249
  39. continuous_intelligence_layer-0.1.2/evaluators/input_evaluator.py +0 -121
  40. continuous_intelligence_layer-0.1.2/evaluators/models.py +0 -180
  41. continuous_intelligence_layer-0.1.2/evaluators/output_evaluator.py +0 -247
  42. continuous_intelligence_layer-0.1.2/evaluators/runner.py +0 -313
  43. continuous_intelligence_layer-0.1.2/evaluators/tool_agent_evaluator.py +0 -305
  44. continuous_intelligence_layer-0.1.2/graph_builder/mongo_store.py +0 -588
  45. continuous_intelligence_layer-0.1.2/llm_router/__init__.py +0 -3
  46. continuous_intelligence_layer-0.1.2/llm_router/router.py +0 -71
  47. continuous_intelligence_layer-0.1.2/rca_engine/__init__.py +0 -5
  48. continuous_intelligence_layer-0.1.2/rca_engine/incident_report.py +0 -162
  49. continuous_intelligence_layer-0.1.2/rca_engine/rca_engine.py +0 -202
  50. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/LICENSE +0 -0
  51. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/continuous_intelligence_layer/_core/__init__.py +0 -0
  52. {continuous_intelligence_layer-0.1.2 → continuous_intelligence_layer-0.2.1}/continuous_intelligence_layer/_core/utils.py +0 -0
@@ -1,4 +1,5 @@
1
1
  **.env
2
+ **.pem
2
3
  .venv
3
4
  **.jsonl
4
5
  **__pycache__/
@@ -14,6 +15,19 @@ images/
14
15
  **.odp
15
16
  **.pptx#
16
17
  **.odp#
18
+ **.pdf
19
+ data/olist_raw/
20
+
17
21
 
18
22
  .claudeignore
19
23
 
24
+ **.whl
25
+ **.gz
26
+
27
+ CIA_Experiment_Architcture/
28
+
29
+
30
+ Custom system artifact request/
31
+
32
+ **.sh
33
+
@@ -0,0 +1,86 @@
1
+ # Continuous Intelligence Layer
2
+
3
+ A zero-infrastructure, OpenTelemetry-based observability and validation
4
+ layer for agentic AI systems — LangGraph/LangChain, CrewAI, and direct
5
+ OpenAI/Anthropic SDK agents. Instrument your agent with one function call
6
+ and get automatic execution tracing, LLM-judged input/output/tool
7
+ evaluations, and root-cause analysis, sent to your Continuous Intelligence Layer API.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install continuous-intelligence-layer
13
+ ```
14
+
15
+ One package, one dependency (`traceloop-sdk`) bundles instrumentation for
16
+ every supported framework/provider — LangGraph/LangChain, CrewAI, OpenAI,
17
+ Anthropic, and more. No framework-specific extras to install.
18
+
19
+ ## Usage
20
+
21
+ Call `init()` once, at the very top of your script, before importing or
22
+ running your agent framework. Everything else about your agent code is
23
+ unchanged — the right instrumentation activates automatically for whatever
24
+ framework/LLM-provider libraries are already importable in your process.
25
+
26
+ ```python
27
+ from continuous_intelligence_layer import init
28
+
29
+ ctx = init(
30
+ api_key="ao_...", # from your Continuous Intelligence Layer project
31
+ service_name="my-agent", # groups traces into a project
32
+ base_url="https://your-cia-api", # your Continuous Intelligence Layer API's base URL
33
+ evaluation_api_key="sk-...", # LLM key used to run evaluations/RCA
34
+ )
35
+
36
+ # ... run your agent as normal — nothing else changes ...
37
+ ```
38
+
39
+ `init()` returns `{"execution_id": str, "output_path": str}`.
40
+
41
+ Boundaries the auto-instrumentation doesn't detect on its own — plain Python
42
+ orchestration, or an agent loop that isn't LangGraph — won't become bindable
43
+ nodes unless you wrap them in `@workflow`/`@task`/`@tool` (from
44
+ `traceloop.sdk.decorators`). LLM calls and LangGraph nodes need no code
45
+ changes at all.
46
+
47
+ ### Parameters
48
+
49
+ | Parameter | Default | Description |
50
+ |---|---|---|
51
+ | `api_key` | *required* | Continuous Intelligence Layer project API key |
52
+ | `service_name` | `"continuous-intelligence-layer"` | Project name traces are grouped under |
53
+ | `base_url` | `"http://localhost:8080"` | Your Continuous Intelligence Layer API base URL |
54
+ | `evaluation_api_key` | `""` | LLM API key used to run automatic evaluations/RCA (required if `run_evaluations=True`) |
55
+ | `evaluation_provider` | `"openai"` | Provider for the evaluator/RCA LLM |
56
+ | `run_evaluations` | `True` | Run Input/Output/Tool evaluators + RCA automatically after each trace |
57
+ | `session_id` | auto-generated | Groups multiple runs into one conversation/session |
58
+ | `cia_config_path` | `"CIA.yaml"`/`"cia.yaml"` next to your script | Path to your project's evaluation config — see below |
59
+ | `instruments` | auto-detect all | Optional set of instrument names (e.g. `{"langchain", "openai"}`) to narrow which frameworks get instrumented |
60
+
61
+ ### CIA.yaml — per-node evaluation config (optional)
62
+
63
+ Every node gets free deterministic checks (status/latency/output-shape) by
64
+ default. To also opt specific nodes into LLM judgment, write a `CIA.yaml`
65
+ next to your agent's entry script — `init()` reads and sends it to your
66
+ Continuous Intelligence Layer project automatically:
67
+
68
+ ```yaml
69
+ project: my-agent
70
+ contract:
71
+ terminal_node: response_composer
72
+ nodes:
73
+ response_composer:
74
+ output: "A short reply that directly answers the customer's question."
75
+ latency_ms: 6000
76
+ ```
77
+
78
+ Every field is optional. A node with no `output:` description still gets
79
+ deterministic checks, just never an LLM judgment call.
80
+
81
+ Trace data is always POSTed to your API's `/traces/ingest` — the SDK never
82
+ writes to a database directly from the agent's machine.
83
+
84
+ Trace data is only sent at process **shutdown**, not per-span in real time —
85
+ make sure your process exits normally (or call the framework's shutdown
86
+ hook) so the trace flushes.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: continuous-intelligence-layer
3
- Version: 0.1.2
3
+ Version: 0.2.1
4
4
  Summary: Multi-Agent Intelligent Validation & RCA Framework
5
5
  Project-URL: Homepage, https://github.com/Jugal-lachhwani/Multi_agent_intelligence_layer
6
6
  Project-URL: Repository, https://github.com/Jugal-lachhwani/Multi_agent_intelligence_layer
@@ -16,51 +16,25 @@ Classifier: Programming Language :: Python :: 3.12
16
16
  Classifier: Topic :: Software Development :: Libraries
17
17
  Classifier: Topic :: System :: Monitoring
18
18
  Requires-Python: >=3.11
19
- Requires-Dist: anthropic>=0.34.0
20
- Requires-Dist: bcrypt>=4.0.0
21
19
  Requires-Dist: colorama>=0.4.6
22
- Requires-Dist: fastapi>=0.110.0
23
- Requires-Dist: google-genai>=1.0.0
24
20
  Requires-Dist: langchain-community>=0.2.0
25
21
  Requires-Dist: langchain-openai>=0.1.0
26
22
  Requires-Dist: langchain>=0.2.0
27
23
  Requires-Dist: langgraph>=0.2.0
28
- Requires-Dist: networkx>=3.3
29
- Requires-Dist: openai>=1.30.0
30
- Requires-Dist: openinference-instrumentation-langchain>=0.1.0
31
- Requires-Dist: openinference-semantic-conventions>=0.1.0
32
24
  Requires-Dist: opentelemetry-api>=1.25.0
33
- Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.25.0
34
25
  Requires-Dist: opentelemetry-sdk>=1.25.0
35
- Requires-Dist: passlib[bcrypt]>=1.7.4
36
26
  Requires-Dist: pydantic>=2.7.0
37
- Requires-Dist: pyjwt>=2.8.0
38
- Requires-Dist: pymongo>=4.8.0
39
27
  Requires-Dist: python-dotenv>=1.0.0
40
- Requires-Dist: python-multipart>=0.0.9
28
+ Requires-Dist: pyyaml>=6.0
41
29
  Requires-Dist: requests>=2.31.0
42
30
  Requires-Dist: rich>=13.7.0
43
- Requires-Dist: tenacity>=8.3.0
44
- Requires-Dist: uvicorn>=0.29.0
45
- Provides-Extra: all
46
- Requires-Dist: openinference-instrumentation-anthropic>=1.0.0; extra == 'all'
47
- Requires-Dist: openinference-instrumentation-crewai>=1.0.0; extra == 'all'
48
- Requires-Dist: openinference-instrumentation-llama-index>=3.0.0; extra == 'all'
49
- Requires-Dist: openinference-instrumentation-openai>=0.1.19; extra == 'all'
50
- Provides-Extra: anthropic
51
- Requires-Dist: openinference-instrumentation-anthropic>=1.0.0; extra == 'anthropic'
52
- Provides-Extra: crewai
53
- Requires-Dist: openinference-instrumentation-crewai>=1.0.0; extra == 'crewai'
31
+ Requires-Dist: traceloop-sdk>=0.62.0
54
32
  Provides-Extra: dev
55
33
  Requires-Dist: build>=1.2.0; extra == 'dev'
56
34
  Requires-Dist: ipykernel; extra == 'dev'
57
35
  Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
58
36
  Requires-Dist: pytest>=8.0.0; extra == 'dev'
59
37
  Requires-Dist: twine>=5.0.0; extra == 'dev'
60
- Provides-Extra: llamaindex
61
- Requires-Dist: openinference-instrumentation-llama-index>=3.0.0; extra == 'llamaindex'
62
- Provides-Extra: openai
63
- Requires-Dist: openinference-instrumentation-openai>=0.1.19; extra == 'openai'
64
38
  Description-Content-Type: text/markdown
65
39
 
66
40
  # Continuous Intelligence Layer
@@ -69,57 +43,79 @@ A zero-infrastructure, OpenTelemetry-based observability and validation
69
43
  layer for agentic AI systems — LangGraph/LangChain, CrewAI, and direct
70
44
  OpenAI/Anthropic SDK agents. Instrument your agent with one function call
71
45
  and get automatic execution tracing, LLM-judged input/output/tool
72
- evaluations, and root-cause analysis, sent to your AgentOPS API.
46
+ evaluations, and root-cause analysis, sent to your Continuous Intelligence Layer API.
73
47
 
74
48
  ## Install
75
49
 
76
50
  ```bash
77
51
  pip install continuous-intelligence-layer
78
-
79
- # Framework-specific instrumentors (install only what you use):
80
- pip install "continuous-intelligence-layer[crewai]"
81
- pip install "continuous-intelligence-layer[openai]"
82
- pip install "continuous-intelligence-layer[anthropic]"
83
52
  ```
84
53
 
85
- LangGraph/LangChain support ships in the base package — no extra needed.
54
+ One package, one dependency (`traceloop-sdk`) bundles instrumentation for
55
+ every supported framework/provider — LangGraph/LangChain, CrewAI, OpenAI,
56
+ Anthropic, and more. No framework-specific extras to install.
86
57
 
87
58
  ## Usage
88
59
 
89
60
  Call `init()` once, at the very top of your script, before importing or
90
- running your agent framework. Pick the import matching your framework
91
- everything else about your agent code is unchanged.
61
+ running your agent framework. Everything else about your agent code is
62
+ unchanged the right instrumentation activates automatically for whatever
63
+ framework/LLM-provider libraries are already importable in your process.
92
64
 
93
65
  ```python
94
- from continuous_intelligence_layer.langgraph import init # LangGraph / LangChain
95
- # from continuous_intelligence_layer.crewai import init # CrewAI
96
- # from continuous_intelligence_layer.openai import init # direct OpenAI SDK
97
- # from continuous_intelligence_layer.anthropic import init # direct Anthropic SDK
66
+ from continuous_intelligence_layer import init
98
67
 
99
68
  ctx = init(
100
- api_key="ao_...", # from your AgentOPS project
69
+ api_key="ao_...", # from your Continuous Intelligence Layer project
101
70
  service_name="my-agent", # groups traces into a project
102
- base_url="https://your-agentops-api", # your AgentOPS API's base URL
71
+ base_url="https://your-cia-api", # your Continuous Intelligence Layer API's base URL
103
72
  evaluation_api_key="sk-...", # LLM key used to run evaluations/RCA
104
73
  )
105
74
 
106
75
  # ... run your agent as normal — nothing else changes ...
107
76
  ```
108
77
 
109
- `init()` returns `{"execution_id": str, "output_path": str}`. Every
110
- framework's `init()` shares this same signature and return contract.
78
+ `init()` returns `{"execution_id": str, "output_path": str}`.
79
+
80
+ Boundaries the auto-instrumentation doesn't detect on its own — plain Python
81
+ orchestration, or an agent loop that isn't LangGraph — won't become bindable
82
+ nodes unless you wrap them in `@workflow`/`@task`/`@tool` (from
83
+ `traceloop.sdk.decorators`). LLM calls and LangGraph nodes need no code
84
+ changes at all.
111
85
 
112
86
  ### Parameters
113
87
 
114
88
  | Parameter | Default | Description |
115
89
  |---|---|---|
116
- | `api_key` | *required* | AgentOPS project API key |
90
+ | `api_key` | *required* | Continuous Intelligence Layer project API key |
117
91
  | `service_name` | `"continuous-intelligence-layer"` | Project name traces are grouped under |
118
- | `base_url` | `"http://localhost:8080"` | Your AgentOPS API base URL |
92
+ | `base_url` | `"http://localhost:8080"` | Your Continuous Intelligence Layer API base URL |
119
93
  | `evaluation_api_key` | `""` | LLM API key used to run automatic evaluations/RCA (required if `run_evaluations=True`) |
120
94
  | `evaluation_provider` | `"openai"` | Provider for the evaluator/RCA LLM |
121
95
  | `run_evaluations` | `True` | Run Input/Output/Tool evaluators + RCA automatically after each trace |
122
96
  | `session_id` | auto-generated | Groups multiple runs into one conversation/session |
97
+ | `cia_config_path` | `"CIA.yaml"`/`"cia.yaml"` next to your script | Path to your project's evaluation config — see below |
98
+ | `instruments` | auto-detect all | Optional set of instrument names (e.g. `{"langchain", "openai"}`) to narrow which frameworks get instrumented |
99
+
100
+ ### CIA.yaml — per-node evaluation config (optional)
101
+
102
+ Every node gets free deterministic checks (status/latency/output-shape) by
103
+ default. To also opt specific nodes into LLM judgment, write a `CIA.yaml`
104
+ next to your agent's entry script — `init()` reads and sends it to your
105
+ Continuous Intelligence Layer project automatically:
106
+
107
+ ```yaml
108
+ project: my-agent
109
+ contract:
110
+ terminal_node: response_composer
111
+ nodes:
112
+ response_composer:
113
+ output: "A short reply that directly answers the customer's question."
114
+ latency_ms: 6000
115
+ ```
116
+
117
+ Every field is optional. A node with no `output:` description still gets
118
+ deterministic checks, just never an LLM judgment call.
123
119
 
124
120
  Trace data is always POSTed to your API's `/traces/ingest` — the SDK never
125
121
  writes to a database directly from the agent's machine.
@@ -0,0 +1,45 @@
1
+ """
2
+ Continuous Intelligence Layer SDK
3
+ ==================================
4
+
5
+ A zero-infrastructure, OpenTelemetry-based observability layer for agentic
6
+ AI systems, built on OpenLLMetry/Traceloop. One unified ``init()`` covers
7
+ every supported framework — LangGraph/LangChain, CrewAI, the direct OpenAI
8
+ SDK, and the direct Anthropic SDK — via auto-instrumentation, no
9
+ per-framework subpackage or instrumentor selection required.
10
+
11
+ Quick Start
12
+ -----------
13
+ from continuous_intelligence_layer import init
14
+
15
+ init(api_key="...", evaluation_api_key="...") # call ONCE, before your agent runs
16
+
17
+ graph.invoke(...) # your agent code — unchanged
18
+
19
+ The four old per-framework subpackages
20
+ (``continuous_intelligence_layer.langgraph``/``crewai``/``openai``/``anthropic``)
21
+ have been removed — importing from them raises immediately with a pointer
22
+ back to this unified ``init()``, rather than silently forwarding to it.
23
+
24
+ Boundaries OpenLLMetry doesn't auto-instrument (plain Python orchestration,
25
+ or an agent loop that isn't LangGraph) never become bindable nodes
26
+ automatically — wrap that boundary in ``@workflow``/``@task``/``@tool``
27
+ (re-exported here from ``traceloop.sdk.decorators`` for convenience) if you
28
+ want it to show up as a node your CIA.yaml-equivalent config can address.
29
+ """
30
+
31
+ from .init import init, reset
32
+ from ._core.utils import load_traces, print_trace_summary
33
+ from traceloop.sdk.decorators import workflow, task, tool
34
+
35
+ __all__ = [
36
+ "init",
37
+ "reset",
38
+ "load_traces",
39
+ "print_trace_summary",
40
+ "workflow",
41
+ "task",
42
+ "tool",
43
+ ]
44
+
45
+ __version__ = "0.2.0"