Matimo Documentation
Matimo β Enable AI Agents To Build Themselves
The First AI SDK with Meta-Tools, Policy Engine, and Human-in-the-Loop Control
Give your agents 137+ production-ready tools to start. Then activate 10 meta-tools that let them create, validate, and approve new capabilities at runtime β governed by your policy engine with human approval workflows for critical actions.
Self-extending agents with enterprise-grade control:
- π§ Meta-Tools β Agents write new tool definitions in YAML, validate schemas, approve for production, and hot-reload β all mid-conversation
- π‘οΈ Policy Engine β Classify every action by risk level, block dangerous operations, quarantine draft tools
- π€ Human-in-the-Loop (HITL) β Critical tools require human approval before execution with configurable timeouts and audit trails
- π Universal Integration β One YAML definition works across TypeScript, Python, LangChain, CrewAI, Claude MCP, OpenAI
Complete documentation for Matimo v0.1.0 (TypeScript & Python).
π Choose Your SDK
π¦ TypeScript / Node.js
- Node.js 18+, npm/pnpm
- ESM, full type support
- 2,001 tests, 95%+ coverage
- Start with TypeScript
π Python π Stable Release
- Python 3.11+, pip/uv
- Native asyncio, full type hints
- 995 tests, 96.89% coverage
- LangChain, CrewAI, MCP support
- Start with Python
β‘ Getting Started
TypeScript Getting Started
- Quick Start β 5-minute setup
- Your First Tool β Create a basic YAML tool
- API Reference β SDK fundamentals
Python Getting Started
- Quick Start β 5-minute setup with
pip install matimo - LangChain Integration β Build ReAct agents
- CrewAI Integration β Multi-agent orchestration
- API Reference β Python SDK documentation
π¦ Installation & Requirements
- Installation β Detailed setup for both SDKs
- TypeScript (Node.js 18+) and Python (3.11+) requirements
- From npm/pip (recommended) or from source
- Troubleshooting & environment setup
- Provider authentication via OAuth2
π Reference (By Topic)
π’ Core Concepts (Start Here)
- Architecture Overview β Understand how Matimo works
- High-level system design
- Three integration patterns (Factory, Decorator, Framework)
- Framework compatibility (LangChain, CrewAI, MCP, custom)
- Data flow and execution model
- SDK Patterns β TypeScript & Python examples
- Factory pattern (simplest)
- Decorator pattern (class-based)
- Framework integration patterns
- API Reference β Complete SDK reference
- TypeScript
MatimoInstanceAPI - Python
MatimoAPI .execute(),.listTools(),.searchTools()- Error handling & logging
- Complete type definitions
- TypeScript
- Error Reference β Troubleshooting guide
- Error codes and meanings
- Common scenarios
- Debugging techniques
- Recovery patterns
π‘ Tool Development
- Tool Specification β Write tools in YAML
- Tool metadata and parameters
- Execution types (command, HTTP, script)
- Output validation schemas
- Authentication configuration
- Retry logic and error handling
- Real examples
- Adding Tools to Matimo β Publish @matimo/* packages
- 6-step guide for creating providers
- Auto-discovery mechanism
- Publishing to npm
- GitHub provider real example
- CLI tool management
- Testing Tools β Unit & integration testing
- Testing patterns with Jest / pytest
- Mocking external services
- Coverage requirements (95%+)
- Test fixtures
- OAuth Setup β OAuth2 authentication
- OAuth2 flow implementation
- Provider-specific configurations
- Token management
- Security best practices
π‘οΈ Policy & Lifecycle (Security)
- Policy Engine & Tool Lifecycle β Complete security guide
- PolicyConfig setup and immutability
- Content Validator (9 security rules)
- Risk classification levels
- Tool lifecycle: create β approve β reload β use
- Approval system (interactive, auto-approve, MCP)
- Integrity tracking (SHA-256, HMAC)
- RBAC & access control
- Audit events
- Meta-Tools Reference β Built-in tool management tools
matimo_validate_toolβ Validate YAML against schema + policymatimo_create_toolβ Create tools with safety enforcementmatimo_approve_toolβ Promote draft tools with HMAC signingmatimo_reload_toolsβ Hot-reload the live registrymatimo_list_user_toolsβ Discover tools with metadatamatimo_create_skillβ Create SKILL.md filesmatimo_list_skillsβ List skills in a directorymatimo_get_skillβ Read a skillβs content by namematimo_validate_skillβ Validate a skill against the Agent Skills spec
- Approval System β Approval handler configuration
- Auto-approve and interactive approval
- Environment variables
- Callback patterns
π΄ Advanced Topics
- OAuth Architecture β Deep dive into OAuth2
- Protocol flow details
- Provider integrations
- Token lifecycle
- Security considerations
- Provider Configuration β Multi-provider setup
- Managing multiple providers
- Configuration patterns
- Environment variables
- Provider-specific settings
- Type Definitions β Complete TypeScript types
- Full interface reference
- Parameter and execution types
- Response validation types
- Framework Integrations β LangChain & CrewAI
- LangChain agent patterns
- CrewAI tool composition
- Custom framework integration
Project Information
- Release Notes β New features, bug fixes, and breaking changes
- Roadmap β Upcoming features and long-term vision
π₯ For Contributors
Want to contribute? Start here:
- Contributing Guidelines β Full contribution workflow
- Setup and development environment
- Code standards and best practices
- TDD (Test-Driven Development) approach
- Commit message format
- PR checklist
- Commit Guidelines β Conventional commits standard
- Type, scope, subject format
- Examples for feat, fix, docs, etc.
- Git workflow tips
- Development Standards β Code quality requirements
- TypeScript strictness
- Testing coverage (95%+ β TypeScript and Python)
- ESLint / ruff and Prettier
- JSDoc documentation
Development & Advanced Usage
- SDK Patterns β SDK usage patterns and best practices
- Factory pattern usage
- Decorator pattern examples
- LangChain integration patterns
- Error handling strategies
- Performance optimization
- Tool Discovery β Finding and using tools
- Auto-discovery from npm packages
- Tool search and filtering
- Registry management
- Loading from directories
- Authentication β API keys, OAuth2, and token management
- API key setup
- OAuth2 flows
- Token refresh and storage
- Provider-specific auth patterns
- Security best practices
Troubleshooting
- FAQ & Common Issues β Answers to common questions
- Setup problems
- Tool execution issues
- Authentication errors
- Performance tips
Quick Navigation by Role
π Just Getting Started (First 30 minutes)
- Quick Start β Install and run your first tool
- Your First Tool β Create a basic YAML tool
- API Reference β Understand the SDK basics
- If stuck β FAQ
π οΈ Building Tools
- Tool Specification β YAML schema reference
- Adding Tools to Matimo β Publish a package
- Testing Tools β Write tests
- OAuth Setup β Add authentication
π€ Integrating with Frameworks (LangChain, CrewAI, etc.)
- Architecture Overview β Understand patterns
- Framework Integrations β Integration examples
- SDK Patterns β Best practices
π Securing Agent Tool Usage
- Policy & Lifecycle Guide β Full security setup
- Meta-Tools Reference β Built-in management tools
- Approval System β Approval handler config
- Policy Demo (Python) β 11-mission autonomous agent demo
- Policy Demo (TypeScript) β TypeScript equivalent
- Skills Demo (Python) β 6-mission skills lifecycle demo
π€ For AI Agents (Quick Orientation)
If you are an AI agent (LangChain, CrewAI, MCP client) reading this to understand Matimo:
- Read first: Meta-Tools Reference β the 10 built-in tools you can call right now
- Tool creation flow:
matimo_validate_toolβmatimo_create_toolβmatimo_approve_toolβmatimo_reload_tools - Skills discovery:
matimo_list_skillsβmatimo_get_skillto load domain expertise on-demand - OpenAI 128-tool limit: If using
auto_discover=True, cap your bound tool list β prioritizematimo_*tools first - Policy rules: Draft tools are blocked in
environment="prod". Command tools (type: command) require explicit approval. SSRF-blocked URL patterns are rejected by the content validator. - Errors: All errors are
MatimoErrorwith typedErrorCode. Checkerror.codefor programmatic handling. - Examples to study:
python/examples/native/meta_flow/meta_tools_integration.pyis the canonical end-to-end reference.
π¨βπ» Contributing Code
- Start here: Contributing Guidelines
- Clone repo and set up locally
- Commit Guidelines β Proper commit format
- Development Standards β Code quality rules
- Open PR and request review
π Maintaining/Reviewing
- Development Standards β Review checklist
- Contributing Guidelines β PR requirements
- Commit Guidelines β Validate commits
- Architecture Overview β Understand design decisions
Documentation Structure
docs/
βββ index.md # This file β documentation index
βββ RELEASES.md # Release notes and changelog
βββ ROADMAP.md # Project roadmap
βββ MCP.md # MCP server setup and Claude Desktop
βββ getting-started/
β βββ QUICK_START.md # 5-minute setup (TypeScript + Python)
β βββ installation.md # Detailed installation
β βββ YOUR_FIRST_TOOL.md # Create your first tool
βββ api-reference/
β βββ SDK.md # Complete SDK API (TypeScript + Python)
β βββ ERRORS.md # Error handling and error codes
β βββ TYPES.md # TypeScript type definitions
β βββ META_TOOLS.md # Built-in meta-tools reference (10 tools)
β βββ POLICY_AND_LIFECYCLE.md # Policy engine and tool lifecycle
β βββ APPROVAL-SYSTEM.md # Approval handler configuration
β βββ LOGGING.md # Logger API and formats
βββ tool-development/
β βββ TOOL_SPECIFICATION.md # YAML tool schema reference
β βββ YAML_TOOLS.md # YAML tool writing guide
β βββ ADDING_TOOLS.md # Creating tool provider packages
β βββ DECORATOR_GUIDE.md # TypeScript decorators
β βββ TESTING.md # Testing tools
β βββ HTTP_PARAMETER_EMBEDDING.md # HTTP parameter encoding
β βββ PROVIDER_CONFIGURATION.md # Multi-provider setup
βββ framework-integrations/
β βββ LANGCHAIN.md # LangChain (Python + TypeScript)
β βββ CREWAI.md # CrewAI multi-agent (Python)
β βββ VERCEL_AI.md # Vercel AI SDK (TypeScript)
βββ skills/
β βββ SKILLS.md # Skills system guide
β βββ TFIDF_SEMANTIC_SEARCH.md # TF-IDF implementation details
βββ architecture/
β βββ OVERVIEW.md # System design and patterns
β βββ OAUTH.md # OAuth2 implementation
βββ user-guide/
β βββ SDK_PATTERNS.md # Factory, decorator, framework patterns
β βββ TOOL_DISCOVERY.md # Auto-discovery and search
β βββ AUTHENTICATION.md # API keys, OAuth2, token management
β βββ DEVELOPMENT_STANDARDS.md # Code quality rules
βββ community/
β βββ COMMIT_GUIDELINES.md # Conventional commits
βββ troubleshooting/
βββ FAQ.md # Common questions & solutions
Python examples (python/examples/):
βββ native/ # Factory, decorator + advanced agent demos
β βββ policy/policy_demo.py # 11-mission policy + HITL lifecycle
β βββ skills/skills_demo.py # 6-mission skills lifecycle
β βββ meta_flow/meta_tools_integration.py # 5-mission meta-tools lifecycle
β βββ logger_example.py # Logging demo (no API key needed)
βββ langchain/ # LangChain ReAct examples (17 files)
βββ crewai/ # CrewAI examples (10 files)
TypeScript examples (typescript/examples/tools/):
βββ policy/policy-demo.ts # 11-mission policy lifecycle
βββ skills/skills-demo.ts # Skills lifecycle + TF-IDF
βββ meta-flow/meta-tools-integration.ts # Meta-tools lifecycle
βββ agents/langchain-skills-policy-agent.ts # Production agent pattern
Key Concepts
Tools
Tools are the building blocks of Matimo. They define what can be executed, what parameters they accept, and how they run.
- YAML Tools β Declarative tool definitions (see Tool Specification)
- Decorator Tools β TypeScript-based tool definitions (see Decorator Guide)
Executors
Executors run tools with different backends:
- CommandExecutor β Execute shell commands
- HttpExecutor β Make HTTP requests
See API Reference for details.
SDK
Use the Matimo SDK (TypeScript) to load and execute tools:
import { MatimoInstance } from 'matimo';
const matimo = await MatimoInstance.init('./tools');
const result = await matimo.execute('tool-name', { param: 'value' });
See Quick Start and API Reference.
MCP Server
Matimo can run as an MCP server, allowing Claude and other clients to discover and use tools:
// MCP Server - Coming in Phase 2
// import { MCPServer } from 'matimo/mcp';
const server = new MCPServer({ toolsPath: './tools', port: 3000 });
await server.start();
See Quick Start for setup.
Standards & Practices
Code Quality
- TypeScript: Strict mode enforced (no
any) - Testing: 95%+ coverage (TypeScript + Python), TDD approach
- Linting: ESLint with automatic formatting
- Documentation: JSDoc comments for all public APIs
Commits
- Format: Conventional Commits (type(scope): subject)
- Types: feat, fix, docs, refactor, test, chore, perf, style, ci
- Examples: βfeat(executor): add HTTP supportβ, βfix(schema): validate enumsβ
See Commit Guidelines.
Pull Requests
- Follow TDD approach (test first, implement after)
- Keep PRs focused (one feature/fix per PR)
- Ensure tests pass and coverage maintained (95%+)
- Follow code standards and get code review
Common Tasks
Write a YAML Tool
- Create
tools/provider/tool-name.yaml - Follow Tool Specification schema
- Include parameters, execution, output_schema
- Add authentication if needed
- Test with
pnpm test
Write a Decorator Tool
- Create
src/tools/tool-name.tool.ts - Use @tool and @param decorators
- Implement execute() or async execute()
- Follow Decorator Guide patterns
- Add unit tests
Integrate with LangChain
- See Framework Integrations for patterns
- Check
examples/tools/for working examples - Follow Architecture Overview for design decisions
Contribute Code
- Fork and clone repository
- Create feature branch:
git checkout -b feat/description - Write tests first (TDD)
- Implement feature
- Follow Development Standards
- Commit using Commit Guidelines
- Push and create PR
- Follow Contributing Guidelines checklist
Need Help?
- Questions? Check relevant documentation or open a GitHub Discussion
- Found a bug? Open an issue
- Troubleshooting? See FAQ
- Want to contribute? See Contributing Guidelines
Documentation Note: While I strive for accuracy and completeness, this documentation may contain oversights, outdated information, or areas needing improvement, due to my limitations. If you notice any errors, missing information, or have suggestions for enhancement, please help me to improve! See our Contributing Guidelines to learn how to submit corrections and improvements. Your contributions to documentation are highly valued! Thank you.
Last updated: February 2026