Skip to main content

No project description provided

Project description

Relevance AI - The home of your AI Workforce

🔥 Use Relevance to build AI agents for your AI workforce

Sign up for a free account ->

🧠 Documentation

Type Link
Home Page Home Page
Platform Platform
Developer Documentation Documentation

Relevance AI SDK

Welcome to the Relevance AI SDK! This guide will help you set up and start using the SDK to interact with your AI agents, tools, and knowledge.

Installation

To get started, you'll need to install the RelevanceAI library in a Python 3 environment. Run the following command in your terminal:

pip install relevanceai

Create an Account

Before using the SDK, ensure you have an account with Relevance AI.

  1. Sign up for a free account at Relevance AI and log in.
  2. Create a new secret key at SDK Login. Scroll to the bottom of the integrations page, click on "+ Create new secret key," and select "Admin" permissions.

Set Up Your Client

To interact with Relevance AI, you'll need to set up a client. Start by importing the library:

from relevanceai import RelevanceAI
client = RelevanceAI()

Validate Client Credentials

You can validate your client credentials by storing them as environment variables and loading them into your project using python-dotenv or the os library:

RAI_API_KEY=
RAI_REGION=
RAI_PROJECT=
from dotenv import load_dotenv
load_dotenv()

from relevanceai import RelevanceAI
client = RelevanceAI()

Alternatively, pass the credentials directly to the client:

from relevanceai import RelevanceAI
client = RelevanceAI(
    api_key="your_api_key", 
    region="your_region", 
    project="your_project"
)

You are now ready to start using Relevance AI via the Python SDK.

Quickstart

Using Agents & Tasks

List all the agents in your project:

from relevanceai import RelevanceAI
client = RelevanceAI()

agents = client.agents.list_agents()
print(agents)
# Example output: [Agent(agent_id="xxxxxxxx", name="Sales Qualifier"), ...]

Retrieve and interact with a specific agent:

my_agent = client.agents.retrieve_agent(agent_id="xxxxxxxx")

message = "Let's qualify this lead:\n\nName: Ethan Trang\n\nCompany: Relevance AI\n\nEmail: ethan@relevanceai.com"

# Trigger a task with the agent
task = my_agent.trigger_task(message=message)
print(f"Task started with ID: {task.conversation_id}")

# View task progress
steps = my_agent.view_task_steps(conversation_id=task.conversation_id)

Using Tools

List all the tools in your project:

tools = client.tools.list_tools()
print(tools)
# Example output: [Tool(tool_id="xxxxxxxx", title="Search Website"), ...]

Retrieve and interact with a specific tool:

my_tool = client.tools.retrieve_tool(tool_id="xxxxxxxx")

# Check tool parameters schema
params_schema = my_tool.get_params_schema()

# Trigger the tool
result = my_tool.trigger(params={"search_query": "AI automation"})

Managing Knowledge Sets

Work with knowledge sets to store and retrieve data:

# List knowledge sets
knowledge_sets = client.knowledge.list_knowledge()

# Retrieve data from a knowledge set
data = client.knowledge.retrieve_knowledge(knowledge_set="my_dataset")

Managing Tasks

Track and manage ongoing tasks:

# Get task metadata
metadata = client.tasks.get_metadata(conversation_id="xxxxxxxx")

# Delete a completed task
client.tasks.delete_task(conversation_id="xxxxxxxx")

Explore More

Explore all the methods available for agents, tasks, tools, and knowledge with the documentation

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

relevanceai-10.2.2.tar.gz (44.4 kB view details)

Uploaded Source

Built Distribution

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

relevanceai-10.2.2-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file relevanceai-10.2.2.tar.gz.

File metadata

  • Download URL: relevanceai-10.2.2.tar.gz
  • Upload date:
  • Size: 44.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for relevanceai-10.2.2.tar.gz
Algorithm Hash digest
SHA256 3a872f74200e759d17979f365723042151d1040986dde567ba740fe77a02641b
MD5 631d76e03f0f0ed9a3382d215d2081ad
BLAKE2b-256 f1f79bdb3ddebf9dd7e907310b204224ac0a0d7ed6771d225a9db3038576e97d

See more details on using hashes here.

File details

Details for the file relevanceai-10.2.2-py3-none-any.whl.

File metadata

  • Download URL: relevanceai-10.2.2-py3-none-any.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for relevanceai-10.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 db7e32e7cde98ee181ef179948f5f5bae1e0bd3ff0cff11e777286d4f3efd933
MD5 8bfe7899e689a3abf9df8c968925544e
BLAKE2b-256 12de282e3dfe3d13e68a6d2d8ad77221303708d00d70c08c1ae90e9849b63a3a

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