exa-reference-architecture
Implement Exa reference architecture for search pipelines, RAG, and content discovery. Use when designing new Exa integrations, reviewing project structure, or establishing architecture standards for neural search applications. Trigger with phrases like "exa architecture", "exa project structure", "exa RAG pipeline", "exa reference design", "exa search pipeline".
What this skill does
# Exa Reference Architecture
## Overview
Production architecture for Exa neural search integration. Covers search service design, content extraction pipeline, RAG integration, domain-scoped search profiles, and caching strategy.
## Architecture Diagram
```
┌──────────────────────────────────────────────────────────┐
│ Application Layer │
│ RAG Pipeline | Research Agent | Content Discovery │
└──────────┬──────────────┬───────────────┬────────────────┘
│ │ │
▼ ▼ ▼
┌──────────────────────────────────────────────────────────┐
│ Exa Search Service Layer │
│ ┌────────────┐ ┌────────────┐ ┌──────────────────┐ │
│ │ search() │ │ findSimilar│ │ getContents() │ │
│ │ neural/ │ │ (URL seed) │ │ (known URLs) │ │
│ │ keyword/ │ └────────────┘ └──────────────────┘ │
│ │ auto/fast │ │
│ └────────────┘ ┌──────────────────┐ │
│ │ answer() / │ │
│ Content Options: │ streamAnswer() │ │
│ text | highlights | summary └──────────────────┘ │
│ │
│ ┌────────────────────────────────────────────────────┐ │
│ │ Result Cache (LRU + Redis) │ │
│ └────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────┘
│
▼
┌──────────────────────────────────────────────────────────┐
│ api.exa.ai — Exa Neural Search API │
│ Auth: x-api-key header | Rate: 10 QPS default │
└──────────────────────────────────────────────────────────┘
```
## Instructions
### Step 1: Search Service Layer
```typescript
// src/exa/service.ts
import Exa from "exa-js";
const exa = new Exa(process.env.EXA_API_KEY);
interface SearchRequest {
query: string;
type?: "auto" | "neural" | "keyword" | "fast" | "instant";
numResults?: number;
startDate?: string;
endDate?: string;
includeDomains?: string[];
excludeDomains?: string[];
category?: "company" | "research paper" | "news" | "tweet" | "people";
}
interface ContentOptions {
text?: boolean | { maxCharacters?: number };
highlights?: boolean | { maxCharacters?: number; query?: string };
summary?: boolean | { query?: string };
}
export async function searchWithContents(
req: SearchRequest,
content: ContentOptions = { text: { maxCharacters: 2000 } }
) {
return exa.searchAndContents(req.query, {
type: req.type || "auto",
numResults: req.numResults || 10,
startPublishedDate: req.startDate,
endPublishedDate: req.endDate,
includeDomains: req.includeDomains,
excludeDomains: req.excludeDomains,
category: req.category,
...content,
});
}
export async function findRelated(url: string, numResults = 5) {
return exa.findSimilarAndContents(url, {
numResults,
text: { maxCharacters: 1000 },
excludeSourceDomain: true,
});
}
```
### Step 2: Research Pipeline
```typescript
// src/exa/research.ts
export async function researchTopic(topic: string) {
// Phase 1: Broad neural search
const sources = await exa.searchAndContents(topic, {
type: "neural",
numResults: 15,
text: { maxCharacters: 2000 },
highlights: { maxCharacters: 500, query: topic },
startPublishedDate: "2024-01-01T00:00:00.000Z",
});
// Phase 2: Find similar to best result
const topUrl = sources.results[0]?.url;
const similar = topUrl
? await exa.findSimilarAndContents(topUrl, {
numResults: 5,
text: { maxCharacters: 1500 },
excludeSourceDomain: true,
})
: { results: [] };
// Phase 3: Get AI answer with citations
const answer = await exa.answer(
`Based on recent research, summarize: ${topic}`,
{ text: true }
);
return {
primary: sources.results,
related: similar.results,
aiSummary: answer.answer,
sources: answer.results.map(r => ({ title: r.title, url: r.url })),
};
}
```
### Step 3: RAG Integration Pattern
```typescript
// src/exa/rag.ts
export async function ragSearch(userQuery: string, contextWindow = 5) {
const results = await exa.searchAndContents(userQuery, {
type: "neural",
numResults: contextWindow,
text: { maxCharacters: 2000 },
highlights: { maxCharacters: 500, query: userQuery },
});
// Format for LLM context injection
const context = results.results
.map((r, i) =>
`[Source ${i + 1}] ${r.title}\n` +
`URL: ${r.url}\n` +
`Content: ${r.text}\n` +
`Key points: ${r.highlights?.join(" | ")}`
)
.join("\n\n---\n\n");
return {
context,
sources: results.results.map(r => ({
title: r.title,
url: r.url,
score: r.score,
})),
};
}
```
### Step 4: Domain-Specific Search Profiles
```typescript
const SEARCH_PROFILES = {
technical: {
includeDomains: [
"github.com", "stackoverflow.com", "arxiv.org",
"developer.mozilla.org", "docs.python.org",
],
},
news: {
category: "news" as const,
includeDomains: ["techcrunch.com", "theverge.com", "arstechnica.com"],
},
research: {
category: "research paper" as const,
includeDomains: ["arxiv.org", "nature.com", "science.org"],
},
companies: {
category: "company" as const,
},
};
export async function profiledSearch(
query: string,
profile: keyof typeof SEARCH_PROFILES
) {
const config = SEARCH_PROFILES[profile];
return searchWithContents({ query, ...config, numResults: 10 });
}
```
### Step 5: Competitor Discovery
```typescript
export async function discoverCompetitors(companyUrl: string) {
const similar = await exa.findSimilarAndContents(companyUrl, {
numResults: 10,
excludeSourceDomain: true,
text: { maxCharacters: 500 },
summary: { query: "What does this company do?" },
});
return similar.results.map(r => ({
name: r.title,
url: r.url,
description: r.summary || r.text?.substring(0, 200),
score: r.score,
}));
}
```
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| No results | Query too specific | Broaden query, switch to neural search |
| Low relevance | Wrong search type | Use `auto` type for hybrid results |
| Empty text/highlights | Site blocks scraping | Use `livecrawl: "preferred"` or try `summary` |
| Rate limit | Too many concurrent requests | Add request queue with 8-10 concurrency |
## Resources
- [Exa API Documentation](https://docs.exa.ai)
- [Exa Search Types](https://docs.exa.ai/reference/search)
- [Exa Contents Retrieval](https://docs.exa.ai/reference/contents-retrieval)
## Next Steps
For architecture variants at different scales, see `exa-architecture-variants`.
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.