README
English | δΈζηΏ»θ― | ζ₯ζ¬θͺ翻訳
Explore Docs Β· Discord Β· π Β· LinkedIn
[!NOTE] π¨βπ» Here for the devfest.ai event? Join our Discord and check out the details below.
Introduction
Julep is a platform for creating AI agents that remember past interactions and can perform complex tasks. It offers long-term memory and manages multi-step processes.
Julep enables the creation of multi-step tasks incorporating decision-making, loops, parallel processing, and integration with numerous external tools and APIs.
While many AI applications are limited to simple, linear chains of prompts and API calls with minimal branching, Julep is built to handle more complex scenarios.
It supports:
Intricate, multi-step processes
Dynamic decision-making
Parallel execution
[!TIP] Imagine you want to build an AI agent that can do more than just answer simple questionsβit needs to handle complex tasks, remember past interactions, and maybe even use other tools or APIs. That's where Julep comes in.
Quick Example
Imagine a Research AI agent that can do the following:
Take a topic,
Come up with 100 search queries for that topic,
Perform those web searches in parallel,
Summarize the results,
Send the summary to Discord
In Julep, this would be a single task under 80 lines of code and run fully managed all on its own. All of the steps are executed on Julep's own servers and you don't need to lift a finger. Here's a working example:
[!TIP] Julep is really useful when you want to build AI agents that can maintain context and state over long-term interactions. It's great for designing complex, multi-step workflows and integrating various tools and APIs directly into your agent's processes.
In this example, Julep will automatically manage parallel executions, retry failed steps, resend API requests, and keep the tasks running reliably until completion.
Key Features
π§ Persistent AI Agents: Remember context and information over long-term interactions.
πΎ Stateful Sessions: Keep track of past interactions for personalized responses.
π Multi-Step Tasks: Build complex, multi-step processes with loops and decision-making.
β³ Task Management: Handle long-running tasks that can run indefinitely.
π οΈ Built-in Tools: Use built-in tools and external APIs in your tasks.
π§ Self-Healing: Julep will automatically retry failed steps, resend messages, and generally keep your tasks running smoothly.
π RAG: Use Julep's document store to build a system for retrieving and using your own data.
Julep is ideal for applications that require AI use cases beyond simple prompt-response models.
Why Julep vs. LangChain?
Different Use Cases
Think of LangChain and Julep as tools with different focuses within the AI development stack.
LangChain is great for creating sequences of prompts and managing interactions with AI models. It has a large ecosystem with lots of pre-built integrations, which makes it convenient if you want to get something up and running quickly. LangChain fits well with simple use cases that involve a linear chain of prompts and API calls.
Julep, on the other hand, is more about building persistent AI agents that can remember things over long-term interactions. It shines when you need complex tasks that involve multiple steps, decision-making, and integration with various tools or APIs directly within the agent's process. It's designed from the ground up to manage persistent sessions and complex tasks.
Use Julep if you imagine building a complex AI assistant that needs to:
Keep track of user interactions over days or weeks.
Perform scheduled tasks, like sending daily summaries or monitoring data sources.
Make decisions based on prior interactions or stored data.
Interact with multiple external services as part of its task.
Then Julep provides the infrastructure to support all that without you having to build it from scratch.
Different Form Factor
Julep is a platform that includes a language for describing tasks, a server for running those tasks, and an SDK for interacting with the platform. To build something with Julep, you write a description of the task in YAML
, and then run the task in the cloud.
Julep is built for heavy-lifting, multi-step, and long-running tasks and there's no limit to how complex the task can be.
LangChain is a library that includes a few tools and a framework for building linear chains of prompts and tools. To build something with LangChain, you typically write Python code that configures and runs the model chains you want to use.
LangChain might be sufficient and quicker to implement for simple use cases that involve a linear chain of prompts and API calls.
In Summary
Use LangChain when you need to manage AI model interactions and prompt sequences in a stateless or short-term context.
Choose Julep when you need a robust framework for stateful agents with advanced task capabilities, persistent sessions, and complex task management.
Installation
To get started with Julep, install it using npm or pip:
or
[!NOTE] Get your API key here.
While we are in beta, you can also reach out on Discord to get rate limits lifted on your API key.
[!TIP] π» Are you a show me the code!β’ kind of person? We have created a ton of cookbooks for you to get started with. Check out the cookbooks to browse through examples.
π‘ There's also lots of ideas that you can build on top of Julep. Check out the list of ideas to get some inspiration.
Python Quick Start π
Step 1: Create an Agent
Step 2: Create a Task that generates a story and comic strip
Let's define a multi-step task to create a story and generate a paneled comic strip based on an input idea:
Step 3: Execute the Task
Step 4: Chat with the Agent
Start an interactive chat session with the agent:
[!TIP] You can find the full python example here.
Node.js Quick Start π©
Step 1: Create an Agent
Step 2: Create a Task that generates a story and comic strip
Step 3: Execute the Task
Step 4: Chat with the Agent
[!TIP] You can find the full Node.js example here.
Components
Julep is made up of the following components:
Julep Platform: The Julep platform is a cloud service that runs your workflows. It includes a language for describing workflows, a server for running those workflows, and an SDK for interacting with the platform.
Julep SDKs: Julep SDKs are a set of libraries for building workflows. There are SDKs for Python and JavaScript, with more on the way.
Julep API: The Julep API is a RESTful API that you can use to interact with the Julep platform.
Mental Model
Think of Julep as a platform that combines both client-side and server-side components to help you build advanced AI agents. Here's how to visualize it:
Your Application Code:
You use the Julep SDK in your application to define agents, tasks, and workflows.
The SDK provides functions and classes that make it easy to set up and manage these components.
Julep Backend Service:
The SDK communicates with the Julep backend over the network.
The backend handles execution of tasks, maintains session state, stores documents, and orchestrates workflows.
Integration with Tools and APIs:
Within your workflows, you can integrate external tools and services.
The backend facilitates these integrations, so your agents can, for example, perform web searches, access databases, or call third-party APIs.
In simpler terms:
Julep is a platform for building stateful AI agents.
You use the SDK (like a toolkit) in your code to define what your agents do.
The backend service (which you can think of as the engine) runs these definitions, manages state, and handles complexity.
Concepts
Julep is built on several key technical components that work together to create powerful AI workflows:
Agents: AI-powered entities backed by large language models (LLMs) that execute tasks and interact with users.
Users: Entities that interact with agents through sessions.
Sessions: Stateful interactions between agents and users, maintaining context across multiple exchanges.
Tasks: Multi-step, programmatic workflows that agents can execute, including various types of steps like prompts, tool calls, and conditional logic.
Tools: Integrations that extend an agent's capabilities, including user-defined functions, system tools, or third-party API integrations.
Documents: Text or data objects associated with agents or users, vectorized and stored for semantic search and retrieval.
Executions: Instances of tasks that have been initiated with specific inputs, with their own lifecycle and state machine.
For a more detailed explanation of these concepts and their interactions, please refer to our Concepts Documentation.
Understanding Tasks
Tasks are the core of Julep's workflow system. They allow you to define complex, multi-step AI workflows that your agents can execute. Here's a brief overview of task components:
Name and Description: Each task has a unique name and description for easy identification.
Main Steps: The core of a task, defining the sequence of actions to be performed.
Tools: Optional integrations that extend the capabilities of your agent during task execution.
Types of Workflow Steps
Tasks in Julep can include various types of steps, allowing you to create complex and powerful workflows. Here's an overview of the available step types, organized by category:
Common Steps
Prompt: Send a message to the AI model and receive a response.
Tool Call: Execute an integrated tool or API.
Evaluate: Perform calculations or manipulate data.
Wait for Input: Pause workflow until input is received.
Log: Log a specified value or message.
Key-Value Steps
Get: Retrieve a value from a key-value store.
Set: Assign a value to a key in a key-value store.
Iteration Steps
Foreach: Iterate over a collection and perform steps for each item.
Map-Reduce: Map over a collection and reduce the results.
Parallel: Run multiple steps in parallel.
Conditional Steps
If-Else: Conditional execution of steps.
Switch: Execute steps based on multiple conditions.
Other Control Flow
Sleep: Pause the workflow for a specified duration.
Return: Return a value from the workflow.
Yield: Run a subworkflow and await its completion.
Error: Handle errors by specifying an error message.
Each step type serves a specific purpose in building sophisticated AI workflows. This categorization helps in understanding the various control flows and operations available in Julep tasks.
Advanced Features
Julep offers a range of advanced features to enhance your AI workflows:
Adding Tools to Agents
Extend your agent's capabilities by integrating external tools and APIs:
Managing Sessions and Users
Julep provides robust session management for persistent interactions:
Document Integration and Search
Easily manage and search through documents for your agents:
For more advanced features and detailed usage, please refer to our Advanced Features Documentation.
Integrations
Julep supports various integrations that extend the capabilities of your AI agents. Here's a list of available integrations and their supported arguments:
Brave Search
BrowserBase
Email
Spider
Weather
Wikipedia
These integrations can be used within your tasks to extend the capabilities of your AI agents. For more detailed information on how to use these integrations in your workflows, please refer to our Integrations Documentation.
SDK Reference
API Reference
Explore our comprehensive API documentation to learn more about agents, tasks, and executions:
Last updated