AI Features Overview
msh includes powerful AI features that help you understand, review, and generate data assets using natural language. These features leverage AI providers to analyze your project structure, suggest improvements, and generate code.
This section documents OSS (Open Source) AI features. For Cloud Platform AI features, see Cloud Platform AI Features.
Quick Start
-
Configure AI provider: Set up your AI provider and model
msh config ai --provider openai --model gpt-4 --api-key env:OPENAI_API_KEY -
Generate manifest: Create project metadata cache
msh manifest -
Use AI commands: Start using AI-powered features
msh ai explain assets/revenue.msh
Available Commands
Understanding Assets
msh inspect- Parse and display structured asset metadatamsh ai explain- Get natural language explanation of what an asset doesmsh ai review- Review asset for risks and issues
Generating Assets
msh ai new- Generate new asset from natural language descriptionmsh ai fix- Suggest fixes for broken assetsmsh ai tests- Generate or improve tests for an asset
Metadata Management
msh manifest- Generate project-level manifestmsh ai context- Generate AI-ready context pack
Glossary Management
msh glossary add-term- Create glossary termsmsh glossary link-term- Link terms to assetsmsh glossary list- List all glossary termsmsh glossary export- Export glossary as JSON
How It Works
msh builds context packs from your project metadata and sends them to AI providers to generate explanations, reviews, and code. All operations are validated by a safety layer to prevent dangerous operations.
Context Packs
Context packs are AI-ready bundles containing:
- Project information (name, warehouse, schema)
- Asset metadata (schemas, lineage, tests)
- Glossary terms and policies
- Lineage graphs
See Context Packs for more details.
AI Safety Layer
The safety layer blocks dangerous operations like:
DROP TABLETRUNCATE TABLEDELETE FROMALTER TABLE ... DROP COLUMN
See AI Safety for more details.
Metadata Cache
msh maintains a metadata cache in .msh/ directory for fast AI operations:
manifest.json- Compiled manifest of all assetslineage.json- Lineage graphschemas.json- Flattened schemastests.json- Test definitionsglossary.json- Cached glossary
See Metadata Cache for more details.
Supported AI Providers
msh supports multiple AI providers:
- OpenAI - GPT-4, GPT-3.5, etc.
- Anthropic - Claude 3 Opus, Sonnet, etc.
- Ollama - Local models (no API key needed)
- HuggingFace - Local models
- Azure OpenAI - Azure-hosted OpenAI models
See AI Configuration for setup instructions.
Example Workflow
# 1. Configure AI
msh config ai --provider openai --model gpt-4 --api-key env:OPENAI_API_KEY
# 2. Generate manifest
msh manifest
# 3. Explain an asset
msh ai explain assets/revenue.msh
# 4. Review for issues
msh ai review assets/revenue.msh
# 5. Generate fixes if needed
msh ai fix assets/revenue.msh --apply
# 6. Generate new asset
msh ai new --name customer_revenue --apply
Next Steps
- Setup AI Configuration - Configure your AI provider
- AI Commands - Learn about individual commands
- Context Packs - Understand how context works
- AI Safety - Learn about safety features
- Glossary System - Manage business glossary