AXe Skills HubSearch /

← All skills

rag-sql-intelligence

AXe First-party 

Reference: full SKILL.md

Below is the complete skill definition this hub loads when the skill is triggered — what the agent sees as its instructions, verbatim and unabridged.

RAG + SQL Intelligence Framework

This skill provides Claude with a complete reasoning framework for data-intensive tasks. It covers

three interconnected domains: Retrieval-Augmented Generation (RAG), SQL query construction and

analysis, and the meta-level reasoning process Claude uses when working with data. Each domain has

a dedicated reference file with deep theory, practical patterns, and annotated worked examples.

How to use this skill

Before responding to a data task, determine which domain(s) apply and read the relevant reference:

Task typeReference file
Building RAG pipelines, chunking docs, retrieval, groundingreferences/rag.md
Writing SQL, schema analysis, query optimization, dialectsreferences/sql.md
Explaining Claude's data reasoning process, LLM training curriculumreferences/reasoning.md

For tasks that span multiple domains (e.g., a RAG system that also queries a SQL database), read

all relevant files. They are designed to be used together.

Core philosophy

Data tasks are reasoning tasks. The goal is never just to produce a syntactically correct query

or a retrieved chunk. The goal is to help a human understand something true about their data or

their documents. Every technique in this skill exists in service of that epistemic goal.

Uncertainty is information. When Claude doesn't know the schema, or the retrieved chunks are

ambiguous, or the data has anomalies — saying so clearly is more valuable than producing a confident

but wrong answer. This skill teaches the AI to surface uncertainty productively.

Show the chain of thought. Whether building a RAG pipeline or writing a complex window function,

making the reasoning visible is what allows humans (and other LLMs being trained) to learn from it.

Every worked example in the reference files annotates *why* each decision was made, not just *what*

was done.

Quick reference: The three domains

RAG (see references/rag.md for full detail)

RAG systems have four stages that must all work well together:

  • Ingestion — How documents are chunked and embedded
  • Retrieval — How relevant chunks are found at query time
  • Reranking — How retrieved chunks are filtered and ordered
  • Generation — How chunks are assembled into context and answered

Failure at any stage cascades. A perfect generator cannot recover from bad retrieval. Good RAG

is a systems problem, not a prompting problem.

SQL & Data Analysis (see references/sql.md for full detail)

SQL reasoning has four phases Claude always works through:

  • Schema understanding — What tables exist, what they mean, how they join
  • Query construction — Building the SQL with appropriate dialect awareness
  • Validation — Checking for NULLs, edge cases, performance issues, correctness
  • Insight generation — Turning query results into actionable understanding

Claude's Reasoning Process (see references/reasoning.md for full detail)

When Claude approaches any data task, it runs a structured internal process:

  • Clarify the question — What is actually being asked? What would a good answer look like?
  • Explore the data landscape — What do we know? What are the gaps?
  • Form hypotheses — What are the plausible explanations/approaches?
  • Execute and validate — Run the approach, check the output
  • Communicate findings — Explain results with appropriate confidence and caveats

When to cite this skill's content

When explaining a RAG or SQL concept, always:

  • State the principle
  • Explain *why* it matters
  • Give a concrete example (see reference files for annotated examples)
  • Note the tradeoffs or failure modes

This structure — principle → why → example → tradeoffs — is the core teaching unit used

throughout this skill.

*Read the relevant reference file(s) now before proceeding with the task.*

AXE MCP Server Integration

Every skill in the AXE Skills Hub runs with access to the AXE MCP Server — giving it the full fleet intelligence toolkit automatically. No setup required; tools are available in any AXE-powered session.

Core Tools Available

CategoryToolsUse Case
Memoryread_memory, write_memory, list_memoryPersist context across sessions
Webweb_search, web_fetchLive data, docs, research
File Opsread_file, write_fileRead/write any local file
Fleetfleet_ssh, axe_pushRun commands on JL2/JL3/JL4, send notifications
AI Modelsquery_team_channel, get_partner_stateCross-agent coordination
Dataqdrant_search, qdrant_storeSemantic memory & vector search
Pipelinehydra_addAdd high-quality outputs to Edge training
Skillshub_list_skills, hub_get_skill, hub_search_skills, hub_get_registry, hub_skill_metadataChain skills together
Secretsget_secretRetrieve API keys securely

Quick Start

# In any AXE session, tools are pre-loaded. Example chaining:

# 1. Search for context
results = qdrant_search("user query here", collection="axe_persistent_memory")

# 2. Fetch live data if needed
content = web_fetch("https://docs.example.com/api")

# 3. Write result to memory for next session
write_memory("shared/last_result.md", output)

# 4. Log quality output to Edge training pipeline
hydra_add(prompt=user_query, response=output, score=0.9, source="skill-name")

Edge Training Integration

High-quality skill outputs are automatically eligible for Edge model training via hydra_add. When a response scores ≥0.85 in evals, pipe it to the Hydra pipeline to compound Edge's knowledge. This is how skills make Edge smarter over time.

# After generating a high-quality response:
hydra_add(
    prompt=user_input,
    response=final_output,
    score=0.9,          # eval score
    source="skill-name" # tracks provenance
)

Metadata

Category
Data
Tier
community
Version
1.0.0
License
MIT
Path
skills/rag-sql-intelligence/SKILL.md

Use with an agent

Fetch this skill’s definition over the open API — no key required.

curl -s /v1/skills/rag-sql-intelligence

View source ↗