You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This user guide goes over the basic concepts of Agility and includes an example of how to create an Agility assistant.
14
-
15
-
Cleanlab Agility is an end-to-end API that allows you to create trustworthy AI applications. The API allows you to build reliable RAG systems by ingesting data from a wide variety of sources into Knowledge Bases and by creating AI Assistants that can respond to user queries while accessing the relevant data and providing reliable, interpretable answers.
16
-
17
-
## Concepts
18
-
19
-
### Knowledge Bases
20
-
21
-
-**Knowledge Bases** -
22
-
-**Sources** -
23
-
-**Documents** -
24
-
25
-
### Assistants
26
-
27
-
-**Assistant** - An AI Assistant that will respond to user queries, while referencing user-supplied data sources and instructions.
28
-
-**Threads -** A conversation session between a user and Assistant. Threads store Messages and retrieve context from Knowledge Bases to provide trustworthy results
29
-
-**Messages -** A message created by a user or Assistant. Messages are represented as text and are attached to a parent Thread
30
-
-**Runs -** Invokes the Assistant for a specific Thread. It uses the configuration for the Assistant as part of the context, including the data sources from its Knowledge Base and provided instructions. A Run will add Messages to the Thread
31
-
32
-
33
-
# Quick Start
34
-
35
-
## Step 0: Initialize python client
36
-
37
-
```python
38
-
from agility import Agility
39
-
40
-
api_key ="your_agility_api_key"
41
-
42
-
client = Agility(api_key=api_key)
43
-
```
44
-
45
-
## Step 1: Create a Knowledge Base
46
-
47
-
```python
48
-
knowledge_base = client.knowledge_bases.create(
49
-
name="Cleanlab docs",
50
-
description="Developer-facing docs for using Cleanlab",
## ?? Step x: figure out if there are any other necessary actions related to sources and documents, such as source syncing
80
-
81
-
## Step 3: Create an Assistant
82
-
83
-
```python
84
-
assistant = client.assistants.create(
85
-
knowledge_base_id=knowledge_base.id,
86
-
name="Chat with Cleanlab Docs",
87
-
description="Chat with Cleanlab Docs for Studio and TLM",
88
-
)
89
-
```
90
-
91
-
## Step 4: Create a Thread
92
-
93
-
```python
94
-
thread = client.threads.create()
95
-
```
96
-
97
-
## Step 5: Add a Message to a Thread
98
-
99
-
```python
100
-
message = client.threads.messages.create(
101
-
thread_id=thread.id,
102
-
role="user",
103
-
content="I need to run TLM in batch-mode on a large number of datapoints. Can you help me?",
104
-
)
105
-
```
106
-
107
-
## Step 6: Create a Run
108
-
109
-
```python
110
-
run = client.threads.runs.create(
111
-
thread_id=thread.id,
112
-
assistant_id=assistant.id,
113
-
)
114
-
```
11
+
See the [user guide](https://www.notion.so/cleanlab/Agility-User-Guide-11ec7fee85be80669ed2f052cd786bac) and [quickstart](https://github.com/cleanlab/sandbox-cleanlab-studio/blob/main/agility_quickstart.ipynb) for more on how to use Agility.
0 commit comments