Integrate LlamaIndex with Airweave for Data Search
Search and retrieve synced Airweave collections from a LlamaIndex agent via one tool spec.
Why it matters
Connect your LlamaIndex agent to Airweave, an open-source platform, to make any application searchable by syncing data from various sources with minimal configuration.
Outcomes
What it gets done
Sync data from diverse sources into Airweave for searchability.
Enable LlamaIndex agents to query Airweave collections using natural language.
Perform simple and advanced searches within Airweave collections.
Retrieve and generate answers from your synced organizational data.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-tool-tools-airweave | bash Overview
LlamaIndex Tools Integration: Airweave
A LlamaIndex tool spec that exposes Airweave's collection search as agent tools, covering simple search, advanced retrieval tuning, RAG-style answer generation, and collection listing. Use when a LlamaIndex agent needs to query data already synced into Airweave collections from connected apps.
What it does
The Airweave LlamaIndex Tool connects a LlamaIndex agent to Airweave, an open-source platform that makes data from many source apps searchable by syncing it into collections with minimal configuration. The AirweaveToolSpec exposes Airweave's collection search directly as LlamaIndex agent tools, so an agent can query synced organizational data without a custom retrieval layer.
The spec provides five tools. search_collection runs a simple search against a collection with default settings for the most common lookup case, taking a collection_id and query plus optional limit/offset for pagination. advanced_search_collection exposes full retrieval control: a retrieval_strategy of hybrid, neural, or keyword, a temporal_relevance weight (0.0-1.0) to favor recent content, expand_query to generate query variations, interpret_filters to extract filters from natural language, rerank for LLM-based reranking, and generate_answer to produce a direct answer alongside matched documents; it returns a dictionary with a documents list and an optional answer field. search_and_generate_answer is a RAG-style convenience method that searches and returns a natural language answer string directly, with an optional use_reranking flag (default True). list_collections enumerates all collections in the organization with skip/limit pagination, and get_collection_info returns details for one collection by collection_id.
When to use - and when NOT to
Use it when a LlamaIndex agent needs to answer questions grounded in data already synced into Airweave collections from external apps, or when you want a single search interface across multiple connected sources instead of building bespoke connectors per source. Use advanced_search_collection specifically when you need control over retrieval strategy, recency weighting, or LLM reranking rather than a default search. Do not use it to sync new data sources into Airweave itself - this tool only searches collections that are already set up and populated in an Airweave account; source connection and syncing happen on the Airweave side.
Capabilities
Five tools cover the full search surface: search_collection (simple default search), advanced_search_collection (hybrid/neural/keyword retrieval strategy, temporal relevance weighting, query expansion, natural-language filter interpretation, LLM reranking, answer generation), search_and_generate_answer (direct RAG-style answer string), list_collections (enumerate collections with pagination), and get_collection_info (fetch metadata for one collection). The tools can also be called directly without an agent as a plain Python client.
How to install
pip install llama-index-tools-airweave llama-index-llms-openai
Requires an Airweave account, an API key, and at least one collection already set up with synced data.
Who it's for
Developers building LlamaIndex agents that need to answer questions over an organization's internal data - finance reports, support tickets, product docs, or any other source already synced into an Airweave collection - without writing custom retrieval code for each data source.
Source README
LlamaIndex Tools Integration: Airweave
This tool connects your LlamaIndex agent to Airweave, an open-source platform that makes any app searchable by syncing data from various sources with minimal configuration.
Installation
pip install llama-index-tools-airweave llama-index-llms-openai
Prerequisites
- An Airweave account and API key
- At least one collection set up with synced data
Get started at Airweave
Usage
Basic Usage
import os
import asyncio
from llama_index.tools.airweave import AirweaveToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
### Initialize the Airweave tool
airweave_tool = AirweaveToolSpec(
api_key=os.environ["AIRWEAVE_API_KEY"],
)
### Create an agent with the Airweave tools
agent = FunctionAgent(
tools=airweave_tool.to_tool_list(),
llm=OpenAI(model="gpt-4o-mini"),
system_prompt="""You are a helpful assistant that can search through
Airweave collections to answer questions about your organization's data.""",
)
### Use the agent to search your data
async def main():
response = await agent.run(
"Search the finance-data collection for Q4 revenue reports"
)
print(response)
if __name__ == "__main__":
asyncio.run(main())
Available Tools
search_collection
Simple search in a collection with default settings (most common use case).
Parameters:
collection_id(str): The readable ID of the collectionquery(str): Your search querylimit(int, optional): Max results to return (default: 10)offset(int, optional): Pagination offset (default: 0)
advanced_search_collection
Advanced search with full control over retrieval parameters.
Parameters:
collection_id(str): The readable ID of the collectionquery(str): Your search querylimit(int, optional): Max results to return (default: 10)offset(int, optional): Pagination offset (default: 0)retrieval_strategy(str, optional): "hybrid", "neural", or "keyword"temporal_relevance(float, optional): Weight recent content (0.0-1.0)expand_query(bool, optional): Generate query variationsinterpret_filters(bool, optional): Extract filters from natural languagererank(bool, optional): Use LLM-based rerankinggenerate_answer(bool, optional): Generate natural language answer
Returns:
Dictionary with documents list and optional answer field.
search_and_generate_answer
Convenience method that searches and returns a direct natural language answer (RAG-style).
Parameters:
collection_id(str): The readable ID of the collectionquery(str): Your question in natural languagelimit(int, optional): Max results to consider (default: 10)use_reranking(bool, optional): Use reranking (default: True)
Returns:
Natural language answer string.
list_collections
List all collections in your organization.
Parameters:
skip(int, optional): Pagination skip (default: 0)limit(int, optional): Max collections to return (default: 100)
get_collection_info
Get detailed information about a specific collection.
Parameters:
collection_id(str): The readable ID of the collection
Advanced Examples
Direct Tool Usage
You can use the tools directly without an agent:
from llama_index.tools.airweave import AirweaveToolSpec
airweave_tool = AirweaveToolSpec(api_key="your-key")
### List collections
collections = airweave_tool.list_collections()
print(f"Found {len(collections)} collections")
### Simple search
results = airweave_tool.search_collection(
collection_id="finance-data", query="Q4 revenue reports", limit=5
)
for doc in results:
print(f"Score: {doc.metadata.get('score', 'N/A')}")
print(f"Text: {doc.text[:200]}...")
Advanced Search Options
#### Advanced search with all options
result = airwea
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.