quay-ai-factory
v0.6.0
Published
Quay — Autonomous AI Software Factory. Self-hosted AI agents, MCP integration, customizable pipelines, real-time Mission Control dashboard, cost transparency, and full audit trails.
Maintainers
Keywords
Readme
Quay - Autonomous AI Software Factory
Self-hosted AI agents with parallel ensemble execution, A3M routing, MCP integration, persistent memory, and full cost transparency.
🚀 The Core Differentiator
Quay is the ONLY agent framework with parallel multi-model ensemble execution.
EVERYONE ELSE (litellm, one-api): try A → fail → try B → fail → try C
Quay (this repo): try A + B + C simultaneously → merge results📦 What's New in v0.5.0
From Vault Research - All Implemented
| Feature | Description | Status | |---------|-------------|--------| | Query-Type Presets | Auto-route by task (code/reasoning/creative) | ✅ | | Cost-Per-Query Tracking | Real-time budget monitoring | ✅ | | Persistent Memory | ReasoningBank 3-phase pipeline | ✅ | | Agent Files | Portable JSON agent configs | ✅ | | MCP Providers | Browser, Bright Data, HuggingFace, Chrome DevTools | ✅ |
🤖 Features
The 5 AI Features
| Feature | Description | |---------|-------------| | Human-in-Loop Verification | Require approval before critical actions | | Determinism & Replay | Black-box recorder for reproducibility | | Visual Pipeline Builder | Drag-drop YAML pipeline generation | | Agent RAG | Knowledge grounding to reduce hallucinations | | Self-Healing Agents | Auto-detect and recover from failures |
The Key Innovation: Parallel Ensemble
// Enable parallel ensemble (THE KEY DIFFERENTIATOR)
const result = await agentRunner.run(task, agent, runId, instructions, tools, {
useEnsemble: true,
ensembleConfig: {
models: [
{ provider: 'openai', model: 'gpt-4o-mini', weight: 0.4 },
{ provider: 'anthropic', model: 'claude-3-haiku', weight: 0.3 },
{ provider: 'google', model: 'gemini-2.5-flash', weight: 0.3 },
],
votingStrategy: 'confidence',
},
});Query-Type Presets (P1)
Auto-classifies queries and routes to optimal models:
import { classifyQuery, selectModelForQuery, QUERY_PRESETS } from '$lib/routing';
// Automatic classification
const type = classifyQuery("Write a REST API with authentication");
// → 'code'
// Auto-select optimal model
const { preset, model } = selectModelForQuery(query, { preferSpeed: true });
// → { preset: QUERY_PRESETS.code, model: ModelProfile {...} }Persistent Memory (P3)
ReasoningBank-inspired memory with 3-phase pipeline:
import { persistentMemory } from '$lib/memory';
// Select relevant memories
const memories = persistentMemory.selectMemory(agentId, query, { limit: 5 });
// Store trajectory and induce memories
persistentMemory.storeTrajectory(trajectory);
// Build context with retrieved memories
const context = persistentMemory.buildContext(agentId, query);Cost Dashboard
Real-time cost tracking at /cost:
import { costDashboard } from '$lib/features/agentRouter';
// Record a query
costDashboard.record({
model: 'claude-3-5-sonnet',
provider: 'anthropic',
queryType: 'code',
tokensIn: 500,
tokensOut: 200,
costUSD: 0.012,
latencyMs: 890,
success: true,
});
// Get metrics
const metrics = costDashboard.getMetrics();Agent Files
Portable JSON format for agent configuration:
import { AgentFileSerializer, AGENT_TEMPLATES } from '$lib/agentfile';
// Export agent to JSON
const file = AgentFileSerializer.serialize(agentConfig);
await AgentFileSerializer.save(agentConfig, './coder-agent.af');
// Load from template
const coderConfig = AgentFileSerializer.fromJSON(
JSON.stringify(AGENT_TEMPLATES.coder)
);
// Import
const imported = AgentFileSerializer.load('./coder-agent.af');🔧 Configuration
# API Keys
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
GOOGLE_API_KEY=...
QUAY_DEFAULT_LLM_URL=https://api.openai.com/v1
# Budget
QUAY_DAILY_BUDGET=10.00 # Daily cost limit
QUAY_QUERY_BUDGET=0.50 # Per-query cost limit
# MCP Providers
BRIGHTDATA_ZONE=... # Bright Data for web scraping
HF_TOKEN=... # HuggingFace access📁 Project Structure
quay/
├── src/
│ ├── lib/
│ │ ├── ensemble.ts # Parallel ensemble executor
│ │ ├── dialog.ts # Multi-round dialog optimizer
│ │ ├── routing.ts # Query presets + CostTracker
│ │ ├── memory.ts # PersistentMemory + ReasoningBank
│ │ ├── agentfile.ts # Agent file format + templates
│ │ ├── mcp-providers.ts # MCP provider integrations
│ │ └── features/ # 5 AI features
│ ├── server/
│ │ └── agents/
│ │ └── agentRunner.ts
│ └── routes/
│ ├── api/ # API endpoints
│ ├── features/ # Features dashboard
│ ├── cost/ # Cost dashboard
│ └── ...
└── tests/🌐 Routes
| Route | Description |
|-------|-------------|
| / | Home / Mission Control |
| /features | Features dashboard |
| /cost | NEW Cost Dashboard |
| /verification | Verification dashboard |
| /health | Agent health monitor |
| /knowledge | Knowledge base manager |
| /pipelines | Visual pipeline builder |
| /replay | Determinism replay UI |
🔗 API Endpoints
| Endpoint | Description |
|----------|-------------|
| GET /api/cost-dashboard | NEW Cost metrics |
| POST /api/cost-dashboard | Record query cost |
| GET /api/verification | List verification requests |
| GET /api/agent-health | Get all agent health status |
| GET /api/pipeline-templates | List pipeline templates |
| GET /api/knowledge-bases | List knowledge bases |
| GET /api/sse | SSE stream |
📊 Test Coverage
Total: 56 tests passing
├── Unit tests: 45
└── Integration tests: 11📜 License
MIT
