Framework Integrations
Prysm integrates natively with popular agent frameworks. Each integration captures framework-specific telemetry and optionally enables governance monitoring.
LangGraph
pip install prysmai[langgraph]
PrysmGraphMonitor provides graph-aware telemetry with node tracking, state transitions, and governance support.
from prysmai.integrations.langgraph import PrysmGraphMonitor
monitor = PrysmGraphMonitor(
api_key="sk-prysm-...",
governance=True, # Enable behavioral detection
)
# Use as a callback handler in your LangGraph graph
graph = create_your_graph()
result = graph.invoke(
{"messages": [("user", "Research quantum computing")]},
config={"callbacks": [monitor]},
)
# Access governance results
if monitor.governance_session:
report = monitor.governance_session.get_report()
What gets captured:
| Event | Description |
|---|---|
| Node execution | Which graph nodes ran, in what order, with timing |
| State transitions | State changes between nodes |
| LLM calls | All LLM invocations with model, tokens, latency |
| Tool calls | Tool invocations with arguments and results |
| Conditional routing | Which edges were taken at decision points |
Governance with LangGraph
When governance=True, the monitor automatically:
- Starts a governance session when the graph begins
- Reports all captured events to the behavioral detection engine
- Runs a final behavioral check when the graph completes
- Generates a governance report accessible via
monitor.governance_session
CrewAI
pip install prysmai[crewai]
PrysmCrewMonitor captures crew execution telemetry including agent actions, task completions, and delegation events.
from prysmai.integrations.crewai import PrysmCrewMonitor
monitor = PrysmCrewMonitor(
api_key="sk-prysm-...",
governance=True, # Enable behavioral detection
)
crew = Crew(
agents=[researcher, writer],
tasks=[research_task, write_task],
)
result = crew.kickoff(callbacks=[monitor])
What gets captured:
| Event | Description |
|---|---|
| Agent execution | Which agents ran, with timing |
| Task completion | Task results and duration |
| Tool usage | Tools called by each agent |
| Delegation | When agents delegate work to other agents |
| LLM calls | All underlying LLM invocations |
LlamaIndex
pip install prysmai[llamaindex]
PrysmSpanHandler integrates with LlamaIndex's instrumentation system.
from prysmai.integrations.llamaindex import PrysmSpanHandler
import llama_index.core
llama_index.core.global_handler = PrysmSpanHandler(
api_key="sk-prysm-...",
)
# All LlamaIndex operations are now traced
index = VectorStoreIndex.from_documents(documents)
response = index.as_query_engine().query("What is quantum computing?")
All frameworks together: You can use multiple integrations simultaneously. Each one captures its own telemetry and sends it to the same Prysm project.