exa-known-pitfalls
Identify and avoid Exa anti-patterns and common integration mistakes. Use when reviewing Exa code for issues, onboarding new developers, or auditing existing Exa integrations for best practices violations. Trigger with phrases like "exa mistakes", "exa anti-patterns", "exa pitfalls", "exa what not to do", "exa code review".
- License 许可
- MIT
- 最近更新
- 2026-03-20
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- exa-known-pitfalls
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Identify and avoid Exa anti-patterns and common integration mistakes. Use when reviewing Exa code for issues, onboarding new developers, or auditing existing Exa integrations for best practices violations. Trigger with phrases like "exa mistakes", "exa anti-patterns", "exa pitfalls", "exa what not to do", "exa code review".
- allowed-tools
- Read, Grep
- compatible-with
- claude-code, codex, openclaw
03 SKILL.md 正文
Exa Known Pitfalls
Overview
Real gotchas when integrating Exa's neural search API. Exa uses embeddings-based search rather than keyword matching, which creates a different class of failure modes than traditional search APIs.
Prerequisites
- Exa API key configured
- Understanding of neural vs keyword search differences
- Familiarity with search result relevance scoring
Instructions
Step 1: Avoid Keyword-Style Queries
Exa's neural search interprets natural language, not keywords. Boolean operators and exact-match syntax degrade results.
from exa_py import Exa
exa = Exa(api_key=os.environ["EXA_API_KEY"])
# BAD: keyword-style query returns poor results
results = exa.search("python AND machine learning OR deep learning 2024") # 2024 year
# GOOD: natural language query
results = exa.search(
"recent tutorials on building ML models with Python",
num_results=10,
use_autoprompt=True # let Exa optimize the query
)
Step 2: Don't Ignore Search Type Selection
Exa offers neural and keyword search. Using the wrong type silently degrades quality.
# BAD: using neural search for a specific URL or exact title
results = exa.search("arxiv.org/abs/2301.00001", type="neural")
# GOOD: use keyword search for exact matches, neural for concepts
results = exa.search("arxiv.org/abs/2301.00001", type="keyword")
results_concept = exa.search(
"transformer architecture improvements for long context",
type="neural"
)
Step 3: Handle Content Retrieval Separately
A common mistake is assuming search() returns full page content. It returns metadata only unless you request contents.
# BAD: accessing content that wasn't fetched
results = exa.search("AI safety research papers")
text = results.results[0].text # None! Content not requested
# GOOD: use search_and_contents or get_contents
results = exa.search_and_contents(
"AI safety research papers",
text={"max_characters": 3000}, # 3000: 3 seconds in ms
highlights=True
)
print(results.results[0].text) # full text
print(results.results[0].highlights) # key excerpts
Step 4: Watch Date Filtering Edge Cases
Date filters silently exclude results. Overly narrow windows return empty results without error.
# BAD: too narrow, may return nothing
results = exa.search(
"breaking news in AI",
start_published_date="2024-03-10", # 2024 year
end_published_date="2024-03-10" # single day = few results
)
# GOOD: reasonable date window with fallback
results = exa.search(
"breaking news in AI",
start_published_date="2024-03-01",
end_published_date="2024-03-15"
)
if not results.results:
results = exa.search("breaking news in AI", num_results=5)
Step 5: Autoprompt Cost Awareness
use_autoprompt=True makes an extra LLM call per request, adding latency and cost.
# BAD: autoprompt on every request in a high-volume loop
for query in thousands_of_queries:
exa.search(query, use_autoprompt=True) # 2x cost, extra latency
# GOOD: use autoprompt selectively
results = exa.search(
well_formed_query,
use_autoprompt=False # skip when query is already well-structured
)
Error Handling
| Issue | Cause | Solution |
|---|---|---|
| Empty results, no error | Date filter too narrow | Widen date range or remove filter |
| Low relevance scores | Keyword-style query | Rewrite as natural language |
Missing .text field |
Content not requested | Use search_and_contents() |
| Slow responses | Autoprompt on every call | Disable for pre-optimized queries |
| 429 rate limit | Burst requests | Add exponential backoff with jitter |
Examples
Similarity Search Pitfall
# find_similar requires a URL, not a query string
# BAD:
results = exa.find_similar("machine learning papers")
# GOOD:
results = exa.find_similar(
"https://arxiv.org/abs/2301.00001",
num_results=10
)
Resources
Output
- Configuration files or code changes applied to the project
- Validation report confirming correct implementation
- Summary of changes made and their rationale
04 同仓库更多 Skills
azure-apim-architecture
Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.
apiops-deployment
Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.
apim-policy-authoring
Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.
api-security-review
Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.
jira-cli
Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.
calculator
Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.