skills/skillxiv-v0.0.2-claude-opus-4.6/cross-domain-agent-knowledge/SKILL.md
Create a universal memory infrastructure enabling agents across different frameworks to share experience trajectories without retraining. Improve agent performance by retrieving workflows from related domains and applying diagnostic fixes.
npx skillsauth add ADu2021/skillXiv cross-domain-agent-knowledgeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Agent frameworks like smolagents and OpenHands operate in isolation, causing each agent to rediscover solutions and repeat mistakes independently. Agent KB establishes a shared knowledge repository that allows agents across heterogeneous frameworks to benefit from experience accumulated in other domains. By implementing hybrid retrieval (for planning seeds and feedback fixes) with a safeguard mechanism that prevents harmful knowledge transfer, the system achieves substantial improvements without requiring framework modifications or model retraining.
The core problem is knowledge silos: agents accumulate valuable trajectories but cannot share them across framework boundaries, creating duplicated effort and preventing collective intelligence from emerging.
Agent KB operates on three key principles:
This architecture enables seamless knowledge sharing without requiring agents to be aware of framework differences.
Set up the knowledge base infrastructure to aggregate trajectories from multiple sources:
from agent_kb.knowledge_base import KnowledgeBase
from agent_kb.standardizers import TrajectoryStandardizer
# Initialize universal knowledge repository
kb = KnowledgeBase(storage="vector_db")
standardizer = TrajectoryStandardizer()
# Ingest trajectories from different agent frameworks
trajectories_smolagents = load_smolagents_trajectories("logs/smolagents/")
trajectories_openhands = load_openhands_trajectories("logs/openhands/")
for trajectory in trajectories_smolagents + trajectories_openhands:
# Standardize to common format
standardized = standardizer.standardize(
trajectory=trajectory,
framework="auto-detect" # Auto-detects format
)
# Index for efficient retrieval
kb.add_trajectory(
trajectory=standardized,
metadata={
"task": trajectory.get("task_name"),
"success": trajectory.get("success"),
"domain": trajectory.get("domain"),
"framework": trajectory.get("framework")
}
)
print(f"KB indexed {len(kb)} trajectories across {len(set(kb.get_domains()))} domains")
Implement planning-stage retrieval that seeds new agents with relevant workflows:
from agent_kb.retrievers import PlanningRetriever
retriever = PlanningRetriever(kb=kb)
def solve_with_planning_seeds(task_description, agent):
"""Augment agent planning with retrieved seed workflows."""
# Retrieve high-level workflows from successful trajectories
seed_workflows = retriever.retrieve_planning_seeds(
query=task_description,
k=3, # Top 3 relevant workflows
filter_success=True # Only successful trajectories
)
# Extract workflow skeleton (task sequence, not details)
workflows = [
{
"task_sequence": extract_task_steps(traj),
"estimated_success_rate": traj["metadata"]["success_rate"],
"domain": traj["metadata"]["domain"]
}
for traj in seed_workflows
]
# Provide as planning context to agent
agent.set_planning_seeds(workflows)
# Agent uses seeds to guide initial action sequence
result = agent.solve(task_description)
return result
Implement feedback-stage retrieval that suggests fixes after agent failures:
from agent_kb.retrievers import FeedbackRetriever
from agent_kb.diagnostics import DiagnosticExtractor
feedback_retriever = FeedbackRetriever(kb=kb)
extractor = DiagnosticExtractor()
def recover_from_failure(failed_trajectory, agent, kb):
"""Use KB diagnostics to suggest recovery actions."""
# Identify failure pattern in current trajectory
failure_pattern = extractor.extract_failure_pattern(
trajectory=failed_trajectory,
agent_state=agent.current_state
)
# Find similar failures in KB and their resolutions
diagnostic_fixes = feedback_retriever.retrieve_fixes(
failure_pattern=failure_pattern,
k=5 # Top 5 similar failure modes
)
# Rank fixes by applicability to current context
applicable_fixes = [
fix for fix in diagnostic_fixes
if is_applicable(fix, agent.current_state)
]
if not applicable_fixes:
return None # No relevant fixes found
# Format as suggestions to agent
recovery_suggestions = [
{
"action": fix["recovery_action"],
"reasoning": fix["why_worked"],
"confidence": fix["applicability_score"]
}
for fix in applicable_fixes[:3]
]
return recovery_suggestions
Implement the disagreement gate to prevent negative transfer:
from agent_kb.safety import DisagreementGate
gate = DisagreementGate()
def apply_retrieved_knowledge(retrieved_knowledge, agent_state, current_task):
"""Apply retrieved knowledge only if it aligns with current reasoning."""
# Check for disagreement between retrieved knowledge and agent state
disagreement_score = gate.evaluate(
retrieved_knowledge=retrieved_knowledge,
agent_reasoning=agent_state.get("reasoning"),
task=current_task
)
# If disagreement is high, suppress the retrieved knowledge
if disagreement_score > gate.threshold:
print(f"Suppressing retrieved knowledge (disagreement: {disagreement_score:.2f})")
return None # Don't apply conflicting knowledge
# Otherwise, integrate into agent planning
enhanced_plan = integrate_knowledge(
agent_plan=agent_state.get("current_plan"),
retrieved_knowledge=retrieved_knowledge
)
return enhanced_plan
Use Agent KB when:
Avoid Agent KB for:
Standard format for all trajectories (framework-agnostic):
{
"task": "Book a flight from NYC to LA",
"domain": "travel",
"framework": "smolagents",
"success": True,
"steps": [
{
"action": "search_flights",
"input": {"origin": "NYC", "destination": "LA", "date": "2024-03-25"},
"output": "Found 12 flights, cheapest $89",
"tool": "FlightSearch"
},
{
"action": "filter_results",
"input": {"max_price": 150, "preferred_airline": "Delta"},
"output": "3 flights match criteria"
}
],
"metadata": {
"total_steps": 2,
"tools_used": ["FlightSearch", "Filter"],
"success_rate": 0.87,
"timestamp": "2024-03-25T10:00:00Z"
}
}
The paper demonstrates substantial gains by framework:
| Framework | Baseline | With KB | Improvement | |-----------|----------|---------|-------------| | smolagents | 55.2% | 73.9% | +18.7 pp | | OpenHands | 24.3% | 28.3% | +4.0 pp | | Custom agent | Variable | +12-15 pp | Domain dependent |
Larger improvements occur when source and target domains are closely related.
| Stage | Strategy | When to Use | |-------|----------|------------| | Planning | Seed workflows | Early in task, need high-level guidance | | Feedback | Diagnostic fixes | After agent failure, need recovery suggestions | | Adaptation | Full trajectory | When source task is very similar to target |
For KB scaling beyond 100k trajectories:
"Agent KB: Leveraging Cross-Domain Experience for Agentic Problem Solving" - arXiv:2507.06229
testing
Uses flow maps as look-ahead operators to enable principled reward-guided diffusion by predicting trajectory endpoints at any denoising step. Deploy when applying rewards or preferences to diffusion trajectories with meaningful gradients throughout generation.
testing
Train language models where each expert learns independently on closed datasets, enabling flexible inference with selective data inclusion or exclusion. 41% performance improvement while allowing users to opt out of specific data sources without retraining.
data-ai
Understand how token generation flexibility in diffusion LMs paradoxically constrains reasoning, as models exploit ordering flexibility to avoid uncertain tokens, and apply simplified approaches that preserve parallel decoding benefits. Use when optimizing diffusion-based language models for reasoning tasks.
devops
Enable LLM agents to improve continuously during deployment by constructing structured experience libraries through self-reflection on successes and failures—achieving 23% improvement on reasoning without gradient-based parameter updates or external training.