Agenttailor
Make AI agents dramatically better by automatically assembling the optimal context for ChatGPT, Claude, and any AI agent
Installation
npx agenttailorAsk AI about Agenttailor
Powered by Claude Β· Grounded in docs
I know everything about Agenttailor. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
AgentTailor
The context engine that makes AI agents dramatically better.
AgentTailor is a dual-pipeline platform that (1) automatically assembles optimal context from your documents and the web for any AI conversation, and (2) generates production-ready AI agent definitions tailored to your project. It works across ChatGPT, Claude, MCP, and any LLM β so you get better answers without manual prompt engineering.
Two Pipelines, One Platform
βββββββββββββββββββββββββββββββββββββββ
β SHARED INFRASTRUCTURE β
β Doc Processing Β· Vector DB β
β Scoring Β· Compression Β· Web β
ββββββββββββββ¬βββββββββββ¬βββββββββββββββ
β β
ββββββββββββββββββ βββββββββββββββββββ
βΌ βΌ
ββββββββββββββββββββββββ βββββββββββββββββββββββββββ
β PIPELINE A β β PIPELINE B β
β Context Assembly β β Agent Factory β
β β β β
β Task β Retrieve β β β Requirement β Discover β
β Score β Compress β β β Online Configs β Score β
β Format β Inject β β & Merge β Generate β β
β β β Export (Claude/Cursor/ β
β Delivery: Extension, β β System Prompt) β
β MCP, API, GPT Store β β β
ββββββββββββββββββββββββ βββββββββββββββββββββββββββ
Pipeline A β Give it a task, get back a perfectly curated context package from your docs + web search, formatted for your target AI platform.
Pipeline B β Describe the agent you need (role, stack, domain), and it discovers proven configs online, merges them with your project docs, and generates a production-ready agent definition.
Quick Start
Option 1: Local Mode (zero API keys)
git clone https://github.com/yourusername/agenttailor.git
cd agenttailor
npm run setup # docker compose + install + db push + seed
npm run dev # server :4000, dashboard :5173
Open http://localhost:5173 and you're ready. Local mode uses built-in embeddings (@xenova/transformers), no auth, and a pre-seeded user with a "Getting Started" project.
Option 2: MCP Server (Claude Desktop / Claude Code)
Add to your MCP config (~/.claude/settings.json or Claude Desktop config):
{
"mcpServers": {
"agent-tailor": {
"command": "npx",
"args": ["agent-tailor-mcp"],
"env": {
"AGENTTAILOR_API_URL": "http://localhost:4000"
}
}
}
}
This gives you 7 tools inside Claude:
| MCP Tool | What It Does |
|---|---|
tailor_context | Assemble optimal context for a task from your docs + web |
search_docs | Semantic search across your uploaded documents |
upload_document | Upload a document to a project |
list_projects | List your projects and their stats |
generate_agent | Generate a specialized agent from a description |
browse_config_library | Browse curated agent config templates |
export_agent | Re-export a generated agent in a different format |
Option 3: SaaS Mode
For multi-user deployment with Clerk auth and OpenAI embeddings:
cp .env.example .env
# Fill in: AUTH_MODE=clerk, CLERK_SECRET_KEY, OPENAI_API_KEY, etc.
npm run dev
Using AgentTailor in Large Projects
AgentTailor shines when you have a project with many tasks that each need specialized agents or context. Here's the workflow:
Step 1: Create a project and upload your docs
# Via API
curl -X POST http://localhost:4000/api/projects \
-H "Content-Type: application/json" \
-d '{ "name": "MyApp", "description": "E-commerce platform with React + Express" }'
# Upload your architecture docs, coding standards, schemas, etc.
curl -X POST http://localhost:4000/api/documents/upload \
-F "file=@./docs/architecture.md" \
-F "projectId=YOUR_PROJECT_ID"
Or just use the Dashboard at http://localhost:5173 to create a project and drag-and-drop your files.
Step 2: Generate task-specific agents
For each task in your project, generate an agent that knows your codebase AND is specialized for the task:
# Task: "Implement JWT authentication"
curl -X POST http://localhost:4000/api/agents/generate \
-H "Content-Type: application/json" \
-d '{
"role": "Backend auth engineer",
"stack": ["express", "typescript", "jwt", "prisma"],
"domain": "api",
"description": "Implement JWT-based authentication with refresh tokens, middleware, and Prisma user model",
"targetFormat": "CLAUDE_AGENT",
"projectId": "YOUR_PROJECT_ID"
}'
This will:
- Analyze the requirement and detect relevant domains
- Search the curated library + web for proven auth configs
- Score each config on Specificity (1-5) + Relevance (1-5)
- Retrieve and compress relevant docs from your project
- Merge the best configs with your project context
- Generate a complete agent definition
- Export in your chosen format (Claude agent
.md, Cursor.cursorrules, or system prompt) - Score the result on 4 quality dimensions
Step 3: Use the generated agent
Claude Code β Copy the agent to .claude/agents/auth-engineer.md and invoke with /agents/auth-engineer
Cursor β Save as .cursorrules in your project root
Any LLM β Use the system prompt format as your AI's system message
Example: Multi-Task Project Workflow
Imagine you're building a SaaS app with 20 tasks across 5 phases. For each task, you generate a tailored agent:
Phase 1: Foundation
T001: Scaffold monorepo β Agent: scaffold-engineer (node, monorepo, typescript)
T002: Database schema β Agent: database-architect (prisma, postgresql, migrations)
T003: Auth system β Agent: auth-engineer (jwt, express, middleware)
Phase 2: Core Features
T004: REST API routes β Agent: api-developer (express, zod, rest)
T005: React dashboard β Agent: frontend-engineer (react, tailwind, react-query)
T006: File uploads β Agent: upload-specialist (multer, s3, streaming)
Phase 3: Intelligence
T007: Search engine β Agent: search-engineer (elasticsearch, vector-search)
T008: Recommendations β Agent: ml-engineer (embeddings, scoring, ranking)
Each agent gets:
- Online proven configs for its specific stack (discovered from GitHub, curated library)
- Your project context β architecture docs, coding standards, existing patterns
- Task-specific focus β only the conventions and examples relevant to this task
Using the MCP Tools for Task-Based Workflow
If you use Claude Code or Claude Desktop, the MCP integration makes this seamless:
You: "I need to implement T005 β the React dashboard with project management,
document uploads, and analytics pages. Generate an agent for this."
Claude (using generate_agent tool):
β Discovers React + Tailwind + React Query configs
β Pulls your architecture docs and existing component patterns
β Generates a frontend-engineer agent with your conventions
β Returns the agent definition ready to use
Assembling Context (Pipeline A)
Beyond agent generation, AgentTailor's original superpower is assembling the perfect context for any AI conversation:
# "What context does Claude need to help me implement caching?"
curl -X POST http://localhost:4000/api/tailor \
-H "Content-Type: application/json" \
-d '{
"projectId": "YOUR_PROJECT_ID",
"taskInput": "Implement Redis caching layer for API responses",
"targetPlatform": "claude",
"options": {
"maxTokens": 8000,
"includeWebSearch": true,
"includeScore": true
}
}'
The intelligence engine:
- Analyzes your task β detects domains, complexity, keywords
- Retrieves relevant chunks from your documents via vector search
- Detects gaps β if your docs don't cover Redis, triggers web search
- Compresses β FULL quotes for highly relevant, SUMMARY for medium, KEYWORDS for low
- Ranks by relevance, recency, authority
- Formats for target platform (XML tags for GPT,
<document>tags for Claude) - Scores quality: coverage (0.35), relevance (0.30), diversity (0.20), compression (0.15)
The response includes the tailored context, all sources with attribution, token count, and a quality score with suggestions for improvement.
Chrome Extension
Install the Chrome extension to inject context directly into ChatGPT and Claude conversations. The side panel lets you preview, edit, and control what context gets injected.
Custom GPT
Use the Custom GPT with OpenAPI Actions to get AgentTailor-powered context inside the GPT Store.
Delivery Platforms
| Platform | How | Status |
|---|---|---|
| REST API | POST /api/tailor + POST /api/agents/generate | v1.2 |
| MCP Server | 7 tools for Claude Desktop / Claude Code | v1.2 |
| Chrome Extension | Content scripts for chatgpt.com and claude.ai | v1.0 |
| Dashboard | React app β projects, documents, agents, analytics | v1.2 |
| Custom GPT | GPT Store listing with OpenAPI Actions | v1.0 |
| CLI tool | agenttailor context "my task" | Planned |
| VS Code extension | IDE-native context panel | Planned |
Architecture
Monorepo Structure
agenttailor/
βββ shared/ # @agenttailor/shared β 26 Zod schemas, types, constants
βββ server/ # Express API server (port 4000)
β βββ prisma/ # PostgreSQL schema (User, Project, Document, Chunk,
β β # Session, AgentConfig, ConfigTemplate, AgentSession)
β βββ src/
β βββ routes/ # 15+ API endpoints
β βββ services/
β β βββ intelligence/ # 7-module pipeline (analyze, score, compress...)
β β βββ agentOrchestrator.ts # 10-step agent generation pipeline
β β βββ configDiscovery.ts # Web search for proven configs
β β βββ configParser.ts # Normalize Claude/Cursor/prompt formats
β β βββ configScorer.ts # Specificity + Relevance scoring
β β βββ configLibrary.ts # Curated template index
β β βββ agentGenerator.ts # Merge configs + docs β agent
β β βββ formatExporter.ts # Export to Claude/Cursor/prompt
β β βββ agentQualityScorer.ts # 4-dimension quality assessment
β βββ middleware/ # Auth, rate limiting, plan enforcement
β βββ lib/ # Redis, token counter, Prisma client
βββ dashboard/ # React 18 + Vite + Tailwind (port 5173)
β βββ src/
β βββ pages/ # 12 pages (projects, docs, agents, analytics...)
β βββ components/ # 30+ components
βββ extension/ # Chrome MV3 extension
β βββ src/
β βββ content/{chatgpt,claude}/ # Platform content scripts
β βββ sidepanel/ # Context + Agent builder
β βββ popup/ # Quick settings
βββ mcp-server/ # Claude Desktop / Code integration
β βββ src/tools/ # 7 MCP tools
βββ landing/ # Marketing page
Tech Stack
| Layer | Technology |
|---|---|
| Backend | Node.js 20+, Express, TypeScript (strict) |
| Database | PostgreSQL via Prisma ORM |
| Vector Store | ChromaDB (local) / Pinecone (production) |
| Cache | Redis (ioredis, fail-open) |
| Queue | Bull (async document processing) |
| Dashboard | React 18, Vite, Tailwind CSS, React Query, Recharts |
| Extension | Chrome Manifest V3, React |
| MCP | @modelcontextprotocol/sdk (stdio transport) |
| Auth | Clerk (SaaS) or local mode (no auth) |
| Embeddings | OpenAI ada-002 (SaaS) or @xenova/transformers (local) |
| Validation | Zod (schema-first, inferred types) |
| Web Search | Tavily API + Brave Search fallback |
| Testing | Vitest (162 tests) |
API Reference
Context Assembly (Pipeline A)
# Assemble context for a task
POST /api/tailor
{
"projectId": "...",
"taskInput": "Implement user authentication with JWT",
"targetPlatform": "claude", # or "chatgpt"
"options": {
"maxTokens": 8000,
"includeWebSearch": true,
"includeScore": true
}
}
# β { data: { tailoredContext, sources, tokenCount, qualityScore, qualityDetails } }
Agent Factory (Pipeline B)
# Generate a specialized agent
POST /api/agents/generate
{
"role": "React component builder",
"stack": ["react", "typescript", "tailwind"],
"domain": "web",
"description": "Build accessible, reusable React components with Tailwind styling",
"targetFormat": "CLAUDE_AGENT",
"projectId": "..." # optional β includes project docs in agent context
}
# β { data: { agent, configSources, qualityScore, session } }
# Quick preview without LLM calls
POST /api/agents/preview
# Same body as /generate β fast estimate of quality and sources
# List your generated agents
GET /api/agents
# Get agent details
GET /api/agents/:id
# Re-export in different format
POST /api/agents/:id/export
{ "format": "CURSOR_RULES" }
# Delete an agent
DELETE /api/agents/:id
# Browse curated config library
GET /api/configs/library?stack=react,typescript&domain=web
# Get config template details
GET /api/configs/library/:id
# Search online for configs (standalone)
POST /api/configs/search
{ "stack": ["react"], "role": "frontend", "domain": "web" }
Development
# Prerequisites: Docker, Node.js 20+
# Start local services
docker compose up -d # PostgreSQL, Redis, ChromaDB
# Install and build
npm install
npm run build -w shared # Build shared package first
# Database setup
npx prisma db push --schema=server/prisma/schema.prisma
npx tsx server/prisma/seed.ts
# Seed config library (9 built-in templates)
npx tsx server/src/scripts/seedConfigLibrary.ts
# Start development
npm run dev # Server :4000 + Dashboard :5173
# Quality checks
npm run typecheck # TypeScript across all packages
npm run test # 162 tests
npm run lint # ESLint
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
Good first issues:
- Add a new embedding provider (Cohere, Voyage AI)
- Add AST-based code chunking for JavaScript/TypeScript
- Add Unity/game-dev config templates to the curated library
- Add Firefox extension support
- Add dark mode to the dashboard
- Improve test coverage for intelligence engine modules
