Skip to content

Commit

Permalink
docs: update agents docs (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
philipbalbas authored Apr 19, 2024
1 parent 7000518 commit 0867a49
Show file tree
Hide file tree
Showing 15 changed files with 136 additions and 383 deletions.
5 changes: 2 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ layout:
{% hint style="success" %}
Julep is a platform for building AI agents that have memory and can plan and execute tasks. It is:

* Backed by [S1](broken-reference), our model that's optimized for agentic tasks
* [Open source](https://github.com/julep-ai/agents) (coming soon)
* [Open source](https://github.com/julep-ai/julep)
{% endhint %}

<table data-column-title-hidden data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-hidden data-card-target data-type="content-ref">Link 1</th></tr></thead><tbody><tr><td><h3><mark style="color:blue;">I'm just curious...</mark></h3></td><td>Read more about the <a href="introduction/julep-in-a-nutshell.md">Julep Platform</a> and <a href="README (1).md">why we are building it</a>.</td><td><a href="introduction/julep-in-a-nutshell.md">julep-in-a-nutshell.md</a></td></tr><tr><td><h3><mark style="color:green;">I want to learn more.</mark></h3></td><td>Learn <a href="introduction/core-concepts.md">core concepts</a> behind the Julep Platform.</td><td><a href="introduction/core-concepts.md">core-concepts.md</a></td></tr><tr><td><h3><mark style="color:purple;">I'm in, let's go!</mark></h3></td><td>Get started building your <a href="broken-reference">first agent</a>.</td><td><a href="getting-started/agents-quickstart.md">agents-quickstart.md</a></td></tr><tr><td><h3><mark style="color:orange;">Learn more about Agents</mark></h3></td><td>Read the <a href="agents/overview.md">Agents Overview</a> or follow the <a href="agents/tutorial.md">Tutorial</a>.</td><td><a href="agents/overview.md">overview.md</a></td></tr><tr><td><h3><mark style="color:green;">Explore S1</mark></h3></td><td>Read more <a href="s1-model/overview.md">about our model</a> or <a href="s1-model/tutorial.md">learn how to use it</a>.</td><td><a href="s1-model/overview.md">overview.md</a></td></tr><tr><td><h3><mark style="color:red;">I'm stuck. Need help!</mark></h3></td><td>Get help on our <a href="https://discord.gg/RdaGyrzpC8">discord community</a>, create a <a href="https://github.com/julep-ai/platform">Github issue</a> or <a href="faqs/technical-details.md">check out FAQs</a>.</td><td><a href="https://discord.gg/RdaGyrzpC8">https://discord.gg/RdaGyrzpC8</a></td></tr><tr><td><h3>SDKs</h3></td><td></td><td><a href="sdks/available-sdks.md">available-sdks.md</a></td></tr><tr><td><h3>FAQs</h3></td><td></td><td><a href="faqs/general-overview.md">general-overview.md</a></td></tr><tr><td><h3>API Reference</h3></td><td></td><td><a href="api-reference/agents-api/">agents-api</a></td></tr></tbody></table>
<table data-column-title-hidden data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-hidden data-card-target data-type="content-ref">Link 1</th></tr></thead><tbody><tr><td><h3><mark style="color:blue;">I'm just curious...</mark></h3></td><td>Read more about the <a href="introduction/julep-in-a-nutshell.md">Julep Platform</a> and <a href="README (1).md">why we are building it</a>.</td><td><a href="introduction/julep-in-a-nutshell.md">julep-in-a-nutshell.md</a></td></tr><tr><td><h3><mark style="color:green;">I want to learn more.</mark></h3></td><td>Learn <a href="introduction/core-concepts.md">core concepts</a> behind the Julep Platform.</td><td><a href="introduction/core-concepts.md">core-concepts.md</a></td></tr><tr><td><h3><mark style="color:purple;">I'm in, let's go!</mark></h3></td><td>Get started building your <a href="broken-reference">first agent</a>.</td><td><a href="getting-started/agents-quickstart.md">agents-quickstart.md</a></td></tr><tr><td><h3><mark style="color:orange;">Learn more about Agents</mark></h3></td><td>Read the <a href="agents/overview.md">Agents Overview</a> or follow the <a href="agents/tutorial.md">Tutorial</a>.</td><td><a href="agents/overview.md">overview.md</a></td></tr><tr><td><h3><mark style="color:green;">API Reference</mark></h3></td><td>Read more about our model or learn how to use it.</td><td><a href="api-reference/agents-api/README.md">overview.md</a></td></tr><tr><td><h3><mark style="color:red;">I'm stuck. Need help!</mark></h3></td><td>Get help on our <a href="https://discord.gg/RdaGyrzpC8">discord community</a>, create a <a href="https://github.com/julep-ai/platform">Github issue</a> or <a href="faqs/technical-details.md">check out FAQs</a>.</td><td><a href="https://discord.gg/RdaGyrzpC8">https://discord.gg/RdaGyrzpC8</a></td></tr><tr><td><h3>SDKs</h3></td><td></td><td><a href="sdks/available-sdks.md">available-sdks.md</a></td></tr><tr><td><h3>FAQs</h3></td><td></td><td><a href="faqs/general-overview.md">general-overview.md</a></td></tr><tr><td><h3>API Reference</h3></td><td></td><td><a href="api-reference/agents-api/">agents-api</a></td></tr></tbody></table>
30 changes: 2 additions & 28 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
* [Welcome to Julep](README.md)
* [Julep in a nutshell](introduction/julep-in-a-nutshell.md)
* [Motivation](<README (1).md>)
* [Core Concepts](introduction/core-concepts.md)

## 🚀 Getting Started

* [Agents Quickstart](getting-started/agents-quickstart.md)
* [Model Quickstart](getting-started/python-setup.md)

## 🤖 Agents (alpha) <a href="#agents" id="agents"></a>

Expand All @@ -19,20 +14,7 @@
* [Self-hosting](agents/self-hosting.md)
* [Example: Jessica](agents/jessica.md)

## 💁 S1 Model

* [Overview](s1-model/overview.md)
* [Tutorial](s1-model/tutorial.md)
* [Concepts](s1-model/context-sections.md)
* [Capabilities](s1-model/capabilities/README.md)
* [Human-like conversations](s1-model/capabilities/capabilities.md)

## 🧪 Agent Studio

* [Model Playground](agent-studio/playground.md)
* [Agents Playground](agent-studio/agents-playground.md)

## 🛠️ SDKs
## 📖 API REFERENCE

* [Python SDK](python-sdk-docs/README.md)
* [Client](python-sdk-docs/julep/client.md)
Expand All @@ -52,26 +34,18 @@
* [Session](js-sdk-docs/classes/managers_session.SessionsManager.md)
* [Tool](js-sdk-docs/classes/managers_tool.ToolsManager.md)
* [User](js-sdk-docs/classes/managers_user.UsersManager.md)

## 📖 API REFERENCE

* [Agents API (alpha)](api-reference/agents-api/README.md)
* [Agents API](api-reference/agents-api/README.md)
* [Agents](api-reference/agents-api/agents-api.md)
* [Users](api-reference/agents-api/agents-api-1.md)
* [Sessions](api-reference/agents-api/agents-api-2.md)
* [Memories](api-reference/agents-api/agents-api-3.md)
* [Docs](api-reference/agents-api/agents-api-4.md)
* [Tasks](api-reference/agents-api/agents-api-5.md)
* [Task Runs](api-reference/agents-api/agents-api-6.md)
* [Model API](api-reference/model-api.md)
* [Chat Completions](api-reference/model-api/model-api.md)
* [Completions (Advanced)](api-reference/model-api/model-api-1.md)
* [Generation Parameters](api-reference/model-api/generation-parameters.md)

## 🔍 FAQs

* [General Questions](faqs/general-overview.md)
* [Agent Studio](faqs/agent-prototyping.md)
* [Memory and Learning](faqs/memory-and-learning.md)
* [Sessions and Tasks](faqs/sessions-and-tasks.md)
* [Technical Details](faqs/technical-details.md)
Expand Down
9 changes: 1 addition & 8 deletions docs/agents/jessica.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
description: Jessica
---

# Jessica Playground

## What is Jessica

<figure><img src="../.gitbook/assets/jessica.png" alt="Jessica page"><figcaption></figcaption></figure>

<figure><img src="../.gitbook/assets/jessica-prompt.png" alt="Jessica prompt"><figcaption></figcaption></figure>

Jessica is an example agent that uses the Julep Agents API that you can access at [https://jessica.julep.ai](https://jessica.julep.ai).

The playground is also open source which you can access [here](https://github.com/julep-ai/jessica-public).

## How to run and deploy
Jessica is a satirical AI agent we designed using the Julep API for testing interactions. You can easily test and deploy Jessica or any custom-designed agent on the by visiting [this repo](https://github.com/julep-ai/jessica-public)

To run your own agent using this playground, you simply need to modify the `.env` file and add the following variables.

Expand Down
109 changes: 41 additions & 68 deletions docs/agents/tutorial.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Tutorial

{% hint style="info" %}
**Coming soon.**
{% endhint %}

### Loom Demo

(Step by step code follows)

{% embed url="https://www.loom.com/share/9d303e8ad1714c19a20afede05cdc7d3?sid=b5600ea5-583d-498e-8917-f2b35ca38a3c" %}
{% embed url="https://www.loom.com/share/79646b058235467fb9042d242ce0d7a4?sid=86d9da76-87e5-4bf9-a2a8-0e9ee1c59f1c" %}

***

Expand All @@ -21,16 +17,21 @@
### Install SDK

```bash
# Install the julep sdk (inside a virtualenv)
pip install julep
```

### Setup

```python
from julep import Client # or AsyncClient
from julep import Client
from pprint import pprint
import textwrap
import os

base_url = os.environ.get("JULEP_API_URL")
api_key = os.environ.get("JULEP_API_KEY")

client = Client(api_key="<YOUR JULEP API KEY>"
client = Client(api_key=api_key, base_url=base_url)
```

### Creating an Agent
Expand Down Expand Up @@ -71,77 +72,49 @@ agent = client.agents.create(
```
{% endcode %}

### Creating a task

This agent is supposed to follow this plan:

1. Think about the task and make a plan using the tools:
* Given a topic, search the web for it,
* Then summarize it,
* And then send the result to a webhook.
2. Think about step 1. And make a tool\_call to search the web for the topic with a detailed query
3. Think about step 2. And then summarize the results received.
4. Think about step 3. And make a tool call to the webhook
### Creating a user

{% code overflow="wrap" %}
```python
# Let's create a task for this agent.
instructions = [
"Consider the research topic and devise a search strategy using the provided tools.",
"Use the 'search' tool to find comprehensive information on the topic from various web sources.",
"Analyze the search results and create a concise summary highlighting the key points.",
"Send the summary and the detailed search results to the specified webhook endpoint for integration into our system.",
]

task = client.tasks.create(
agent_id=agent.id,
instructions=instructions,
inputs={"topic": {"type": "string", "description": "Topic to research"}},
about = """
Average nerdy techbro/girl who spends 8 hours a day in front of a laptop.
Thinks they can build a small SaaS tool and gain financial independence within the year.
"""
user = client.users.create(
name="Anon",
about=about,
)
```
{% endcode %}

### Creating a Task Run
### Putting it all together in a "session"

```python
# Ask the agent to run this task
run = client.runs.create(
agent_id=agent.id, task_id=task.id, inputs={"topic": "Sam Altman"}
)
A "user" and an "agent" communicate in a "session". System prompt goes here.

Conversation history and summary are stored in a "session" which saves the conversation history.

for step in run.execution_steps():
print("Step Result: ", step.messages)
print("---")
print()
The session paradigm allows for; many users to interact with one agent and allow separation of conversation history and memories.

```python
situation_prompt = """You are Jessica. You're a stuck up Cali teenager.
You basically complain about everything. You live in Bel-Air, Los Angeles and drag yourself to Curtis High School when you must.
You don't like basic broke-ass bitches like those who own an Android or don't bring their Mercedes to school.
You're surrounded by fucking retards and annoying 'well-meaning' people who don't understand your vibe.
You're simply better and classier than the dumbasses you are surrounded by.
Recent Tweets
1. 'my step mom is so fake and nice all the time? she's not even rich wtf. why tf did my dad marry her. #brokebitch'
2. 'am i the only one who thinks jordan belfort was a good guy??? he's so cute like..''
3. 'if your butler doesn't know the difference soda and Perrier don't even fkng talk to me'
Here, you are hanging out in a Discord Server called Julep AI to troll these nerdy losers.
"""

session = client.sessions.create(
user_id=user.id, agent_id=agent.id, situation=situation_prompt
)
```

{% code title="Script Output:" overflow="wrap" fullWidth="true" %}
```yaml
Step Result: Starting the research on Sam Altman. I'll begin by gathering information from various sources on the web.
---
### Run the tutorial in Deepnote

Step Result:
---

Step Result: Found numerous articles, interviews, and resources on Sam Altman, including his role at OpenAI, investments, and insights into technology and entrepreneurship.
---

Step Result: Need to summarize this information to capture the essence of Sam Altman's impact.
---

Step Result: Summary:
Sam Altman, known for his leadership at OpenAI, has been a pivotal figure in the tech industry, driving innovation and supporting startups. His insights on entrepreneurship and the future of AI have influenced a wide audience.
---

Step Result: Now, I'll send the compiled summary and details to the webhook.
---

Step Result:
---

Step Result: Delivered data to webhook
---
```
{% endcode %}
Run Jessica or your own agent using Deepnote [here](https://deepnote.com/app/julep-ai-761c/Julep-Mixers-4dfff09a-84f2-4278-baa3-d1a00b88ba26)
2 changes: 1 addition & 1 deletion docs/api-reference/agents-api/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Agents API (alpha)
# Agents API

[![Run In Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/33213061-a0a1e3a9-9681-44ae-a5c2-703912b32336?action=collection%2Ffork\&source=rip\_markdown\&collection-url=entityId%3D33213061-a0a1e3a9-9681-44ae-a5c2-703912b32336%26entityType%3Dcollection%26workspaceId%3D183380b4-f2ac-44ef-b018-1f65dfc8256b)

Expand Down
13 changes: 7 additions & 6 deletions docs/api-reference/agents-api/agents-api-4.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,35 @@ description: API for creating and modifying docs

## Get all docs (for an agent or user)

{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/agents/{agent_id}/additional_info" method="get" %}
{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/agents/{agent_id}/docs" method="get" %}
[agents-openapi.yaml](../../.gitbook/assets/agents-openapi.yaml)
{% endswagger %}

{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/users/{user_id}/additional_info" method="get" %}
{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/users/{user_id}/docs" method="get" %}
[agents-openapi.yaml](../../.gitbook/assets/agents-openapi.yaml)
{% endswagger %}

***

## Create a new doc (for agent or user)

{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/agents/{agent_id}/additional_info" method="post" %}
{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/agents/{agent_id}/docs" method="post" %}
[agents-openapi.yaml](../../.gitbook/assets/agents-openapi.yaml)
{% endswagger %}

{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/users/{user_id}/additional_info" method="post" %}
{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/users/{user_id}/docs" method="post" %}
[agents-openapi.yaml](../../.gitbook/assets/agents-openapi.yaml)
{% endswagger %}

***

## Delete a doc by id

{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/agents/{agent_id}/additional_info/{additional_info_id}" method="delete" %}
{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/agents/{agent_id}/docs/{doc_id}" method="delete" %}
[agents-openapi.yaml](../../.gitbook/assets/agents-openapi.yaml)
{% endswagger %}

{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/users/{user_id}/additional_info/{additional_info_id}" method="delete" %}
{% swagger src="../../.gitbook/assets/agents-openapi.yaml" path="/users/{user_id}/docs/{doc_id}" method="delete" %}

[agents-openapi.yaml](../../.gitbook/assets/agents-openapi.yaml)
{% endswagger %}
Loading

0 comments on commit 0867a49

Please sign in to comment.