Skip to main content

AI Search Framework powered by Tavily — build AI agents with real-time web search

Project description

Aviora

AI Search Framework powered by Tavily
Build AI agents and RAG pipelines with real-time web search in minutes.

PyPI Downloads Python versions License


Why Aviora?

  • Real-time web search — powered by Tavily's AI-optimized search index
  • Sync & async — native async/await support for every method
  • RAG-readyget_search_context() returns a clean text blob for LLM context windows
  • Q&A searchqna_search() returns a single direct answer string
  • Extract & crawl — pull clean content from any URL or entire websites
  • Typed — full TypedDict return types for IDE autocompletion
  • Simple error handlingAvioraAuthError, AvioraRateLimitError

Installation

pip install aviora

Get a free Tavily API key at tavily.com.


Quick Start

from aviora import Aviora

client = Aviora(api_key="tvly-xxxx")

results = client.search("Latest AI news")

for r in results:
    print(r["title"], r["url"])

All Features

Standard Search

results = client.search(
    "OpenAI GPT-5 release date",
    max_results=10,
    search_depth="advanced",    # "basic" | "advanced"
    topic="general",             # "general" | "news"
    include_domains=["techcrunch.com", "wired.com"],
    exclude_domains=["reddit.com"],
)

for r in results:
    print(r["title"])   # page title
    print(r["url"])     # source URL
    print(r["content"]) # relevant snippet
    print(r["score"])   # relevance score (0–1)

Direct Q&A

Get a single-sentence answer instead of a list of links:

answer = client.qna_search("Who is the CEO of OpenAI?")
print(answer)  # "Sam Altman"

RAG Context

Get a clean text blob ready to drop straight into an LLM prompt:

context = client.get_search_context(
    "Explain transformer attention mechanisms",
    max_tokens=4000,
)

prompt = f"Answer the question using this context:\n\n{context}\n\nQuestion: ..."

Extract Content from URLs

results = client.extract(["https://openai.com/blog/gpt-4"])

for r in results:
    print(r["url"])
    print(r["raw_content"])

Crawl a Website

pages = client.crawl(
    "https://docs.python.org",
    max_depth=2,
    max_breadth=10,
    limit=50,
)

Map a Website

urls = client.map("https://docs.python.org")
print(urls)  # ["https://docs.python.org/3/", ...]

Async Support

Every method has an async_ counterpart, perfect for use inside FastAPI, LangChain agents, or any async framework:

import asyncio
from aviora import Aviora

client = Aviora(api_key="tvly-xxxx")

async def main():
    # Run multiple searches concurrently
    results, answer, context = await asyncio.gather(
        client.async_search("AI news today"),
        client.async_qna_search("What is LangGraph?"),
        client.async_get_search_context("RAG pipeline best practices"),
    )
    print(results)
    print(answer)
    print(context)

asyncio.run(main())

Error Handling

from aviora import Aviora, AvioraAuthError, AvioraRateLimitError, AvioraError

client = Aviora(api_key="tvly-xxxx")

try:
    results = client.search("AI news")
except AvioraAuthError:
    print("Invalid API key")
except AvioraRateLimitError:
    print("Rate limit hit — upgrade at tavily.com")
except AvioraError as e:
    print(f"Search failed: {e}")

Use with LangChain / LLM Agents

Aviora's get_search_context and qna_search methods integrate naturally into any LLM agent:

from aviora import Aviora

client = Aviora(api_key="tvly-xxxx")

def search_tool(query: str) -> str:
    """Tool used by an LLM agent to search the web."""
    return client.get_search_context(query, max_tokens=2000)

API Reference

Method Description
search(query, ...) Web search → list[SearchResult]
qna_search(query) Direct answer → str
get_search_context(query, max_tokens) RAG context → str
extract(urls) Extract page content → list[ExtractResult]
crawl(url, ...) Crawl a site → list[dict]
map(url) Discover site URLs → list[str]
async_search(...) Async version of search
async_qna_search(...) Async version of qna_search
async_get_search_context(...) Async version of get_search_context
async_extract(...) Async version of extract

License

MIT © Syed Faisal

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aviora-0.2.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aviora-0.2.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file aviora-0.2.0.tar.gz.

File metadata

  • Download URL: aviora-0.2.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for aviora-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0389969a02d1f7e029cdfaed5e3f1c06fe4f6965c4acb2dc2711101c73d7d11d
MD5 9dfe9c928c5a567cff821ba323f5a6ec
BLAKE2b-256 bd4a57431f0968af0c5270e29d0cef85ef356b17a7179fc4367229a4e01f6ddb

See more details on using hashes here.

File details

Details for the file aviora-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aviora-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for aviora-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cbec6e907503657c1e3f6e35a7e926b5b26ace784e27b1988743da129c057a9c
MD5 45b848fed5579b3d1a9f16821f01f716
BLAKE2b-256 13ab470d550d140abb7cb07caaad8c033367ec82a8b8a11854b487a0f8287f6d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page