Skip to main content

llama-index tools vectara query integration

Project description

Vectara Query Tool

This tool connects to a Vectara corpus and allows agents to make semantic search or retrieval augmented generation (RAG) queries.

Usage

Please note that this usage example relies on version >=0.3.0.

This tool has a more extensive example usage documented in a Jupyter notebok here

To use this tool, you'll need a Vectara account (If you don't have an account, you can create one here) and the following information in your environment:

  • VECTARA_CORPUS_KEY: The corpus key for the Vectara corpus that you want your tool to search for information. If you need help creating a corpus with your data, follow this Quick Start guide.
  • VECTARA_API_KEY: An API key that can perform queries on this corpus.

Here's an example usage of the VectaraQueryToolSpec.

from llama_index.tools.vectara_query import VectaraQueryToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI

# Connecting to a Vectara corpus about Electric Vehicles
tool_spec = VectaraQueryToolSpec()

agent = FunctionAgent(
    tools=tool_spec.to_tool_list(),
    llm=OpenAI(model="gpt-4.1"),
)

print(await agent.run("What are the different types of electric vehicles?"))

The available tools are:

semantic_search: A tool that accepts a query and uses semantic search to obtain the top search results.

rag_query: A tool that accepts a query and uses RAG to obtain a generative response grounded in the search results.

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

llama_index_tools_vectara_query-0.4.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file llama_index_tools_vectara_query-0.4.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_tools_vectara_query-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0e7119a77bd09cad66119aab3b1024c17b6b804be61d592ad5eceb6196d1c728
MD5 a1723ff9d924e4a8a714564af4af6816
BLAKE2b-256 9403a0240097b23fde03adb0a5639626e02e47c7865b1065b426570610497615

See more details on using hashes here.

File details

Details for the file llama_index_tools_vectara_query-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_tools_vectara_query-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8aa92bf3f9f884e85e63f0e5821ab68b515e127dcbf2cc6f4f2863d36f06519f
MD5 bffa1e9e994c07040c36187c04a30bc7
BLAKE2b-256 8083918c3749695732415a24820c68d1b7d9e8881ac08c7579404061045c7c40

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