Feat/galileo sdk - #1
Open
zhirafovod wants to merge 5 commits into
Open
Conversation
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.
|
No activity for 30 days — this PR will be closed in 5 days unless updated. |
3 similar comments
|
No activity for 30 days — this PR will be closed in 5 days unless updated. |
|
No activity for 30 days — this PR will be closed in 5 days unless updated. |
|
No activity for 30 days — this PR will be closed in 5 days unless updated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.