# Research: AmpCode Oracle & Librarian Analysis

**Date:** 2025-11-21
**Context:** Comparing AmpCode's agent patterns with OpenCodeKit
**Related Projects:** opencodekit-template

## Question

How can we upgrade OpenCodeKit's researcher/plan/orchestrator agents based on AmpCode's Oracle and Librarian patterns?

## Findings

### 1. Oracle Agent (Code Search)
- **Reality**: Just their `finder` subagent using Haiku 4.5 instead of Sonnet
- **Not a pattern**: Model swap for speed (50% faster, 3X cheaper)
- **No special architecture**: Same search functionality, faster model

### 2. Librarian Agent
- **Reality**: No documentation found
- **Mentioned once**: In manual table of contents only
- **Likely**: Internal tool or unreleased feature

### 3. Faster Search Agent (Blog Post)
- **Change**: Switched from Sonnet to Haiku 4.5
- **Result**: 50% speedup, 3X cost reduction
- **Quality**: No noticeable loss

## Comparison with OpenCodeKit

**What AmpCode Has:**
- Thread sharing (but no memory persistence)
- Basic code search (one subagent)
- Custom commands (similar to ours)
- AGENTS.md guidance files (we have same)

**What OpenCodeKit Has (BETTER):**
- Multi-source research (@researcher: Context7, Exa, GitHub, websearch)
- Structured planning (/plan command with approval gates)
- Memory system (persistent cross-session knowledge)
- Backlog integration (multi-session project tracking)
- Git audit trail (automatic execution history)
- Two-layer architecture (Memory + Backlog + Git)

## Decision

**DON'T copy AmpCode patterns** - they don't have anything we need.

**DO add model speed tiers** inspired by their approach:

### Recommendation: Three-Tier Model Strategy

**1. Fast Tier (@researcher-fast)**
- Use: Haiku 4.5 or Claude Instant
- When: Known searches, documentation lookups
- Speed: 2-3x faster
- Cost: 3x cheaper
- Quality: Good enough for 70% of research

**2. Smart Tier (@researcher - current)**
- Use: Sonnet/GPT-5.1
- When: Complex synthesis, multi-source validation
- Speed: Baseline
- Cost: Baseline
- Quality: Maximum accuracy

**3. Deep Tier (@researcher-deep)**
- Use: GPT-5.1 + extended context
- When: Architecture mapping, security audits
- Speed: Slowest
- Cost: Expensive
- Quality: Comprehensive

### Implementation

```yaml
# .opencode/agent/researcher-fast.md
name: researcher-fast
model: claude-haiku-4.5
max_tokens: 2000
temperature: 0.1
tools: [read, grep, glob, list, webfetch, websearch]

# .opencode/agent/researcher.md (existing - no changes)

# .opencode/agent/researcher-deep.md (optional)
name: researcher-deep
model: github-copilot/gpt-5.1
max_tokens: 8000
temperature: 0.2
tools: [all researcher tools + gkg*, context7*]
```

### Usage Pattern

```bash
# Fast (documentation lookup, known patterns)
/research-fast "Next.js App Router docs"

# Smart (current default - complex synthesis)
/research "authentication best practices 2025"

# Deep (architecture analysis)
/research-deep "map authentication flow across microservices"
```

## Benefits

1. **User Choice**: Let user pick speed vs quality
2. **Cost Optimization**: 70% of research can use fast tier
3. **No Architecture Changes**: Add agents, keep workflow
4. **Backwards Compatible**: /research command unchanged
5. **Clear Value**: AmpCode proved 50% speedup with Haiku works

## Recommended Actions

1. **Immediate**: Create @researcher-fast agent with Haiku 4.5
2. **Test**: Compare quality on 20 common research queries
3. **Document**: Add to CLI.md and README
4. **Optional**: Add @researcher-deep for complex architecture work

## References

- https://ampcode.com/news/faster-search-agent
- https://ampcode.com/manual (Oracle/Librarian sections)

## Conclusion

**AmpCode's "innovation" is just model selection.**

OpenCodeKit's architecture (Memory + Backlog + Git + Multi-source research) is ALREADY superior.

We should steal their ONE good idea: **offer speed tiers** via model selection.

Ignore everything else.
