| name | exa-architecture-variants |
| description | Choose and implement Exa architecture patterns at different scales: direct search, cached search, and RAG pipeline.
Use when designing Exa integrations, choosing between simple search and full RAG,
or planning architecture for different traffic volumes.
Trigger with phrases like "exa architecture", "exa blueprint",
"how to structure exa", "exa RAG design", "exa at scale".
|
| allowed-tools | Read, Grep |
| version | 1.11.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","exa","architecture","rag","scaling"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Exa Architecture Variants
Overview
Three deployment architectures for Exa neural search at different scales. Each uses real Exa SDK methods: search, searchAndContents, findSimilar, getContents, and answer.
Decision Matrix
| Factor | Direct Search | Cached Search | RAG Pipeline |
|---|
| Volume | < 1K/day | 1K-50K/day | Any volume |
| Latency | 500-2000ms | ~50ms (cached) | 3-8s total |
| Use Case | Simple search UI | Content aggregation | AI answers with citations |
| Complexity | Low | Medium | High |
| Cache Required | No | Yes (Redis/LRU) | Yes |
| Exa Methods | searchAndContents | searchAndContents + cache | All methods |
Instructions
Variant 1: Direct Search Integration
Best for: Adding search to an existing app, < 1K queries/day.
import Exa from "exa-js";
import express from "express";
const app = express();
const exa = new Exa(process.env.EXA_API_KEY);
app.get("/api/search", async (req, res) => {
const query = req.query.q as ;
(!query) res.().({ : });
{
results = exa.(query, {
: ,
: ,
: { : },
: { : , query },
});
res.(results..( ({
: r.,
: r.,
: r.?.() || r.?.(, ),
: r.,
})));
} (: ) {
res.(err. || ).({ : err. });
}
});