Developer Tools for Applied AI Engineering
sygaldry provides essential tooling for AI engineers and researchers building production systems. Our open-source projects focus on practical solutions to real challenges faced when integrating AI into applications and workflows.
We build tools that bridge the gap between AI research and production deployment. Every project emerges from hands-on experience building AI systems at scale, addressing pain points we've encountered firsthand.
Good tools should be:
- Practical - Solve real problems developers face daily
- Composable - Work seamlessly with existing toolchains
- Performant - Optimized for production workloads
- Transparent - Clear internals, no black boxes
Our repositories contain tools and libraries focused on:
- Efficient model integration patterns
- Production-ready inference pipelines
- Workflow orchestration for AI systems
- Performance optimization utilities
- Development workflow enhancements
Each project includes comprehensive documentation, examples, and benchmarks to help you evaluate and integrate our tools into your stack.
Building AI applications with Mirascope often involves writing the same patterns repeatedly - search tools, web scrapers, document parsers, and agent architectures. sygaldry provides:
- Production-Ready Mirascope Components - Battle-tested agents, tools, and models built with Mirascope best practices
- Copy & Customize - Not a dependency, but code you own and can modify
- Mirascope Native - Built specifically for Mirascope with proper decorators, response models, and async patterns
- Smart CLI - Intelligently places components based on your project configuration
- Provider Agnostic - Works with OpenAI, Anthropic, Google, Mistral, and any Mirascope-supported provider
- Built-in Observability - Optional Lilypad integration for tracing and monitoring
sygaldry uses a three-tier configuration system:
sygaldry.json- Your project configuration that tells the CLI where to place componentscomponent.json- Each component's metadata, dependencies, and structuresygaldry.md- Component documentation that becomes part of your codebase
When you run sygaldry add <component>, the CLI:
- Reads your
sygaldry.jsonto understand your project structure - Fetches the component's
component.jsonto know what files to copy - Places files in the correct directories based on component type
- Installs any required dependencies
- Applies any customizations (provider, model, Lilypad integration)
π See the complete configuration flow example to understand how all pieces work together.
# Install the CLI
pip install sygaldry-cli
# Or with uv (recommended)
uv pip install sygaldry-cli# Create a sygaldry configuration file
sygaldry init
# This creates a sygaldry.json with your project structureYour sygaldry.json might look like:
{
"$schema": "./sygaldry.schema.json",
"agentDirectory": "src/agents",
"toolDirectory": "src/tools",
"promptTemplateDirectory": "src/prompts",
"responseModelDirectory": "src/models",
"evalDirectory": "src/evals",
"aliases": {
"agents": "@/agents",
"tools": "@/tools",
"prompts": "@/prompts"
},
"defaultProvider": "openai",
"defaultModel": "gpt-4o-mini",
"stream": false
}# Add a PDF search tool to src/tools/pdf_search/
sygaldry add pdf_search_tool
# Add a web search agent with custom provider to src/agents/web_search/
sygaldry add web_search_agent --provider anthropic --model claude-3-opus
# Add with observability to src/agents/research_assistant/
sygaldry add research_assistant_agent --with-lilypad
# Add from a URL
sygaldry add https://your-registry.com/components/custom_agent.jsonComponents are organized by type, with each component in its own directory:
your_project/
βββ sygaldry.json # Your project configuration
βββ src/
β βββ agents/ # Agent components (from agentDirectory)
β β βββ research_assistant/
β β β βββ __init__.py
β β β βββ agent.py # Main agent implementation
β β β βββ sygaldry.md # Component documentation
β β βββ web_search/
β β βββ __init__.py
β β βββ agent.py
β β βββ sygaldry.md
β βββ tools/ # Tool components (from toolDirectory)
β β βββ pdf_search/
β β β βββ __init__.py
β β β βββ tool.py # Main tool implementation
β β β βββ sygaldry.md
β β βββ csv_search/
β β βββ __init__.py
β β βββ tool.py
β β βββ sygaldry.md
β βββ prompts/ # Prompt templates (from promptTemplateDirectory)
β β βββ summarization/
β β βββ __init__.py
β β βββ prompt.py
β β βββ sygaldry.md
β βββ models/ # Response models (from responseModelDirectory)
β βββ research_output/
β βββ __init__.py
β βββ model.py
β βββ sygaldry.md
Each component includes a component.json that defines:
{
"$schema": "https://sygaldry.ai/schemas/component.json",
"name": "pdf_search",
"version": "0.1.0",
"type": "tool", // Determines which directory to use
"description": "Search within PDF documents using fuzzy matching",
"files_to_copy": [
{
"source": "tool.py",
"destination": "tool.py",
"type": "module"
},
{
"source": "__init__.py",
"destination": "__init__.py",
"type": "init_file"
}
],
"target_directory_key": "toolDirectory", // Which sygaldry.json key to use
"python_dependencies": [
{"name": "PyPDF2", "version": ">=3.0.0"},
{"name": "fuzzywuzzy", "version": ">=0.18.0"}
],
"supports_lilypad": true,
"template_variables": {
"provider": "{{provider}}",
"model": "{{model}}"
}
}All components follow Mirascope best practices:
# Example tool component (functional pattern)
def search_pdf_content(file_path: str, query: str) -> str:
"""Search within a PDF document for the given query."""
# Tool implementation
with open(file_path, 'rb') as f:
# PDF processing logic
return f"Found {query} in {file_path}"
# Example agent using the tool
@llm.call(provider="{{provider}}", model="{{model}}", tools=[search_pdf_content])
@prompt_template("""
Analyze the following research topic: {topic}
Use the search tool to find relevant information in the provided PDFs.
""")
async def research_topic(topic: str, pdf_files: list[str]) -> str:
"""Research a topic using PDF search tools."""
...
# The agent can now call the tool when needed
response = await research_topic("machine learning", ["paper1.pdf", "paper2.pdf"])
if tool := response.tool:
result = tool.call() # Executes search_pdf_content with LLM-provided argsComponents are named with type suffixes in the registry to prevent conflicts, but installed in clean directories:
Registry name β Installation directory
academic_research_agentβagents/academic_research/- Academic paper research and analysiscode_generation_execution_agentβagents/code_generation_execution/- Code generation with execution capabilitiesdataset_builder_agentβagents/dataset_builder/- Automated dataset creation and curationdocument_segmentation_agentβagents/document_segmentation/- Intelligent document chunkinghallucination_detector_agentβagents/hallucination_detector/- Detect and prevent LLM hallucinationsknowledge_graph_agentβagents/knowledge_graph/- Build and query knowledge graphsmarket_intelligence_agentβagents/market_intelligence/- Market research and competitive analysispii_scrubbing_agentβagents/pii_scrubbing/- Remove personally identifiable informationrecruiting_assistant_agentβagents/recruiting_assistant/- Resume screening and candidate matchingresearch_assistant_agentβagents/research_assistant/- General research and information gatheringsales_intelligence_agentβagents/sales_intelligence/- Lead qualification and sales insightstext_summarization_agentβagents/text_summarization/- Multi-format text summarizationweb_search_agentβagents/web_search/- Advanced web search with multiple providers
Registry name β Installation directory
pdf_search_toolβtools/pdf_search/- Search within PDF documents with fuzzy matchingcsv_search_toolβtools/csv_search/- Query and analyze CSV filescode_docs_search_toolβtools/code_docs_search/- Search code documentationcode_interpreter_toolβtools/code_interpreter/- Execute Python code safelydirectory_search_toolβtools/directory_search/- File system navigation and searchduckduckgo_search_toolβtools/duckduckgo_search/- Web search via DuckDuckGoexa_search_toolβtools/exa_search/- Neural search with Exa APIfirecrawl_scrape_toolβtools/firecrawl_scrape/- Advanced web scrapinggit_repo_search_toolβtools/git_repo_search/- Search within Git repositoriesjson_search_toolβtools/json_search/- Query JSON documentsqwant_search_toolβtools/qwant_search/- Privacy-focused web searchurl_content_parser_toolβtools/url_content_parser/- Extract and parse web contentyoutube_video_search_toolβtools/youtube_video_search/- Search and analyze YouTube videos
Mirascope prompt templates:
- Advanced Techniques - Chain of thought, few-shot learning
- Common Patterns - Reusable prompt patterns
- Text Processing - Summarization, extraction, transformation
Pydantic models for Mirascope structured outputs
Mirascope evaluation frameworks for testing LLM applications
The CLI supports customization flags that modify components during installation:
# These flags customize the component's code
sygaldry add research_assistant \
--provider anthropic \ # Sets @llm.call(provider="anthropic")
--model claude-3-opus \ # Sets @llm.call(model="claude-3-opus")
--with-lilypad \ # Adds @lilypad.trace() decorators
--stream # Enables streaming responsesThe CLI uses template variables in the component files to apply these customizations.
# Clone the repository
git clone https://github.com/sygaldry-ai/sygaldry
cd sygaldry
# Install dependencies
task install
# Enter development shell (with devbox)
devbox shell# Run all tests
task test
# Run with coverage
task test:coverage# For a tool component
mkdir -p packages/sygaldry_registry/components/tools/my_tool
# For an agent component
mkdir -p packages/sygaldry_registry/components/agents/my_agentImportant: Component names must include a type suffix to avoid registry conflicts:
- Agents:
_agent(e.g.,research_agent) - Tools:
_tool(e.g.,pdf_search_tool) - Prompts:
_prompt(e.g.,summarization_prompt) - Models:
_model(e.g.,research_output_model) - Evals:
_eval(e.g.,accuracy_eval)
{
"$schema": "https://sygaldry.ai/schemas/component.json",
"name": "my_search_tool", // Note the _tool suffix
"version": "0.1.0",
"type": "tool",
"description": "My custom Mirascope tool",
"files_to_copy": [
{"source": "tool.py", "destination": "tool.py", "type": "module"},
{"source": "__init__.py", "destination": "__init__.py", "type": "init_file"}
],
"target_directory_key": "toolDirectory",
"python_dependencies": [
{"name": "requests", "version": ">=2.28.0"}
],
"supports_lilypad": true,
"template_variables": {
"provider": "{{provider}}",
"model": "{{model}}"
}
}# tool.py - Mirascope functional tool pattern
def my_search_function(query: str, limit: int = 10) -> list[str]:
"""
Search for items matching the query.
Args:
query: The search query string
limit: Maximum number of results to return
Returns:
List of matching results
"""
# Your actual implementation here
results = [] # Search logic
return results[:limit]
# Export the tool function
__all__ = ["my_search_function"]For agents that use tools:
# agent.py
from mirascope import llm, prompt_template
from tools.my_search import my_search_function
@llm.call(
provider="{{provider}}",
model="{{model}}",
tools=[my_search_function] # Tools are passed here
)
@prompt_template("Help me find information about: {topic}")
async def research_agent(topic: str) -> str:
"""Agent that can search for information."""
...The sygaldry.md file is a crucial part of each component that serves multiple purposes:
- Documentation: Comprehensive guide for using the component
- Context: Provides context to LLMs when using the component
- Examples: Shows real-world usage patterns
- Configuration: Documents available options and customizations
Example sygaldry.md structure:
# Component Name
Brief description of what this component does.
## Overview
Detailed explanation of the component's purpose and capabilities.
## Configuration
- `provider`: LLM provider (default: from sygaldry.json)
- `model`: Model to use (default: from sygaldry.json)
- Template variables and their effects
## Usage Examples
\```python
# Basic usage
from tools.my_tool import my_tool_function
result = await my_tool_function(...)
\```
## API Reference
Detailed documentation of functions, classes, and parameters.
## Best Practices
Tips for optimal usage with Mirascope.Want to test drive the agents before integrating them? We've got you covered!
The examples/ directory contains interactive testing tools:
Quick Exploration:
- π simple_agent_demo.py - Quick demos of 4 core agents (great for beginners)
- π― interactive_agent_tester.py - Full interactive tester for all 30+ agents
- π agent_testing_notebook.ipynb - Jupyter notebook for visual testing
Production Testing with Audit Logging:
- π agent_runner_with_logging.py - Comprehensive audit logging
- π§ͺ run_scenarios.py - Scenario-based testing with full logs
- π view_logs.py - Log viewer and analyzer
- π test_scenarios.json - Realistic test scenarios
Option 1: Use the menu script (easiest)
# Install dependencies
pip install -r examples/requirements-interactive.txt
# Set your API key
export OPENAI_API_KEY="your-key"
# Run the menu
./test_agents.shOption 2: Run specific tests
# Quick demo
python3 examples/simple_agent_demo.py
# Production testing with logging
python3 examples/run_scenarios.py
# View audit logs
python3 examples/view_logs.pyπ See examples/INTERACTIVE_TESTING.md for the complete testing guide. π See examples/AGENT_TESTING_WITH_LOGGING.md for logging and audit documentation.
These tools emerge from our work at Grey Haven AI, where we build production AI systems across industries. We open source the patterns and utilities that prove their value in real deployments.
We welcome contributions from the community. Whether you're fixing bugs, improving documentation, or proposing new features, your input helps make these tools better for everyone.
Check individual project repositories for contribution guidelines and development setup instructions.
- Follow the component structure guidelines
- Use Mirascope decorators and patterns
- Include comprehensive tests
- Document in
sygaldry.md - Ensure all dependencies are specified
- Test with multiple LLM providers
- Main README: This file - overview and quick start
- Development Guide: CLAUDE.md - comprehensive development context
- Contributing: CONTRIBUTING.md - how to contribute
- Interactive Testing: examples/ - test agents interactively
- Additional Docs: docs/ - dependency info, PyPI README, test reports
- Component Docs: Each component has its own README in
packages/sygaldry_registry/components/
- Issues: File bugs and feature requests on GitHub Issues
- Discussions: Join conversations on GitHub Discussions
- Examples: See examples/ directory for hands-on testing
MIT License - see LICENSE for details.
- Inspired by shadcn/ui's approach to component libraries
- Built specifically for the Mirascope ecosystem
- Special thanks to all contributors
Built with engineering rigor at Grey Haven AI