feat: implement Jeen Skills Integration Framework (G3)#17
Conversation
|
Caution Review failedFailed to post review comments 📝 WalkthroughWalkthroughThis PR modernizes the build infrastructure by replacing SSH-based Git dependencies with local ChangesAgent G2: Skills, Schema Enrichment, Graph Topology & Node Hardening
Infrastructure & Shared Core Modernization
Backend Langfuse Refactor, Cleanup & Health Endpoints
Sequence Diagram(s)sequenceDiagram
participant Client
participant ChatEndpoint as chat_endpoint
participant Graph as LangGraph G2
participant SchemaExplorer as schema_explorer_node
participant Refiner as refiner_node
participant SatisfactionCheck as satisfaction_check_node
participant Finalizer as finalizer_node
participant HITL as hitl_escalation_node
Client->>ChatEndpoint: POST /chat (query, active_skills)
ChatEndpoint->>Graph: ainvoke(state, config={callbacks})
Graph->>Graph: validate_config_node
Graph->>Graph: init_skills_node (Redis/Jeen)
Graph->>SchemaExplorer: schema_explorer_node (scoping, enrichment, hallucination check)
SchemaExplorer-->>HITL: hallucinated tables + retries exhausted
SchemaExplorer->>Refiner: schema_plan ready
Refiner->>SatisfactionCheck: SQL executed, inline_result_rows
SatisfactionCheck-->>Finalizer: all checks pass
SatisfactionCheck-->>Refiner: retry (fail_count < max)
SatisfactionCheck-->>HITL: fail_count >= SATISFACTION_MAX_FAILURES
HITL-->>Client: interrupt (escalation_reason)
Finalizer->>ChatEndpoint: summary, sql_explanation, schema_plan
ChatEndpoint->>Client: ChatResponse
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
|
A few things:
|
Description
This PR implements the Jeen Skills Integration Framework (G3), loading domain-specific knowledge (prompt fragments) from the Jeen API, caching them using Redis, and injecting them dynamically at runtime.
Key Changes
agent/src/agent/utils/jeen_client.py): Fetches skills fromPOST /admin/assets/skills/by-idsvia HTTP with configurable API URL and API keys. Gracefully bypasses skill loading ifJEEN_LLM_CORE_URLorJEEN_API_KEYare not set.agent/src/agent/utils/skill_registry.py): Manages caching with Redis and compiling skills into prompt strings. Respects the newSKILLS_HOT_RELOADsetting by bypassing the cache when enabled.agent/src/agent/nodes/init_skills.py): Centralizes the skills I/O at the start of the LangGraph flow, updating the state and injectingskills_loadednames into the Langfuse trace metadata.agent/src/agent/graph.py): Addedinit_skillsnode into the execution path, keeping subsequent reasoning nodes pure and relying only on the state.schema_explorer.pyandquery_builder.pyto inject compiled skill prompt fragments.Open Questions & Platform Blockers
🛑 Platform Blocks & Limitations:
llm-coreAPI only supports retrieving skills by ID (by-ids/by-users). It does not support aby-tagsendpoint or tag-based queries, nor doesSkillResponseDtocontain tags. As a result, the backend/MCP client must pass explicit IDs in theactive_skillslist to load.SkillResponseDtoonly providessystemPromptFragmentand lacks type indicators (likeprompt_fragment,tool, orfew_shot). The agent treats all incoming skills as prompt fragments.❓ Open Questions for Discussion:
SkillResponseDtobe updated with structured fields (e.g.skillType,toolDefinition,fewShotExamples) or will it require a custom JSON parsing format?Summary by CodeRabbit
New Features
Bug Fixes
Chores