Context Engineering with Terraphim: Quick Start
Get started with context engineering using Terraphim as a superior alternative to Conare AI in 10 minutes.
Why Terraphim?
Terraphim provides all of Conare AI's features plus:
- β Open source (no $59 fee)
- β Cross-platform (not just macOS)
- β Knowledge graphs for semantic search
- β Multiple LLM providers (Ollama, OpenRouter, custom)
- β Version-controlled context (git)
- β Advanced MCP integration
Quick Start (10 minutes)
1. Install Terraphim
# Clone repository
# Build
# Verify installation
2. Create Context Directories
# Create context structure
# Example vibe-rule
3. Configure Context Engineer Role
Use the provided configuration:
# Copy example config
# Or create from scratch
4. Start Terraphim Server
# Start Ollama (if using local LLM)
# Start Terraphim
# Server will:
# 1. Index all markdown files in context-library and vibe-rules
# 2. Build knowledge graph with nodes and edges
# 3. Create automata for fast searching
# 4. Start HTTP API on dynamic port (check logs for port)5. Setup MCP Server for Claude Desktop
# Start MCP server (separate terminal)
# Or build and run manually
6. Configure Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
Restart Claude Desktop.
7. Test Context Engineering
In Claude Desktop:
You: "Show me async patterns"
Claude: [Uses terraphim search tool]
I found several async patterns in the knowledge graph:
1. **Tokio Spawn Pattern** (docs/vibe-rules/rust/async-patterns.md:5)
Use `tokio::spawn` for concurrent tasks that don't share state.
Example:
```rust
tokio::spawn(async move {
process_item(item).await;
});- Bounded Channels (docs/vibe-rules/rust/async-patterns.md:45) [...]
---
## Usage Examples
### Example 1: Add New Vibe-Rule
```bash
# Create rule
cat > docs/vibe-rules/rust/error-handling.md <<'EOF'
# Rust Error Handling
## thiserror Pattern
#rust #error #thiserror
Use `thiserror` for custom error types:
\`\`\`rust
#[derive(Error, Debug)]
pub enum ServiceError {
#[error("Database error: {0}")]
Database(#[from] sqlx::Error),
}
\`\`\`
EOF
# Restart Terraphim to rebuild knowledge graph
# Or wait for auto-reload (if enabled)Example 2: Search Context
# Via API
# Via Claude Desktop
# Just ask: "Show me error handling patterns"Example 3: Autocomplete
# Via MCP in Claude Desktop
# Start typing "async" and Claude will suggest:
# - async-patterns
# - async-cancellation
# - async-testing
# With snippets and linksCommon Workflows
Workflow 1: Learning New Pattern
Goal: Learn async cancellation in Rust
- Search: "Show me async cancellation"
- Claude finds: docs/vibe-rules/rust/async-patterns.md
- Extract context: Specific
tokio::select!example with line numbers - Get related: "What else should I know about async?"
- Claude suggests: error-handling, testing, structured-concurrency
Workflow 2: Code Review
Goal: Review async code for best practices
- Share code: Paste async function
- Ask: "Review this against async best practices"
- Claude searches: Vibe-rules for #async #rust
- Claude analyzes: Compares code to patterns
- Claude reports: Violations, improvements, links to rules
Workflow 3: Adding Context
Goal: Add new project documentation
- Create docs: Write markdown in
docs/context-library/architecture/ - Tag concepts: Use
#hashtagsliberally - Cross-reference: Link with
[[wiki-style]]links - Restart Terraphim: Knowledge graph rebuilds automatically
- Search available: New docs now in semantic search
Directory Structure
After setup, you should have:
terraphim-ai/
βββ docs/
β βββ context-library/ # Reference documentation
β β βββ README.md
β β βββ architecture/
β β βββ patterns/
β β βββ rules/
β β βββ references/
β β
β βββ vibe-rules/ # Actionable coding rules
β β βββ README.md
β β βββ global/ # Language-agnostic rules
β β β βββ naming-conventions.md
β β β βββ documentation-standards.md
β β βββ rust/ # Rust-specific rules
β β β βββ async-patterns.md
β β β βββ error-handling.md
β β βββ python/
β β βββ typescript/
β β
β βββ conare-comparison.md # Feature comparison
β βββ context-collections.md # Collection management
β βββ mcp-file-context-tools.md # MCP tools reference
β
βββ terraphim_server/
β βββ default/
β βββ context_engineer_config.json
β
βββ my_config.json # Your configComparison: Conare vs Terraphim
| Task | Conare | Terraphim |
|------|--------|-----------|
| Upload context once | Manual upload | Create markdown file |
| Reuse across conversations | Automatic | Automatic (knowledge graph) |
| Vibe-rules | UI-based | Git-versioned markdown |
| File references | "@" notation | MCP search + extract_paragraphs |
| Token tracking | Built-in dashboard | Document metadata |
| Context collections | Load/unload | Role switching |
| Price | $59 | Free |
| Platform | macOS only | Linux, macOS, Windows |
| LLM | Claude only | Ollama, OpenRouter, custom |
Troubleshooting
Server Won't Start
# Check config is valid JSON
|
# Check paths exist
# Check port conflicts
Knowledge Graph Not Building
# Verify markdown files exist
# Check permissions
# Run with debug logging
RUST_LOG=debug MCP Not Connecting
# Check MCP server is running
|
# Test MCP server directly
# Check Claude Desktop config
# View Claude Desktop logs
Search Returns No Results
# Verify role is selected
|
# Check haystacks configured
|
# Rebuild knowledge graph
Next Steps
1. Expand Context Library
Add more documents:
- Architecture decision records (ADRs)
- API documentation
- Design patterns
- Troubleshooting guides
2. Create Vibe-Rules
Codify your team's standards:
- Naming conventions
- Error handling patterns
- Testing strategies
- Security guidelines
3. Build Collections
Organize by context:
web-backend: API developmentcli-tools: Command-line appsdata-science: ML/data pipelines
See: Context Collections
4. Integrate with Workflow
- Git hooks for auto-rebuild
- VS Code workspace integration
- CI/CD documentation validation
- Team knowledge sharing
5. Optimize Performance
- Enable autocomplete index caching
- Configure lazy loading for large collections
- Use document summaries instead of full text
- Set up Redis for distributed caching
Resources
Documentation
- Conare Comparison - Full feature comparison
- Vibe Rules Guide - Creating coding rules
- Context Library - Reference docs
- MCP File Context - File-based tools
- Context Collections - Collection management
Examples
docs/vibe-rules/rust/async-patterns.md- Async patternsdocs/vibe-rules/rust/error-handling.md- Error handlingdocs/vibe-rules/global/naming-conventions.md- Naming rulesdocs/vibe-rules/global/documentation-standards.md- Docs standards
Community
- GitHub Issues: https://github.com/terraphim/terraphim-ai/issues
- Discussions: https://github.com/terraphim/terraphim-ai/discussions
- Documentation: https://terraphim.io/docs
Tips and Tricks
1. Use Hashtags Liberally
More tags = better search:
2. Cross-Reference Everything
Link related concepts:
- --3. Include Working Examples
Always show working code:
4. Explain Why, Not What
5. Version Control Everything
6. Test Your Context
Ask Claude:
- "What async patterns do you know?"
- "Show me error handling examples"
- "How should I structure tests?"
If it can't answer, add more context!
Success Metrics
Track your context engineering success:
- Search Success Rate: Can Claude find what you need?
- Code Review Quality: Does Claude catch pattern violations?
- Onboarding Time: How fast do new developers learn patterns?
- Documentation Usage: Are vibe-rules actually referenced?
- Context Growth: Is the knowledge graph expanding?
Conclusion
You now have a working Terraphim setup for context engineering that rivals Conare AI while being:
- Free and open source
- Cross-platform
- More powerful (knowledge graphs)
- Version-controlled (git)
- Extensible (MCP, custom tools)
Start adding your context, and watch your AI assistant become an expert in your codebase!
Support
Need help?
- Read the full comparison
- Check the troubleshooting guide
- Open an issue on GitHub
- Ask in community discussions
Happy context engineering! π