composio-exa

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Exa Search via Composio

通过Composio实现Exa搜索

Exa is an AI-native search engine that understands meaning. Unlike keyword search, Exa finds what you're looking for even if your query doesn't match exact words on the page.
Exa是一款理解语义的原生AI搜索引擎。与关键词搜索不同,即使你的查询与页面上的精确词语不匹配,Exa也能找到你需要的内容。

Environment

环境

bash
COMPOSIO_API_KEY      # API key
COMPOSIO_USER_ID      # Entity ID (required for all requests)
COMPOSIO_CONNECTIONS  # JSON with .exa connection ID
bash
COMPOSIO_API_KEY      # API密钥
COMPOSIO_USER_ID      # 实体ID(所有请求均需提供)
COMPOSIO_CONNECTIONS  # 包含.exa连接ID的JSON

Core Pattern

核心模式

bash
CONNECTION_ID=$(echo $COMPOSIO_CONNECTIONS | jq -r '.exa')

curl -s "https://backend.composio.dev/api/v3/tools/execute/ACTION_NAME" \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "connected_account_id": "'$CONNECTION_ID'",
    "entity_id": "'$COMPOSIO_USER_ID'",
    "arguments": {}
  }' | jq '.data'
bash
CONNECTION_ID=$(echo $COMPOSIO_CONNECTIONS | jq -r '.exa')

curl -s "https://backend.composio.dev/api/v3/tools/execute/ACTION_NAME" \
  -H "x-api-key: $COMPOSIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{\n    \"connected_account_id\": \"'$CONNECTION_ID'\",\n    \"entity_id\": \"'$COMPOSIO_USER_ID'\",\n    \"arguments\": {}\n  }' | jq '.data'

Quick Start

快速开始

bash
undefined
bash
undefined

Semantic search

语义搜索

curl -s "https://backend.composio.dev/api/v3/tools/execute/EXA_SEARCH"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": { "query": "best practices for building AI agents", "numResults": 10, "type": "auto" } }' | jq
curl -s "https://backend.composio.dev/api/v3/tools/execute/EXA_SEARCH"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{\n "connected_account_id": "'$CONNECTION_ID'",\n "entity_id": "'$COMPOSIO_USER_ID'",\n "arguments": {\n "query": "best practices for building AI agents",\n "numResults": 10,\n "type": "auto"\n }\n }' | jq

Get citation-backed answer

获取带引用的答案

curl -s "https://backend.composio.dev/api/v3/tools/execute/EXA_ANSWER"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{ "connected_account_id": "'$CONNECTION_ID'", "entity_id": "'$COMPOSIO_USER_ID'", "arguments": { "query": "What are the key differences between RAG and fine-tuning?" } }' | jq
undefined
curl -s "https://backend.composio.dev/api/v3/tools/execute/EXA_ANSWER"
-H "x-api-key: $COMPOSIO_API_KEY" -H "Content-Type: application/json"
-d '{\n "connected_account_id": "'$CONNECTION_ID'",\n "entity_id": "'$COMPOSIO_USER_ID'",\n "arguments": {\n "query": "What are the key differences between RAG and fine-tuning?"\n }\n }' | jq
undefined

Query Tips

查询技巧

Exa understands natural language. Write queries as if asking a knowledgeable person:
Instead ofTry
"LLM fine tuning"
"tutorials on how to fine-tune large language models"
"react hooks"
"best practices for using React hooks in production"
"startup funding"
"guides for raising seed funding for AI startups"
Exa能够理解自然语言。撰写查询时就像在询问一位知识渊博的人:
不要使用建议使用
\"LLM fine tuning\"
\"如何微调大语言模型的教程\"
\"react hooks\"
\"生产环境中使用React Hooks的最佳实践\"
\"startup funding\"
\"AI初创公司种子轮融资指南\"

Best Practices

最佳实践

  1. Use EXA_ANSWER for questions: When you need a direct answer with citations
  2. Use EXA_SEARCH for exploration: When you need multiple results to analyze
  3. Be specific: "Python libraries for PDF text extraction" > "PDF Python"
  4. Use filters: Narrow by domain or date for recent/authoritative sources
  1. 对问题使用EXA_ANSWER:当你需要带有引用来源的直接答案时
  2. 对探索使用EXA_SEARCH:当你需要多个结果进行分析时
  3. 表述要具体:"用于PDF文本提取的Python库" > "PDF Python"
  4. 使用筛选器:按域名或日期缩小范围,获取最新/权威来源

All Actions

所有操作

See references/actions.md for complete API reference including:
  • EXA_SEARCH: Semantic web search with filtering
  • EXA_ANSWER: Citation-backed answers to questions
  • EXA_FIND_SIMILAR: Find pages similar to a URL
  • EXA_GET_CONTENTS_ACTION: Get full content from results
完整的API参考请查看references/actions.md,包括:
  • EXA_SEARCH:带筛选功能的语义网页搜索
  • EXA_ANSWER:带有引用来源的问题答案
  • EXA_FIND_SIMILAR:查找与指定URL相似的页面
  • EXA_GET_CONTENTS_ACTION:从结果中获取完整内容

Discover Actions

发现操作

bash
curl -s "https://backend.composio.dev/api/v2/actions?apps=exa" \
  -H "x-api-key: $COMPOSIO_API_KEY" | jq '.items[] | {name, description}'
bash
curl -s "https://backend.composio.dev/api/v2/actions?apps=exa" \
  -H "x-api-key: $COMPOSIO_API_KEY" | jq '.items[] | {name, description}'