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:

EventDescription
Node executionWhich graph nodes ran, in what order, with timing
State transitionsState changes between nodes
LLM callsAll LLM invocations with model, tokens, latency
Tool callsTool invocations with arguments and results
Conditional routingWhich edges were taken at decision points

Governance with LangGraph

When governance=True, the monitor automatically:

  1. Starts a governance session when the graph begins
  2. Reports all captured events to the behavioral detection engine
  3. Runs a final behavioral check when the graph completes
  4. 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:

EventDescription
Agent executionWhich agents ran, with timing
Task completionTask results and duration
Tool usageTools called by each agent
DelegationWhen agents delegate work to other agents
LLM callsAll 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.