exa-reference-architecture
Implement Exa reference architecture with best-practice project layout. Use when designing new Exa integrations, reviewing project structure, or establishing architecture standards for Exa applications. Trigger with phrases like "exa architecture", "exa best practices", "exa project structure", "how to organize exa", "exa layout".
Install
mkdir -p .claude/skills/exa-reference-architecture && curl -L -o skill.zip "https://mcp.directory/api/skills/download/9375" && unzip -o skill.zip -d .claude/skills/exa-reference-architecture && rm skill.zipInstalls to .claude/skills/exa-reference-architecture
About this skill
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
// 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
// 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
// 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
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
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
Next Steps
For architecture variants at different scales, see exa-architecture-variants.
More by jeremylongshore
View all skills by jeremylongshore →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
pdf-to-markdown
aliceisjustplaying
Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.
Related MCP Servers
Browse all serversGitHub Chat lets you query, analyze, and explore GitHub repositories with AI-powered insights, understanding codebases f
Nekzus Utility Server offers modular TypeScript tools for datetime, cards, and schema conversion with stdio transport co
Break down complex problems with Sequential Thinking, a structured tool and step by step math solver for dynamic, reflec
Build persistent semantic networks for enterprise & engineering data management. Enable data persistence and memory acro
Boost your AI code assistant with Context7: inject real-time API documentation from OpenAPI specification sources into y
Boost productivity with Task Master: an AI-powered tool for project management and agile development workflows, integrat
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.