Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
- Python 3.10 or higher
- PraisonAI Agents package installed
exa_py package installed
EXA_API_KEY environment variable set
Exa provides AI-powered neural search capabilities optimized for LLM applications. PraisonAI includes built-in Exa tools for easy integration.
Installation
pip install praisonaiagents exa_py
Setup
export EXA_API_KEY=your_exa_api_key
export OPENAI_API_KEY=your_openai_api_key
PraisonAI provides a built-in exa tool that you can import directly:
from praisonaiagents import Agent
from praisonaiagents import exa
agent = Agent(
name="SearchAgent",
role="Web Researcher",
goal="Find information on the web",
tools=[exa]
)
result = agent.start("Find the hottest AI startups in 2025")
print(result)
Available Functions
| Function | Description |
|---|
exa | Neural search (alias for exa_search) |
exa_search | Basic web search |
exa_search_contents | Search with full text/highlights |
exa_find_similar | Find similar pages to a URL |
exa_answer | AI-generated answers with citations |
Basic Usage
Simple Search
from praisonaiagents import exa
# Simple search
results = exa("AI startups 2025")
print(results)
Search with Options
from praisonaiagents import exa_search
results = exa_search(
query="AI startups",
num_results=10,
type="neural", # "auto", "neural", "fast", or "deep"
category="company", # Filter by category
include_domains=["techcrunch.com", "wired.com"],
start_published_date="2024-01-01"
)
for r in results.get("results", []):
print(f"- {r['title']}: {r['url']}")
Search with Content
from praisonaiagents import exa_search_contents
results = exa_search_contents(
query="AI in healthcare",
text=True, # Include full text
highlights=True, # Include relevant highlights
num_results=5
)
for r in results.get("results", []):
print(f"Title: {r['title']}")
print(f"Text: {r.get('text', '')[:500]}...")
if r.get('highlights'):
print(f"Highlights: {r['highlights']}")
Find Similar Pages
from praisonaiagents import exa_find_similar
similar = exa_find_similar(
url="https://openai.com",
num_results=5,
exclude_source_domain=True, # Exclude openai.com from results
category="company"
)
for r in similar.get("results", []):
print(f"- {r['title']}: {r['url']}")
AI-Generated Answers
from praisonaiagents import exa_answer
result = exa_answer(
query="What is the capital of France?",
text=True # Include citation text
)
print(f"Answer: {result['answer']}")
print(f"Citations: {len(result['citations'])}")
for c in result['citations']:
print(f" - {c['title']}: {c['url']}")
With PraisonAI Agent
from praisonaiagents import Agent
from praisonaiagents import exa
agent = Agent(
name="ResearchAgent",
role="AI Researcher",
goal="Find and analyze information about AI companies",
tools=[exa]
)
result = agent.start("Research the top 5 AI startups and their valuations")
print(result)
For more control, use the ExaTools class directly:
from praisonaiagents import ExaTools
# Initialize with custom API key (optional)
tools = ExaTools(api_key="your_api_key") # or uses EXA_API_KEY env var
# Search
results = tools.search("AI news", num_results=5)
# Search with contents
results = tools.search_and_contents("AI healthcare", text=True, highlights=True)
# Find similar
similar = tools.find_similar("https://openai.com", num_results=5)
# Get answer
answer = tools.answer("What is GPT-4?", text=True)
Search Parameters
| Parameter | Type | Description |
|---|
query | str | Search query |
num_results | int | Number of results (default 10, max 100) |
type | str | ”auto”, “neural”, “fast”, or “deep” |
category | str | Data category filter |
include_domains | list | Domains to include |
exclude_domains | list | Domains to exclude |
start_crawl_date | str | Only links crawled after this date |
end_crawl_date | str | Only links crawled before this date |
start_published_date | str | Only links published after this date |
end_published_date | str | Only links published before this date |
include_text | list | Strings that must be present |
exclude_text | list | Strings that must not be present |
Categories
Exa supports filtering by data categories:
| Category | Description |
|---|
company | Company websites |
research paper | Academic papers |
news | News articles |
linkedin profile | LinkedIn profiles |
github | GitHub repositories |
tweet | Twitter/X posts |
movie | Movie information |
song | Music information |
personal site | Personal websites |
pdf | PDF documents |
financial report | Financial reports |
Deep Search
For comprehensive research, use deep search with additional queries:
from praisonaiagents import exa_search
results = exa_search(
query="blog post about AI",
type="deep",
additional_queries=["AI blogpost", "machine learning blogs"],
num_results=10
)
Structured Summaries
Get structured data from search results:
from praisonaiagents import ExaTools
tools = ExaTools()
company_schema = {
"type": "object",
"properties": {
"name": {"type": "string"},
"industry": {"type": "string"},
"founded_year": {"type": "number"},
"key_products": {"type": "array", "items": {"type": "string"}}
},
"required": ["name", "industry"]
}
results = tools.search_and_contents(
query="OpenAI company information",
summary={"schema": company_schema},
category="company",
num_results=3
)
# Parse structured summary
import json
for r in results.get("results", []):
if r.get("summary"):
data = json.loads(r["summary"])
print(f"Company: {data.get('name')}")
print(f"Industry: {data.get('industry')}")
Key Points
- Neural search: AI-powered semantic understanding of queries
- Environment variable: Set
EXA_API_KEY before running
- Categories: Filter results by data type for cleaner results
- Deep search: Use additional queries for comprehensive research
- Structured output: Get JSON-formatted summaries with schemas