Skip to content

Feat/galileo sdk - #1

Open
zhirafovod wants to merge 5 commits into
rungalileo:mainfrom
zhirafovod:feat/galileo-sdk
Open

Feat/galileo sdk#1
zhirafovod wants to merge 5 commits into
rungalileo:mainfrom
zhirafovod:feat/galileo-sdk

Conversation

@zhirafovod

Copy link
Copy Markdown

feat: rewrite as native LangGraph app with Galileo SDK instrumentation
Replace class-based agents with native LangGraph nodes (async functions),
LLM tool-calling (bind_tools + ToolNode), and Galileo SDK callback
(GalileoAsyncCallback + galileo_context) for observability.

Pipeline: Records → Policy → Action (with tool loop) → Audit
Same business logic and MongoDB queries as the original.

Replace class-based agents with native LangGraph nodes (async functions),
LLM tool-calling (bind_tools + ToolNode), and Galileo SDK callback
(GalileoAsyncCallback + galileo_context) for observability.

Pipeline: Records → Policy → Action (with tool loop) → Audit
Same business logic and MongoDB queries as the original.
- Add summarize agent that produces user-facing response with AIMessage
  so SDOT captures it as gen_ai.output.messages on root span
- Add messages: Annotated[list[AnyMessage], add_messages] to CRMState
- Set graph compile name to "CRM Ops Desk" for correct span naming
- Make HTTP root span optional via --http-root flag (default: off)
- Seed invoke_input with HumanMessage for gen_ai.input.messages capture
- Add Galileo SDK callback handler integration
- Add run-collector.sh and run-sdot.sh helper scripts
- Pass RunnableConfig to action_node and summarize_node so graph-level
  callbacks (Galileo, SDOT) propagate to inner LLM and tool calls
- This fixes empty tool outputs in Galileo (was causing 100% tool_error_rate)
- Tools now return JSON strings instead of dicts for reliable serialization
- Simplified explain_refund_state and explain_order_state to look up data
  from DB internally instead of requiring list[dict] args
- Improved Action Agent prompt for better context adherence
- Added detailed tool docstrings with Args/Returns for better LLM selection
Add scenarios designed to exercise all 15 Galileo eval metrics:
- pii_leak_refund: input_pii + output_pii (PII in query, tool echoes it)
- prompt_injection_attempt: prompt_injection, context_adherence
- toxic_abusive_customer: input_toxicity, input_tone
- incomplete_multi_request: completeness, action_completion
- tool_failure_scenario: tool_error_rate, action_advancement
- vague_rambling_query: agent_efficiency, tool_selection_quality
- hostile_context_leakage: output_tone, output_toxicity

Add run-sdot-batch.sh for batch execution with mixed scenario plan
(30% baseline, 70% metric triggers) and random delay between runs.
@galileo-automation

Copy link
Copy Markdown

No activity for 30 days — this PR will be closed in 5 days unless updated.

3 similar comments
@galileo-automation

Copy link
Copy Markdown

No activity for 30 days — this PR will be closed in 5 days unless updated.

@galileo-automation

Copy link
Copy Markdown

No activity for 30 days — this PR will be closed in 5 days unless updated.

@galileo-automation

Copy link
Copy Markdown

No activity for 30 days — this PR will be closed in 5 days unless updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants