Skip to content
/ julep Public
forked from julep-ai/julep

Open-source backend for building stateful AI apps

License

Notifications You must be signed in to change notification settings

itsbrex/julep

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

English | ไธญๆ–‡็ฟป่ฏ‘

julep

Build powerful AI applications with stateful agents, complex workflows, and integrated tools.


Explore the docs ยป

Report Bug ยท Request Feature ยท Join Our Discord ยท X ยท LinkedIn

NPM Version ย  PyPI - Version ย  Docker Image Version ย  GitHub License


๐Ÿš€ Upcoming Release: v0.4 Alpha

Release Date: October 7 (Hacktoberfest Launch)

We are thrilled to announce the upcoming release of Julep v0.4 Alpha on October 7, just in time for Hacktoberfest!

Key Highlights

New Feature: Tasks

  • Autonomous Workflows: Unlock the ability for agents to perform long-term, multi-step tasks autonomously. Define complex workflows that enable your agents to operate with minimal intervention.

  • Harness OpenAI's o1 Models: Leverage the advanced reasoning and planning capabilities of OpenAI's o1 models. Perfect for orchestrating intricate and prolonged tasks that require sophisticated understanding and execution.

  • 100+ Integrations: Seamlessly integrate with popular tools and APIs, including GitHub, Salesforce, File Manager, Code Execution, and more. Expand your agents' capabilities to perform a wide range of actions.

Rewritten from Scratch Based on Developer Feedback

  • Enhanced Doc Search: Experience a significant improvement in document retrieval. Agents can now access the most relevant information faster, ensuring more accurate and contextually appropriate interactions.

  • Easier to Use: We've streamlined the user experience with simplified APIs and more intuitive interfaces. Building powerful AI applications is now more straightforward than ever.

  • Multi-Agent Sessions: Support for sessions with multiple agents and users. Enable complex interaction patterns, collaborative problem-solving, and more dynamic conversations within your applications.

  • Extensive Integrations: Incorporate a multitude of popular tools and services directly into your AI applications, enhancing functionality and providing richer experiences for your users.

Call to Action

  • Join Our Discord Community: Be among the first to access Julep v0.4 Alpha! Join our Discord to get early access and API keys. Engage with other developers, share your projects, and provide feedback.

Why Julep?

We've built a lot of AI apps and understand the challenges in creating complex, stateful applications with multiple agents and workflows.

The Problems

  1. Building AI applications with memory, knowledge, and tools is complex and time-consuming.
  2. Managing long-running tasks and complex workflows in AI applications is challenging.
  3. Integrating multiple tools and services into AI applications requires significant development effort.

Features

  • Stateful Agents: Create and manage agents with built-in conversation history and memory.
  • Complex Workflows: Define and execute multi-step tasks with branching, parallel execution, and error handling.
  • Integrated Tools: Easily incorporate a wide range of tools and external services into your AI applications.
  • Flexible Session Management: Support for various interaction patterns like one-to-many and many-to-one between agents and users.
  • Built-in RAG: Add, delete & update documents to provide context to your agents.
  • Asynchronous Task Execution: Run long-running tasks in the background with state management and resumability.
  • Multi-Model Support: Switch between different language models (OpenAI, Anthropic, Ollama) while preserving state.
  • Task System: Define and execute complex, multi-step workflows with parallel processing and error handling.

Quickstart

Option 1: Use the Julep Cloud

Our hosted platform is in Beta!

To get access:

Option 2: Install and run Julep locally

Head over to docs on self-hosting to see how to run Julep locally!

Installation

pip install julep

Setting up the client

from julep import Client
import os

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

client = Client(api_key=api_key, base_url=base_url)

Create an agent

Agent is the object to which LLM settings like model, temperature along with tools are scoped to.

agent = client.agents.create(
    name="Jessica",
    model="gpt-4",
    tools=[],    # Tools defined here
    about="A helpful AI assistant",
    instructions=["Be polite", "Be concise"]
)

Create a user

User is the object which represents the user of the application.

Memories are formed and saved for each user and many users can talk to one agent.

user = client.users.create(
    name="Anon",
    about="Average nerdy techbro/girl spending 8 hours a day on a laptop",
)

Create a session

A "user" and an "agent" communicate in a "session". System prompt goes here.

situation_prompt = """You are Jessica, a helpful AI assistant. 
You're here to assist the user with any questions or tasks they might have."""
session = client.sessions.create(
    user_id=user.id,
    agent_id=agent.id,
    situation=situation_prompt
)

Start a stateful conversation

session.chat controls the communication between the "agent" and the "user".

It has two important arguments;

  • recall: Retrieves the previous conversations and memories.
  • remember: Saves the current conversation turn into the memory store.

To keep the session stateful, both need to be True

user_msg = "Hey Jessica, can you help me with a task?"
response = client.sessions.chat(
    session_id=session.id,
    messages=[
        {
            "role": "user",
            "content": user_msg,
            "name": "Anon",
        }
    ],
    recall=True,
    remember=True,
)

print(response.response[0][0].content)

Core Concepts

Agent

An Agent in Julep is the main orchestrator of your application. It's backed by foundation models like GPT-4 or Claude and can use tools, documents, and execute complex tasks.

User

Users in Julep represent the end-users of your application. They can be associated with sessions and have their own documents and metadata.

Session

Sessions manage the interaction between users and agents. They maintain conversation history and context.

Tool

Tools are functions that agents can use to perform specific actions or retrieve information.

Doc

Docs are collections of text snippets that can be associated with agents or users and are used for context retrieval.

Task

Tasks are complex, multi-step workflows that can be defined and executed by agents.

Execution

An Execution is an instance of a Task that has been started with some input. It goes through various states as it progresses.


API and SDKs

To use the API directly or to take a look at request & response formats, authentication, available endpoints and more, please refer to the API Documentation

Python SDK

To install the Python SDK, run:

pip install julep

For more information on using the Python SDK, please refer to the Python SDK documentation.

TypeScript SDK

To install the TypeScript SDK using npm, run:

npm install @julep/sdk

For more information on using the TypeScript SDK, please refer to the TypeScript SDK documentation.


Deployment

Check out the self-hosting guide to host the platform yourself.

If you want to deploy Julep to production, let's hop on a call!

We'll help you customise the platform and help you get set up with:

  • Multi-tenancy
  • Reverse proxy along with authentication and authorisation
  • Self-hosted LLMs
  • & more

Contributing

We welcome contributions from the community to help improve and expand the Julep AI platform. Please see our Contributing Guidelines for more information on how to get started.


License

Julep AI is released under the Apache 2.0 License. See the LICENSE file for more details.


Contact and Support

If you have any questions, need assistance, or want to get in touch with the Julep AI team, please use the following channels:

  • Discord: Join our community forum to discuss ideas, ask questions, and get help from other Julep AI users and the development team.
  • GitHub Issues: For technical issues, bug reports, and feature requests, please open an issue on the Julep AI GitHub repository.
  • Email Support: If you need direct assistance from our support team, send an email to [email protected], and we'll get back to you as soon as possible.
  • Follow for updates on X & LinkedIn
  • Hop on a call: We wanna know what you're building and how we can tweak and tune Julep to help you build your next AI app.

About

Open-source backend for building stateful AI apps

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 82.9%
  • Jupyter Notebook 16.3%
  • Other 0.8%