我们激动地宣布开放响应API正式发布!该API提供以下特性:
开放响应API让您轻松集成现有应用,同时获得强大的新功能。
立即体验?查看我们的开放响应API文档开始使用!
Julep是一个无服务器平台,帮助数据和ML团队构建复杂AI工作流。它提供了编排AI操作、管理交互状态以及与现有数据基础设施集成的强大基础。
无论您要构建数据管道还是AI工作流,Julep都能让您轻松组合和扩展基于LLM的工作流,无需管理基础设施。想象构建一个不仅能回答简单问题,还能处理复杂任务、记忆历史交互甚至调用其他工具的AI代理——这正是Julep的用武之地。我们负责底层繁重工作,让您专注于业务智能解决方案。
💡 了解更多请访问**文档中心**。
🧠 | 智能记忆 | 能记忆上下文并从历史交互中学习的智能体 |
🔄 | 工作流引擎 | 构建带分支和循环的复杂多步骤流程 |
⚡ | 并行处理 | 同时执行多个操作实现最高效率 |
🛠️ | 工具集成 | 无缝连接外部API和服务 |
🔌 | 简易设置 | 通过Python和Node.js SDK快速入门 |
🔒 | 可靠安全 | 内置错误处理、重试机制和安全特性 |
📊 | 监控系统 | 实时追踪任务进度和性能 |
💡 了解更多请访问**文档中心**。
Julep由以下组件构成:
将Julep视为结合客户端与服务端组件的高级AI代理构建平台:
应用代码层:
Julep后端服务:
工具集成层:
npm install @julep/sdk
# or
bun add @julep/sdk
pip install julep
[!注意] 🔑 获取API密钥请访问控制台。
加入Discord了解更多。
Julep CLI是通过终端直接管理AI工作流、任务和代理的命令行工具,无需编写代码即可操作平台资源。
pip install julep-cli
详情参见**CLI文档**。
[!注意] CLI目前处于Beta阶段,仅支持Python,Node.js版本即将推出!
设想一个能实现以下功能的研究型AI代理:
[!注意] 在Julep中,这仅需80行代码即可实现,且能全自动托管运行。所有步骤均在Julep服务器执行,无需人工干预。
完整任务定义示例:
# yaml-language-server: $schema=https://raw.githubusercontent.com/julep-ai/julep/refs/heads/dev/schemas/create_task_request.json
name: Research Agent
description: A research assistant that can search the web and send the summary to Discord
########################################################
####################### INPUT ##########################
########################################################
# Define the input schema for the task
input_schema:
type: object
properties:
topic:
type: string
description: The main topic to research
num_questions:
type: integer
description: The number of search queries to generate
########################################################
####################### TOOLS ##########################
########################################################
# Define the tools that the agent can use
tools:
- name: web_search
type: integration
integration:
provider: brave
setup:
api_key: "<your-brave-api-key>"
- name: discord_webhook
type: api_call
api_call:
url: https://discord.com/api/webhooks/<your-webhook-id>/<your-webhook-token>
method: POST
headers:
Content-Type: application/json
########################################################
####################### MAIN WORKFLOW #################
########################################################
# Special variables:
# - steps[index].input: for accessing the input to the step at that index
# - steps[index].output: for accessing the output of the step at that index
# - _: for accessing the output of the previous step
# Define the main workflow
main:
# Step 0: Generate search queries
- prompt:
- role: system
content: >-
$ f"""
You are a research assistant.
Generate {{steps[0].input.num_questions|default(30, true)}} diverse search queries related to the topic:
{steps[0].input.topic}
Write one query per line.
"""
unwrap: true
# Step 1: Evaluate the search queries using a simple python expression
- evaluate:
search_queries: $ _.split(NEWLINE)
# Step 2: Run the web search in parallel for each query
- over: $ _.search_queries
map:
tool: web_search
arguments:
query: $ _
parallelism: 5
# Step 3: Collect the results from the web search
- evaluate:
search_results: $ _
# Step 4: Summarize the results
- prompt:
- role: system
content: >
$ f"""
You are a research summarizer. Create a comprehensive summary of the following research results on the topic {steps[0].input.topic}.
The summary should be well-structured, informative, and highlight key findings and insights. Keep the summary concise and to the point.
The length of the summary should be less than 150 words.
Here are the search results:
{_.search_results}
"""
unwrap: true
settings:
model: gpt-4o-mini
# Step 5: Send the summary to Discord
- evaluate:
discord_message: |-
$ f'''
**Research Summary for {steps[0].input.topic}**
{_}
'''
# Step 6: Send the summary to Discord
- tool: discord_webhook
arguments:
json_:
content: $ _.discord_message[:2000] # Discord has a 2000 character limit
使用Julep SDK执行工作流:
from julep import Client
import yaml
import time
# Initialize the client
client = Client(api_key=JULEP_API_KEY)
# Create the agent
agent = client.agents.create(
name="Julep Browser Use Agent",
description="A Julep agent that can use the computer tool to interact with the browser.",
)
# Load the task definition
with open('./research_agent.yaml', 'r') as file:
task_definition = yaml.safe_load(file)
# Create the task
task = client.tasks.create(
agent_id=agent.id,
**task_definition
)
# Create the execution
execution = client.executions.create(
task_id=task.id,
input={
"topic": "artificial intelligence",
"num_questions": 30
}
)
# Wait for the execution to complete
while (result := client.executions.get(execution.id)).status not in ['succeeded', 'failed']:
print(result.status)
time.sleep(1)
# Print the result
if result.status == "succeeded":
print(result.output)
else:
print(f"Error: {result.error}")
import { Julep } from '@julep/sdk';
import yaml from 'yaml';
import fs from 'fs';
// Initialize the client
const client = new Julep({
apiKey: 'your_julep_api_key'
});
// Create the agent
const agent = await client.agents.create({
name: "Julep Browser Use Agent",
description: "A Julep agent that can use the computer tool to interact with the browser.",
});
// Parse the task definition
const taskDefinition = yaml.parse(fs.readFileSync('./research_agent.yaml', 'utf8'));
// Create the task
const task = await client.tasks.create(
agent.id,
taskDefinition
);
// Create the execution
const execution = await client.executions.create(
task.id,
{
input: {
"topic": "artificial intelligence",
"num_questions": 30
}
}
);
// Wait for the execution to complete
let result;
while (true) {
result = await client.executions.get(execution.id);
if (result.status === 'succeeded' || result.status === 'failed') break;
console.log(result.status);
await new Promise(resolve => setTimeout(resolve, 1000));
}
// Print the result
if (result.status === 'succeeded') {
console.log(result.output);
} else {
console.error(`Error: ${result.error}`);
}
此示例中,Julep将自动管理并行执行、失败重试、API请求重发,确保任务可靠运行至完成。
执行时间不超过30秒,返回如下结果:
AI研究摘要
人工智能(AI)研究结果综述
引言
近年来人工智能领域取得重大进展,机器感知环境、数据学习和决策制定等技术快速发展。本摘要聚焦AI相关研究的核心发现。
关键发现
- AI定义与范畴:
- AI是计算机科学分支,致力于创建具备类人智能的系统(维基百科)
- 涵盖机器学习、自然语言处理、机器人学等子领域
- 影响与应用:
- AI技术正融入多个领域提升效率,包括自动驾驶、医疗诊断和金融服务(OpenAI)
- Google致力于通过AI改善用户体验(Google AI)
- 伦理考量:
- 需建立确保AI安全可靠使用的伦理框架(OpenAI)
- 学习机制:
- 监督学习、无监督学习和强化学习等机制(维基百科)
- 监督学习依赖标注数据,无监督学习自主识别模式(Unsupervised)
- 未来方向:
- 提升AI系统可解释性和透明度(OpenAI)
- 推动AI普及化和易用性(Google AI)
结论
AI正重塑多个行业,但需同步解决伦理和社会影响问题。技术专家、伦理学家和政策制定者的持续合作至关重要。
[!提示] 💡 查看文档中的教程章节
💡 新手建议从快速入门开始
💡 更多创意请访问仓库的创意集
💡 实践案例请查看示例库
查看代理、任务、工具和CLI的完整API文档:API参考
从以下地址克隆仓库:
git clone <repository_url>
切换到项目根目录:
cd <repository_root>
.env
文件.env.example
设置必要变量创建名为grafana_data
、memory_store_data
、temporal-db-data
、prometheus_data
、seaweedfs_data
的Docker卷:
docker volume create grafana_data
docker volume create memory_store_data
docker volume create temporal-db-data
docker volume create prometheus_data
docker volume create seaweedfs_data
支持单租户和多租户两种模式:
执行以下命令:
docker compose --env-file .env --profile temporal-ui --profile single-tenant --profile self-hosted-db --profile blob-store --profile temporal-ui-public up --build --force-recreate --watch
注意:单租户模式下可直接使用SDK,无需API密钥。
执行以下命令:
docker compose --env-file .env --profile temporal-ui --profile multi-tenant --profile embedding-cpu --profile self-hosted-db --profile blob-store --profile temporal-ui-public up --force-recreate --build --watch
注意:多租户模式下需生成JWT令牌作为API密钥。
生成JWT令牌(仅多租户模式)
安装jwt-cli
后执行(替换.env
中的JWT_SHARED_KEY
):
jwt encode --secret JWT_SHARED_KEY --alg HS512 --exp=$(date -d '+10 days' +%s) --sub '00000000-0000-0000-0000-000000000000' '{}'
此令牌有效期为10天。
.env
指定端口访问from julep import Client
client = Client(api_key="your_jwt_token")
注意:多租户模式需设置环境为local_multi_tenant
并使用JWT令牌,单租户模式设为local
且无需密钥。
.env
变量配置docker compose logs
查看详细日志我们诚邀贡献者参与Julep项目!准备了若干"good first issues"供新手入门。
无论贡献大小,我们都深表感谢。让我们携手打造卓越产品!🚀
Julep 采用 Apache License 2.0 许可证授权。
更多详情请参阅 LICENSE 文件。