Teachables API Reference
Complete documentation for all 10 teachable fragment types from@deepagents/context.
Fragment Types
All teachables are imported from@deepagents/context:
term()
Define business terminology and abbreviations.name- Term or abbreviationdefinition- Full definition
hint()
Provide helpful hints for query generation.text- Hint description
guardrail()
Enforce safety rules and constraints.rule- The safety rulereason- Why this rule exists (optional)action- What to do instead (optional)
example()
Provide question-answer pairs.question- Natural language questionanswer- SQL query answernote- Optional explanation
explain()
Explain technical concepts and their implications.concept- Concept nameexplanation- What it meanstherefore- Practical implication
clarification()
Define when to ask for clarification.when- Trigger conditionask- Question to ask userreason- Why clarification is needed
workflow()
Define multi-step procedural workflows.task- Task namesteps- Ordered stepstriggers- Keywords that trigger this workflownotes- Additional notes
quirk()
Document data anomalies and workarounds.issue- The data anomalyworkaround- How to handle it
styleGuide()
Enforce SQL coding standards.prefer- Preferred stylenever- What to avoidalways- What to always do
analogy()
Explain relationships using analogies.concepts- Concepts being compared (min 2)relationship- How they relateinsight- Key insighttherefore- Practical implicationpitfall- Common mistake to avoid
User Fragments
Additional fragment types for user-specific context:identity()
preference()
alias()
Best Practices
1. Combine Fragment Types
2. Document Everything
3. Version Control
Next Steps
Core API
Text2SQL core classes
Teachables Guide
Using teachables effectively