{"id":13455909,"url":"https://github.com/julep-ai/julep","last_synced_at":"2025-04-28T11:54:59.207Z","repository":{"id":233453453,"uuid":"781914762","full_name":"julep-ai/julep","owner":"julep-ai","description":"Serverless AI Workflows for Data \u0026 ML Teams","archived":false,"fork":false,"pushed_at":"2025-04-28T10:38:04.000Z","size":68917,"stargazers_count":5448,"open_issues_count":42,"forks_count":925,"subscribers_count":19,"default_branch":"dev","last_synced_at":"2025-04-28T11:54:38.754Z","etag":null,"topics":["agents","ai","ai-agents","ai-agents-framework","ai-memory","ai-platform","aiagents","developer-tools","devfest","hacktoberfest","hacktoberfest2024","llm","llm-ops","python"],"latest_commit_sha":null,"homepage":"https://docs.julep.ai","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/julep-ai.png","metadata":{"files":{"readme":".github/README-CN.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-04T09:33:02.000Z","updated_at":"2025-04-28T10:38:08.000Z","dependencies_parsed_at":"2025-04-28T10:41:33.150Z","dependency_job_id":null,"html_url":"https://github.com/julep-ai/julep","commit_stats":null,"previous_names":["julep-ai/julep"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julep-ai%2Fjulep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julep-ai%2Fjulep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julep-ai%2Fjulep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/julep-ai%2Fjulep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/julep-ai","download_url":"https://codeload.github.com/julep-ai/julep/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311332,"owners_count":21569008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","ai","ai-agents","ai-agents-framework","ai-memory","ai-platform","aiagents","developer-tools","devfest","hacktoberfest","hacktoberfest2024","llm","llm-ops","python"],"created_at":"2024-07-31T08:01:13.350Z","updated_at":"2025-04-28T11:54:59.199Z","avatar_url":"https://github.com/julep-ai.png","language":"Jupyter Notebook","funding_links":[],"categories":["Jupyter Notebook","*Ops for AI","Python","A01_文本生成_文本对话","Papers","Built with Temporal","\u003ca name=\"Jupyter%20Notebook\"\u003e\u003c/a\u003eJupyter Notebook","Agent Frameworks","AI Agent Frameworks \u0026 SDKs","4. Agentic AI \u0026 Multi-Agent Systems"],"sub_categories":["AI Orchestration \u0026 Deployment","大语言对话模型及数据","Autonomous Task Solver","Blog posts","Orchestration Frameworks"],"readme":"\u003csup\u003e[English](README.md) | [中文翻译](README-CN.md) | [日本語翻訳](README-JA.md) | [French](README-FR.md)\u003c/sup\u003e\n\n\u003cdiv align=\"center\" id=\"top\"\u003e\n \u003cimg src=\"https://socialify.git.ci/julep-ai/julep/image?description=1\u0026descriptionEditable=Rapidly%20build%20AI%20workflows%20and%20agents\u0026font=Source%20Code%20Pro\u0026logo=https%3A%2F%2Fraw.githubusercontent.com%2Fjulep-ai%2Fjulep%2Fdev%2F.github%2Fjulep-logo.svg\u0026owner=1\u0026forks=1\u0026pattern=Solid\u0026stargazers=1\u0026theme=Auto\" alt=\"julep\" width=\"640\" height=\"320\" /\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://docs.julep.ai\" rel=\"dofollow\"\u003e探索文档（正在开发中）\u003c/a\u003e\n  ·\n  \u003ca href=\"https://discord.com/invite/JTSBGRZrzj\" rel=\"dofollow\"\u003e不和谐\u003c/a\u003e\n  ·\n  \u003ca href=\"https://x.com/julep_ai\" rel=\"dofollow\"\u003e𝕏\u003c/a\u003e\n  ·\n  \u003ca href=\"https://www.linkedin.com/company/julep-ai\" rel=\"dofollow\"\u003eLinkedIn\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.npmjs.com/package/@julep/sdk\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/%40julep%2Fsdk?style=social\u0026amp;logo=npm\u0026amp;link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40julep%2Fsdk\" alt=\"NPM Version\"\u003e\u003c/a\u003e\n    \u003cspan\u003e\u0026nbsp;\u003c/span\u003e\n    \u003ca href=\"https://pypi.org/project/julep\"\u003e\u003cimg src=\"https://img.shields.io/pypi/v/julep?style=social\u0026amp;logo=python\u0026amp;label=PyPI\u0026amp;link=https%3A%2F%2Fpypi.org%2Fproject%2Fjulep\" alt=\"PyPI - Version\"\u003e\u003c/a\u003e\n    \u003cspan\u003e\u0026nbsp;\u003c/span\u003e\n    \u003ca href=\"https://hub.docker.com/u/julepai\"\u003e\u003cimg src=\"https://img.shields.io/docker/v/julepai/agents-api?sort=semver\u0026amp;style=social\u0026amp;logo=docker\u0026amp;link=https%3A%2F%2Fhub.docker.com%2Fu%2Fjulepai\" alt=\"Docker Image Version\"\u003e\u003c/a\u003e\n    \u003cspan\u003e\u0026nbsp;\u003c/span\u003e\n    \u003ca href=\"https://choosealicense.com/licenses/apache/\"\u003e\u003cimg src=\"https://img.shields.io/github/license/julep-ai/julep\" alt=\"GitHub License\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\u003e [!注意]\n\u003e 从[此处](https://dashboard-dev.julep.ai)获取您的 API 密钥。\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e贡献🌟\u003c/b\u003e（点击展开）\u003c/summary\u003e\n\n## 征集贡献者🌟\n\n我们很高兴欢迎新贡献者加入 Julep 项目！我们创建了几个“好的第一个问题”来帮助您入门。以下是您可以做出贡献的方式：\n\n1. 查看我们的 [CONTRIBUTING.md](https://github.com/julep-ai/julep/blob/dev/CONTRIBUTING.md) 文件以获取有关如何贡献的指南。\n2. 浏览我们的 [good first issues](https://github.com/julep-ai/julep/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) 以找到您感兴趣的任务。\n3. 如果您有任何疑问或需要帮助，请随时通过我们的 [Discord](https://discord.com/invite/JTSBGRZrzj) 频道联系我们。\n\n您的贡献，无论大小，对我们来说都是宝贵的。让我们一起创造一些了不起的东西！🚀\n\n\u003c/details\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\u003ch3\u003e📖 Table of Contents\u003c/h3\u003e\n\n- [主要特点](#%E4%B8%BB%E8%A6%81%E7%89%B9%E7%82%B9)\n- [Python 快速入门🐍](#python-%E5%BF%AB%E9%80%9F%E5%85%A5%E9%97%A8)\n- [Node.js Quick Start 🟩](#nodejs-quick-start-)\n- [Components](#components)\n  - [Mental Model](#mental-model)\n- [Concepts](#concepts)\n- [Understanding Tasks](#understanding-tasks)\n  - [Lifecycle of a Task](#lifecycle-of-a-task)\n  - [Types of Workflow Steps](#types-of-workflow-steps)\n- [Tool Types](#tool-types)\n  - [User-defined `functions`](#user-defined-functions)\n  - [`system` tools](#system-tools)\n  - [Built-in `integrations`](#built-in-integrations)\n  - [Direct `api_calls`](#direct-api_calls)\n- [Integrations](#integrations)\n- [Other Features](#other-features)\n  - [Adding Tools to Agents](#adding-tools-to-agents)\n  - [Managing Sessions and Users](#managing-sessions-and-users)\n  - [Document Integration and Search](#document-integration-and-search)\n  - [SDK 参考](#sdk-%E5%8F%82%E8%80%83)\n  - [API 参考](#api-%E5%8F%82%E8%80%83)\n- [本地快速启动](#%E6%9C%AC%E5%9C%B0%E5%BF%AB%E9%80%9F%E5%90%AF%E5%8A%A8)\n- [Julep 和 LangChain 等有什么区别？](#julep-%E5%92%8C-langchain-%E7%AD%89%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB)\n  - [不同的用例](#%E4%B8%8D%E5%90%8C%E7%9A%84%E7%94%A8%E4%BE%8B)\n  - [不同的外形尺寸](#%E4%B8%8D%E5%90%8C%E7%9A%84%E5%A4%96%E5%BD%A2%E5%B0%BA%E5%AF%B8)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n＃＃ 介绍\n\nJulep 是一个用于创建 AI 代理的平台，这些代理可以记住过去的互动并执行复杂的任务。它提供长期记忆并管理多步骤流程。\n\nJulep 支持创建多步骤任务，包括决策、循环、并行处理以及与众多外部工具和 API 的集成。\n\n尽管许多 AI 应用程序仅限于简单、线性的提示和 API 调用链，并且分支很少，但 Julep 可以处理更复杂的场景，这些场景包括：\n\n- 有多个步骤，\n- 根据模型输出做出决策，\n- 产生并行分支，\n- 使用多种工具，并且\n- 长时间运行。\n\n\u003e [!提示]\n\u003e 想象一下，您想要构建一个 AI 代理，它不仅可以回答简单的问题，还可以处理复杂的任务、记住过去的交互，甚至可能使用其他工具或 API。这就是 Julep 的作用所在。阅读 [了解任务](#understanding-tasks) 了解更多信息。\n\n## 主要特点\n\n1. 🧠 **持久 AI 代理**：在长期交互​​中记住上下文和信息。\n2. 💾 **状态会话**：跟踪过去的互动以获得个性化回应。\n3. 🔄 **多步骤任务**：通过循环和决策构建复杂的多步骤流程。\n4. ⏳ **任务管理**：处理可以无限期运行的长时间运行的任务。\n5.🛠️**内置工具**：在您的任务中使用内置工具和外部 API。\n6. 🔧 **自我修复**：Julep 将自动重试失败的步骤、重新发送消息，并确保您的任务顺利运行。\n7. 📚 **RAG**：使用 Julep 的文档存储构建一个用于检索和使用您自己的数据的系统。\n\n![功能](https://github.com/user-attachments/assets/4355cbae-fcbd-4510-ac0d-f8f77b73af70)\n\n\u003e [!提示]\n\u003e Julep 非常适合需要超越简单的提示响应模型的 AI 用例的应用程序。\n\n快速示例\n\n想象一下一个可以执行以下操作的研究 AI 代理：\n\n1. **选择一个主题**，\n2. 针对该主题提出 30 个搜索查询，\n3. 同时进行网页搜索，\n4. **总结**结果，\n5. 将**摘要发送至 Discord**。\n\n\u003e [!注意]\n\u003e 在 Julep 中，这将是一项单独的任务\u003cb\u003e80行代码\u003c/b\u003e然后运行\u003cb\u003e完全托管\u003c/b\u003e全部独立完成。所有步骤都在 Julep 自己的服务器上执行，您无需动手。\n\n这是一个有效的例子：\n\n```yaml\nname: Research Agent\n\n# Optional: Define the input schema for the task\ninput_schema:\n  type: object\n  properties:\n    topic:\n      type: string\n      description: The main topic to research\n    num_questions:\n      type: integer\n      description: The number of search queries to generate\n\n# Define the tools that the agent can use\ntools:\n  - name: web_search\n    type: integration\n    integration:\n      provider: brave\n      setup:\n        api_key: \u003cyour-brave-api-key\u003e\n\n  - name: discord_webhook\n    type: api_call\n    api_call:\n      url: https://discord.com/api/webhooks/\u003cyour-webhook-id\u003e/\u003cyour-webhook-token\u003e\n      method: POST\n      headers:\n        Content-Type: application/json\n\n# Special variables:\n# - inputs: for accessing the input to the task\n# - outputs: for accessing the output of previous steps\n# - _: for accessing the output of the previous step\n\n# Define the main workflow\nmain:\n- prompt:\n    - role: system\n      content: \u003e-\n        You are a research assistant.\n        Generate {{inputs[0].num_questions|default(30, true)}} diverse search queries related to the topic:\n        {{inputs[0].topic}}\n\n        Write one query per line.\n  unwrap: true\n\n# Evaluate the search queries using a simple python expression\n- evaluate:\n    search_queries: \"_.split(NEWLINE)\"\n\n# Run the web search in parallel for each query\n- over: \"_.search_queries\"\n  map:\n    tool: web_search\n    arguments:\n      query: \"_\"\n  parallelism: 5\n\n# Collect the results from the web search\n- evaluate:\n    search_results: _\n\n# Summarize the results\n- prompt:\n    - role: system\n      content: \u003e\n        You are a research summarizer. Create a comprehensive summary of the following research results on the topic {{inputs[0].topic}}.\n        The summary should be well-structured, informative, and highlight key findings and insights. Keep the summary concise and to the point.\n        The length of the summary should be less than 150 words.\n        Here are the search results:\n        {{_.search_results}}\n  unwrap: true\n  settings:\n    model: gpt-4o-mini\n\n- evaluate:\n    discord_message: |-\n      f'''\n      **Research Summary for {inputs[0].topic}**\n      {_}\n      '''\n\n  # Send the summary to Discord\n- tool: discord_webhook\n  arguments:\n    json_: \n      content: _.discord_message[:2000] # Discord has a 2000 character limit\n```\n\n在这个例子中，Julep 将自动管理并行执行，重试失败的步骤，重新发送 API 请求，并保持任务可靠运行直到完成。\n\n\u003e 这在 30 秒内运行并返回以下输出：\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e人工智能研究摘要\u003c/b\u003e \u003ci\u003e（点击展开）\u003c/i\u003e\u003c/summary\u003e\n\n\u003e **人工智能研究摘要**\n\u003e\n\u003e###人工智能（AI）研究成果摘要\n\u003e\n\u003e #### 简介\n\u003e\n\u003e 近年来，人工智能 (AI) 领域取得了重大进展，其特点是方法和技术的发展，使机器能够感知环境、从数据中学习并做出决策。本摘要主要关注从与 AI 相关的各种研究成果中获得的见解。\n\u003e\n\u003e #### 主要发现\n\u003e\n\u003e 1. **人工智能的定义和范围**：\n\u003e\n\u003e - 人工智能被定义为计算机科学的一个分支，专注于创建能够执行需要类似人类智能的任务的系统，包括学习、推理和解决问题（维基百科）。\n\u003e——它涵盖了各种子领域，包括机器学习、自然语言处理、机器人和计算机视觉。\n\u003e\n\u003e 2. **影响与应用**：\n\u003e\n\u003e - AI 技术正在融入众多领域，提高效率和生产力。应用范围从自动驾驶汽车和医疗诊断到客户服务自动化和财务预测（OpenAI）。\n\u003e - 谷歌致力于让人工智能造福每个人，这凸显了其通过增强各个平台的用户体验（谷歌人工智能）显著改善日常生活的潜力。\n\u003e\n\u003e 3. **道德考虑**：\n\u003e\n\u003e - 关于人工智能的伦理影响的讨论一直在进行中，包括对隐私、偏见和决策过程中的责任的担忧。强调需要一个确保安全和负责任地使用人工智能技术的框架（OpenAI）。\n\u003e\n\u003e 4. **学习机制**：\n\u003e\n\u003e - AI 系统利用不同的学习机制，例如监督学习、无监督学习和强化学习。这些方法允许 AI 通过从过去的经验和数据中学习来提高性能（维基百科）。\n\u003e - 监督学习和无监督学习之间的区别至关重要；监督学习依赖于标记数据，而无监督学习则识别没有预定义标签的模式（无监督）。\n\u003e\n\u003e 5. **未来方向**：\n\u003e - 未来人工智能的发展预计将专注于增强人工智能系统的可解释性和透明度，确保它们能够提供合理的决策和行动（OpenAI）。\n\u003e - 人们还在努力使人工智能系统更易于访问和用户友好，鼓励不同人群和行业更广泛地采用它（谷歌人工智能）。\n\u003e\n\u003e #### 结论\n\u003e\n\u003e 人工智能代表着跨多个领域的变革力量，有望重塑行业并改善生活质量。然而，随着其能力的扩展，解决随之而来的伦理和社会影响至关重要。技术专家、伦理学家和政策制定者之间的持续研究和合作对于驾驭人工智能的未来格局至关重要。\n\n\u003c/details\u003e\n\n＃＃ 安装\n\n要开始使用 Julep，请使用 [npm](https://www.npmjs.com/package/@julep/sdk) 或 [pip](https://pypi.org/project/julep/) 安装它：\n\n**Node.js**：\n\n```bash\nnpm install @julep/sdk\n\n# or\n\nbun add @julep/sdk\n```\n\n**Python**：\n\n```bash\npip install julep\n```\n\n\u003e [!注意]\n\u003e 从[此处](https://dashboard-dev.julep.ai)获取您的 API 密钥。\n\u003e\n\u003e 虽然我们处于测试阶段，但您也可以通过 [Discord](https://discord.com/invite/JTSBGRZrzj) 联系，以解除 API 密钥的速率限制。\n\n\u003e [!提示]\n\u003e 💻 你是“向我展示代码！”的那种人吗？我们创建了大量的烹饪书供您入门。**查看 [烹饪书](https://github.com/julep-ai/julep/tree/dev/cookbooks)** 以浏览示例。\n\u003e\n\u003e 💡 您还可以在 Julep 的基础上构建许多想法。**查看[想法列表](https://github.com/julep-ai/julep/tree/dev/cookbooks/IDEAS.md)** 以获取一些灵感。\n\n## Python 快速入门🐍\n\n````python\n### Step 0: Setup\n\nimport time\nimport yaml\nfrom julep import Julep # or AsyncJulep\n\nclient = Julep(api_key=\"your_julep_api_key\")\n\n### Step 1: Create an Agent\n\nagent = client.agents.create(\n    name=\"Storytelling Agent\",\n    model=\"claude-3.5-sonnet\",\n    about=\"You are a creative storyteller that crafts engaging stories on a myriad of topics.\",\n)\n\n### Step 2: Create a Task that generates a story and comic strip\n\ntask_yaml = \"\"\"\nname: Storyteller\ndescription: Create a story based on an idea.\n\ntools:\n  - name: research_wikipedia\n    type: integration\n    integration:\n      provider: wikipedia\n      method: search\n\nmain:\n  # Step 1: Generate plot idea\n  - prompt:\n      - role: system\n        content: You are {{agent.name}}. {{agent.about}}\n      - role: user\n        content: \u003e\n          Based on the idea '{{_.idea}}', generate a list of 5 plot ideas. Go crazy and be as creative as possible. Return your output as a list of long strings inside ```yaml 标签位于您的回复末尾。\n展开：true\n\n- 评价：\n情节想法：load_yaml（_.split（'```yaml')[1].split('```')[0].strip())\n\n# 第二步：从情节思路中提取研究领域\n- 迅速的：\n- 角色：系统\n内容：您是 {{agent.name}}。{{agent.about}}\n- 角色：用户\n内容: \u003e\n以下是一些故事情节的想法：\n{% 表示 _.plot_ideas 中的想法 %}\n- {{主意}}\n{% 结束 %}\n\n为了发展故事情节，我们需要研究情节思路。\n我们应该研究什么？写下你认为有趣的情节想法的维基百科搜索查询。\n将输出作为 yaml 列表返回```yaml tags at the end of your response.\n    unwrap: true\n    settings:\n      model: gpt-4o-mini\n      temperature: 0.7\n\n  - evaluate:\n      research_queries: load_yaml(_.split('```yaml')[1].split('```')[0].strip())\n\n  # Step 3: Research each plot idea\n  - foreach:\n      in: _.research_queries\n      do:\n        tool: research_wikipedia\n        arguments:\n          query: _\n\n  - evaluate:\n      wikipedia_results: 'NEWLINE.join([f\"- {doc.metadata.title}: {doc.metadata.summary}\" for item in _ for doc in item.documents])'\n\n  # Step 4: Think and deliberate\n  - prompt:\n      - role: system\n        content: You are {{agent.name}}. {{agent.about}}\n      - role: user\n        content: |-\n          Before we write the story, let's think and deliberate. Here are some plot ideas:\n          {% for idea in outputs[1].plot_ideas %}\n          - {{idea}}\n          {% endfor %}\n\n          Here are the results from researching the plot ideas on Wikipedia:\n          {{_.wikipedia_results}}\n\n          Think about the plot ideas critically. Combine the plot ideas with the results from Wikipedia to create a detailed plot for a story.\n          Write down all your notes and thoughts.\n          Then finally write the plot as a yaml object inside ```yaml 标签位于响应末尾。yaml 对象应具有以下结构：\n\n          ```yaml\n          title: \"\u003cstring\u003e\"\n          characters:\n          - name: \"\u003cstring\u003e\"\n            about: \"\u003cstring\u003e\"\n          synopsis: \"\u003cstring\u003e\"\n          scenes:\n          - title: \"\u003cstring\u003e\"\n            description: \"\u003cstring\u003e\"\n            characters:\n            - name: \"\u003cstring\u003e\"\n              role: \"\u003cstring\u003e\"\n            plotlines:\n            - \"\u003cstring\u003e\"```\n\n确保 yaml 有效，且角色和场景不为空。还要注意分号和编写 yaml 的其他问题。\n展开：true\n\n- 评价：\n情节：“load_yaml（_.split（'```yaml')[1].split('```')[0].strip())”\n\"\"\"\n\n任务 = 客户端.任务.创建（\nagent_id=代理.id，\n**yaml.safe_load（任务_yaml）\n)\n\n### 步骤 3：执行任务\n\n执行 = 客户端.执行.创建（\n任务ID=任务ID，\n输入={“idea”：“一只学飞的猫”}\n)\n\n# 🎉 观看故事和漫画面板的生成\nwhile (result := client.executions.get(execution.id)).status 不在 ['成功', '失败'] 中：\n打印（结果.状态，结果.输出）\n时间.睡眠(1)\n\n# 📦执行完成后，检索结果\n如果 result.status ==“成功”：\n打印（结果.输出）\n别的：\n引发异常（结果.错误）\n````\n\nYou can find the full python example [here](example.py).\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Node.js Quick Start 🟩\n\n```JavaScript的\n// 步骤 0：设置\nconst dotenv = require（“dotenv”）；\nconst { Julep } = require（“@julep/sdk”）；\nconst yaml = require(“yaml”);\n\ndotenv.配置（）；\n\nconst 客户端 = new Julep({\napiKey：process.env.JULEP_API_KEY，\n环境：process.env.JULEP_ENVIRONMENT || “生产”，\n});\n\n/* 步骤 1：创建代理 */\n\n异步函数 createAgent() {\nconst 代理 = 等待客户端.代理.创建（{\n名称：“讲故事特工”，\n模型：“claude-3.5-sonnet”，\n关于：\n“您是一位富有创意的讲故事者，能就无数主题创作出引人入胜的故事。”\n  });\n回報代理；\n}\n\n/* 步骤 2：创建一个生成故事和漫画的任务 */\n\nconst taskYaml = `\n名称：讲故事的人\n描述：根据一个想法创建一个故事。\n\n工具：\n- 名称：research_wikipedia\n一体化：\n提供者：维基百科\n方法：搜索\n\n主要的：\n# 步骤 1：产生情节想法\n- 迅速的：\n- 角色：系统\n内容：您是 {{agent.name}}。{{agent.about}}\n- 角色：用户\n内容: \u003e\n根据想法“{{_.idea}}”，生成 5 个情节想法的列表。尽情发挥你的想象力和创造力。将输出作为响应末尾的 \\`\\`\\`yaml 标签内的长字符串列表返回。\n展开：true\n\n- 评价：\nplot_ideas：load_yaml（_.split（'\\`\\`\\`yaml'）[1].split（'\\`\\`\\`'）[0].strip（））\n\n# 第二步：从情节思路中提取研究领域\n- 迅速的：\n- 角色：系统\n内容：您是 {{agent.name}}。{{agent.about}}\n- 角色：用户\n内容: \u003e\n以下是一些故事情节的想法：\n{% 表示 _.plot_ideas 中的想法 %}\n- {{主意}}\n{% 结束 %}\n\n为了发展故事情节，我们需要研究情节思路。\n我们应该研究什么？写下你认为有趣的情节想法的维基百科搜索查询。\n将您的输出作为 yaml 列表返回到响应末尾的 \\`\\`\\`yaml 标签内。\n展开：true\n设置：\n型号：gpt-4o-mini\n温度：0.7\n\n- 评价：\nresearch_queries：load_yaml（_.split（'\\`\\`\\`yaml'）[1].split（'\\`\\`\\`'）[0].strip（））\n\n# 步骤 3：研究每个情节构思\n- foreach：\n在：_.research_queries\n做：\n工具：research_wikipedia\n参数：\n询问： _\n\n- 评价：\nwikipedia_results：'NEWLINE.join（[f“- {doc.metadata.title}：{doc.metadata.summary}”用于 item in _ for doc in item.documents]）'\n\n# 第 4 步：思考和深思\n- 迅速的：\n- 角色：系统\n内容：您是 {{agent.name}}。{{agent.about}}\n- 角色：用户\n内容：|-\n在写故事之前，让我们先思考一下。以下是一些情节构思：\n{% for idea in output[1].plot_ideas %}\n- {{主意}}\n{% 结束 %}\n\n以下是在维基百科上研究情节思路的结果：\n{{_.wikipedia_results}}\n\n认真思考故事情节。将故事情节与维基百科搜索结果相结合，为故事创建详细情节。\n写下你所有的笔记和想法。\n最后，将图表作为 yaml 对象写入响应末尾的 \\`\\`\\`yaml 标签内。yaml 对象应具有以下结构：\n\n\\`\\`\\`yaml\n标题： ”\u003cstring\u003e\"\n人物：\n- 姓名： ”\u003cstring\u003e\"\n关于： ”\u003cstring\u003e\"\n概要：”\u003cstring\u003e\"\n场景：\n- 标题： ”\u003cstring\u003e\"\n描述： ”\u003cstring\u003e\"\n人物：\n- 姓名： ”\u003cstring\u003e\"\n角色： ”\u003cstring\u003e\"\n故事情节：\n-”\u003cstring\u003e“\\`\\`\\`\n\n确保 yaml 有效，且角色和场景不为空。还要注意分号和编写 yaml 的其他问题。\n展开：true\n\n- 评价：\n情节：“load_yaml（_。split（'\\`\\`\\`yaml'）[1].split（'\\`\\`\\`'）[0].strip（））”\n`;\n\n异步函数 createTask（agentId）{\nconst task = 等待客户端.tasks.创建（agentId， yaml.parse(taskYaml)）;\n返回任务；\n}\n\n/* 步骤 3：执行任务 */\n\n异步函数 executeTask (taskId) {\nconst 执行 = 等待客户端.执行.创建（taskId，{\n输入：{想法：“一只学飞的猫”}，\n  });\n\n// 🎉 观看故事和漫画面板的生成\nwhile (真) {\nconst result = 等待客户端.executions.get（execution.id）;\n控制台.log（结果.状态，结果.输出）；\n\nif (result.status === \"成功\" || result.status === \"失败\") {\n// 📦执行完成后，检索结果\n如果 (result.status === \"成功\") {\n控制台.log（结果.输出）；\n} 别的 {\n抛出新的错误（result.error）；\n      }\n休息;\n    }\n\n等待新的Promise（（resolve）=\u003e setTimeout（resolve，1000））；\n  }\n}\n\n// 运行示例的主函数\n异步函数 main() {\n尝试 {\nconst agent = await createAgent();\nconst task = await createTask(agent.id);\n等待执行任务（任务id）；\n} 捕获 (错误) {\nconsole.error(\"发生错误：\", error);\n  }\n}\n\n主要的（）\n.then(() =\u003e console.log(\"完成\"))\n.catch（控制台.错误）；\n```\n\nYou can find the full Node.js example [here](example.js).\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Components\n\nJulep is made up of the following components:\n\n- **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.\n- **Julep SDKs**: Julep SDKs are a set of libraries for building workflows. There are SDKs for Python and JavaScript, with more on the way.\n- **Julep API**: The Julep API is a RESTful API that you can use to interact with the Julep platform.\n\n### Mental Model\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/38420b5d-9342-4c8d-bae9-b47c28ae45af\" height=\"360\" /\u003e\n\u003c/div\u003e\n\nThink 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:\n\n1. **Your Application Code:**\n\n   - You can use the Julep SDK in your application to define agents, tasks, and workflows.\n   - The SDK provides functions and classes that make it easy to set up and manage these components.\n\n2. **Julep Backend Service:**\n\n   - The SDK communicates with the Julep backend over the network.\n   - The backend handles execution of tasks, maintains session state, stores documents, and orchestrates workflows.\n\n3. **Integration with Tools and APIs:**\n   - Within your workflows, you can integrate external tools and services.\n   - The backend facilitates these integrations, so your agents can, for example, perform web searches, access databases, or call third-party APIs.\n\n## Concepts\n\nJulep is built on several key technical components that work together to create powerful AI workflows:\n\n```美人鱼\n图 TD\n用户[用户] ==\u003e 会话[会话]\n会话--\u003e代理[代理]\n代理--\u003e任务[任务]\n代理——\u003e LLM[大型语言模型]\n任务 --\u003e 工具[工具]\n代理人 --\u003e 文件[文件]\n文档 --\u003e VectorDB[矢量数据库]\n任务 --\u003e 执行[执行]\n\nclassDef 客户端填充：#9ff，描边：#333，描边宽度：1px；\n用户客户端类；\n\nclassDef 核心填充：#f9f，描边：#333，描边宽度：2px；\n类代理、任务、会话核心；\n```\n\n- **Agents**: AI-powered entities backed by large language models (LLMs) that execute tasks and interact with users.\n- **Users**: Entities that interact with agents through sessions.\n- **Sessions**: Stateful interactions between agents and users, maintaining context across multiple exchanges.\n- **Tasks**: Multi-step, programmatic workflows that agents can execute, including various types of steps like prompts, tool calls, and conditional logic.\n- **Tools**: Integrations that extend an agent's capabilities, including user-defined functions, system tools, or third-party API integrations.\n- **Documents**: Text or data objects associated with agents or users, vectorized and stored for semantic search and retrieval.\n- **Executions**: Instances of tasks that have been initiated with specific inputs, with their own lifecycle and state machine.\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Understanding Tasks\n\nTasks 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:\n\n- **Name, Description and Input Schema**: Each task has a unique name and description for easy identification. An input schema (optional) that is used to validate the input to the task.\n- **Main Steps**: The core of a task, defining the sequence of actions to be performed. Each step can be a prompt, tool call, evaluate, wait_for_input, log, get, set, foreach, map_reduce, if-else, switch, sleep, or return. (See [Types of Workflow Steps](#types-of-workflow-steps) for more details)\n- **Tools**: Optional integrations that extend the capabilities of your agent during task execution.\n\n### Lifecycle of a Task\n\nYou create a task using the Julep SDK and specify the main steps that the agent will execute. When you execute a task, the following lifecycle happens:\n\n```美人鱼\n顺序图\n参与者 D 作为您的代码\n参与者 C 作为 Julep 客户\n参与者 S 担任 Julep 服务器\n\nD-\u003e\u003eC：创建任务\nC-\u003e\u003eS：提交执行\n注意 S：执行任务\nS 注释：管理状态\nS--\u003e\u003eC：执行事件\nC--\u003e\u003eD：进度更新\nS-\u003e\u003eC：执行完成\nC-\u003e\u003eD：最终结果\n```\n\n### Types of Workflow Steps\n\nTasks 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:\n\n#### Common Steps\n\n\u003ctable\u003e\n\u003ctr\u003e\n    \u003cth\u003eName\u003c/th\u003e\n    \u003cth\u003eAbout\u003c/th\u003e\n    \u003cth\u003eSyntax\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003ePrompt\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nSend a message to the AI model and receive a response\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The prompt step uses Jinja templates and you can access context variables in them.\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- prompt: \"分析以下数据：{{agent.name}}\" # \u003c-- 这是一个 jinja 模板\n```\n\n```yaml\n- 迅速的：\n- 角色：系统\n内容：“您是 {{agent.name}}。 {{agent.about}}”\n- 角色：用户\n内容：“分析以下数据：{{_.data}}”\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eTool Call\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nExecute an integrated tool or API that you have previously declared in the task.\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The tool call step uses Python expressions inside the arguments.\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 工具：web_search\n参数：\n查询：“最新的 AI 发展”#\u003c- 这是一个 Python 表达式（注意引号）\nnum_results: len(_.topics) # \u003c-- 用于访问列表长度的 Python 表达式\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eEvaluate\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nPerform calculations or manipulate data\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The evaluate step uses Python expressions.\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 评价：\n平均分数：总分（分数）/长度（分数）\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eWait for Input\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nPause workflow until input is received. It accepts an `info` field that can be used by your application to collect input from the user.\n\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The wait_for_input step is useful when you want to pause the workflow and wait for user input e.g. to collect a response to a prompt.\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n-等待输入：\n信息：\n消息：'“请提供有关 {_.required_info} 的其他信息。”' # \u003c-- 用于访问上下文变量的 python 表达式\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eLog\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nLog a specified value or message.\n\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The log step uses Jinja templates and you can access context variables in them.\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- log：“项目 {{_.item_id}} 的处理已完成”#\u003c-- jinja 模板用于访问上下文变量\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n#### Key-Value Steps\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e Name \u003c/th\u003e \u003cth\u003e About \u003c/th\u003e\u003cth\u003eSyntax\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eGet\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nRetrieve a value from the execution's key-value store.\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 获取：用户偏好\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eSet\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nAssign a value to a key in the execution's key-value store.\n\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The set step uses Python expressions.\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 放：\nuser_preference: '\"dark_mode\"' # \u003c-- python 表达式\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n#### Iteration Steps\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e Name \u003c/th\u003e \u003cth\u003e About \u003c/th\u003e\u003cth\u003eSyntax\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eForeach\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nIterate over a collection and perform steps for each item\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- foreach：\nin: _.data_list # \u003c-- 用于访问上下文变量的 python 表达式\n做：\n- log: \"处理项目 {{_.item}}\" # \u003c-- jinja 模板访问上下文变量\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eMap-Reduce\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nMap over a collection and reduce the results\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 映射_减少：\nover: _.numbers # \u003c-- 用于访问上下文变量的 python 表达式\n地图：\n- 评价：\n平方：“_ ** 2”\nreduce：results + [_] # \u003c--（可选）python 表达式以减少结果。如果省略，则为默认值。\n```\n\n```yaml\n- 映射_减少：\n结束：_.topics\n地图：\n- 提示：写一篇关于{{__}}的文章\n并行度：10\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eParallel\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nRun multiple steps in parallel\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 平行线：\n- 工具：web_search\n参数：\n查询：“AI 新闻”\n- 工具：weather_check\n参数：\n地点：“纽约”\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n#### Conditional Steps\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e Name \u003c/th\u003e \u003cth\u003e About \u003c/th\u003e\u003cth\u003eSyntax\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eIf-Else\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nConditional execution of steps\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- if: _.score \u003e 0.8 # \u003c-- python 表达式\n然后：\n- 日志：取得高分\n别的：\n- 错误：分数需要提高\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eSwitch\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nExecute steps based on multiple conditions\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 转变：\n- 案例：_.category =='A'\n然后：\n- 日志：“A 类处理”\n- 案例：_.category =='B'\n然后：\n- 日志：“B类处理”\n- case: _ # 默认情况\n然后：\n- 错误：未知类别\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\n#### Other Control Flow\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003e Name \u003c/th\u003e \u003cth\u003e About \u003c/th\u003e\u003cth\u003eSyntax\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eSleep\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nPause the workflow for a specified duration\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 睡觉：\n秒：30\n# 分钟：1\n#小时数：1\n#天数：1\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eReturn\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nReturn a value from the workflow\n\n\u003cbr\u003e\u003cbr\u003e\u003cb\u003eNote:\u003c/b\u003e The return step uses Python expressions.\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 返回：\nresult: '“任务成功完成”' #\u003c-- python 表达式\n时间：datetime.now().isoformat() # \u003c-- python 表达式\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eYield\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nRun a subworkflow and await its completion\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 屈服：\n工作流程：process_data\n参数：\n输入数据：_.raw_data # \u003c-- python 表达式\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eError\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\nHandle errors by specifying an error message\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n```yaml\n- 错误：“提供的输入无效”#\u003c-- 仅限字符串\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\nEach 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.\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Tool Types\n\nAgents can be given access to a number of \"tools\" -- any programmatic interface that a foundation model can \"call\" with a set of inputs to achieve a goal. For example, it might use a `web_search(query)` tool to search the Internet for some information.\n\nUnlike agent frameworks, julep is a _backend_ that manages agent execution. Clients can interact with agents using our SDKs. julep takes care of executing tasks and running integrations.\n\nTools in julep can be one of:\n\n1. **User-defined `functions`**: These are function signatures that you can give the model to choose from, similar to how [openai]'s function-calling works. They need to be handled by the client. The workflow will pause until the client calls the function and gives the results back to julep.\n2. **`system` tools**: Built-in tools that can be used to call the julep APIs themselves, like triggering a task execution, appending to a metadata field, etc.\n3. **`integrations`**: Built-in third party tools that can be used to extend the capabilities of your agents.\n4. **`api_calls`**: Direct api calls during workflow executions as tool calls.\n\n### User-defined `functions`\n\nThese are function signatures that you can give the model to choose from, similar to how [openai]'s function-calling works. An example:\n\n```yaml\n名称：示例系统工具任务\n描述：使用系统调用列出代理\n\n工具：\n- 名称：send_notification\n描述：向用户发送通知\n类型：函数\n功能：\n参数：\n类型：对象\n特性：\n文本：\n类型：字符串\n描述：通知内容\n\n主要的：\n- 工具：send_notification\n参数：\n内容：'“hi”'#\u003c--python 表达式\n```\n\nWhenever julep encounters a _user-defined function_, it pauses, giving control back to the client and waits for the client to run the function call and give the results back to julep.\n\n### `system` tools\n\nBuilt-in tools that can be used to call the julep APIs themselves, like triggering a task execution, appending to a metadata field, etc.\n\n`system` tools are built into the backend. They get executed automatically when needed. They do _not_ require any action from the client-side.\n\nFor example,\n\n```yaml\n名称：示例系统工具任务\n描述：使用系统调用列出代理\n\n工具：\n- 名称：list_agent_docs\n描述：列出给定代理的所有文档\n类型：系统\n系统：\n资源：代理\n子资源：doc\n操作：列表\n\n主要的：\n- 工具：list_agents\n参数：\n限制：10 #\u003c-- python 表达式\n```\n\n#### Available `system` resources and operations\n\n- `agent`:\n\n  - `list`: List all agents.\n  - `get`: Get a single agent by id.\n  - `create`: Create a new agent.\n  - `update`: Update an existing agent.\n  - `delete`: Delete an existing agent.\n\n- `user`:\n\n  - `list`: List all users.\n  - `get`: Get a single user by id.\n  - `create`: Create a new user.\n  - `update`: Update an existing user.\n  - `delete`: Delete an existing user.\n\n- `session`:\n\n  - `list`: List all sessions.\n  - `get`: Get a single session by id.\n  - `create`: Create a new session.\n  - `update`: Update an existing session.\n  - `delete`: Delete an existing session.\n  - `chat`: Chat with a session.\n  - `history`: Get the chat history with a session.\n\n- `task`:\n\n  - `list`: List all tasks.\n  - `get`: Get a single task by id.\n  - `create`: Create a new task.\n  - `update`: Update an existing task.\n  - `delete`: Delete an existing task.\n\n- `doc` (subresource for `agent` and `user`):\n  - `list`: List all documents.\n  - `create`: Create a new document.\n  - `delete`: Delete an existing document.\n  - `search`: Search for documents.\n\nAdditional operations available for some resources:\n\n- `embed`: Embed a resource (specific resources not specified in the provided code).\n- `change_status`: Change the status of a resource (specific resources not specified in the provided code).\n- `chat`: Chat with a resource (specific resources not specified in the provided code).\n- `history`: Get the chat history with a resource (specific resources not specified in the provided code).\n- `create_or_update`: Create a new resource or update an existing one (specific resources not specified in the provided code).\n\nNote: The availability of these operations may vary depending on the specific resource and implementation details.\n\n\u003e [!TIP] \u003e **Example cookbook**: [cookbooks/06-browser-use.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/06-browser-use.ipynb)\n\n### Built-in `integrations`\n\nJulep comes with a number of built-in integrations (as described in the section below). `integration` tools are directly executed on the julep backend. Any additional parameters needed by them at runtime can be set in the agent/session/user's `metadata` fields.\n\nSee [Integrations](#integrations) for details on the available integrations.\n\n\u003e [!TIP] \u003e **Example cookbook**: [cookbooks/01-website-crawler.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/01-website-crawler.ipynb)\n\n### Direct `api_calls`\n\njulep can also directly make api calls during workflow executions as tool calls. Same as `integration`s, additional runtime parameters are loaded from `metadata` fields.\n\nFor example,\n\n```yaml\n名称：示例 api_call 任务\n工具：\n- 类型：api_call\n名字：你好\nAPI调用：\n方法：GET\n网址：https://httpbin.org/get\n\n主要的：\n- 工具：你好\n参数：\njson：\n测试：_.input#\u003c--python 表达式\n```\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Integrations\n\nJulep supports various integrations that extend the capabilities of your AI agents. Here's a list of available integrations and their supported arguments:\n\n\u003ctable\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eBrave Search\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n设置：\napi_key: string # Brave Search 的 API 密钥\n\n参数：\nquery: string # 使用 Brave 搜索的搜索查询\n\n输出：\nresult: list[dict] # 搜索结果列表，每个结果包含：标题、链接、摘要\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/02-sarcastic-news-headline-generator.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/02-sarcastic-news-headline-generator.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eBrowserBase\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n设置：\napi_key: string # BrowserBase 的 API 密钥\nproject_id: string # BrowserBase 的项目 ID\nsession_id: string #（可选）BrowserBase 的会话 ID\n\n参数：\nurls: list[string] # 使用 BrowserBase 加载的 URL\n\n输出：\ndocuments: list # 从 URL 加载的文档\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/06-browser-use.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/06-browser-use.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eEmail\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n设置：\nhost: string # 电子邮件服务器的主机\nport: integer # 电子邮件服务器的端口\n用户：string#电子邮件服务器的用户名\npassword: string # 邮件服务器的密码\n\n参数：\nto: string # 要发送电子邮件到的电子邮件地址\nfrom: string # 发送电子邮件的电子邮件地址\nsubject: string # 电子邮件的主题\nbody: string # 电子邮件正文\n\n输出：\nsuccess: boolean # 邮件是否发送成功\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/00-Devfest-Email-Assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/00-Devfest-Email-Assistant.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eSpider\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n设置：\nspider_api_key: string # Spider 的 API 密钥\n\n参数：\nurl: string # 获取数据的 URL\nparams: dict # （可选）Spider API 的参数\ncontent_type：字符串 #（可选）要返回的内容类型。默认为“application/json”。其他选项：“text/csv”、“application/xml”、“application/jsonl”\n\n输出：\nresult: list[dict] # 结果列表，每个结果包含：内容、错误、状态、费用、网址\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/01-website-crawler.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/01-website-crawler.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eWeather\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n设置：\nopenweathermap_api_key: string # OpenWeatherMap 的 API 密钥\n\n参数：\nlocation: string # 获取天气数据的位置\n\n输出：\nresult: string # 指定位置的天气数据\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/03-trip-planning-assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/03-trip-planning-assistant.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eWikipedia\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n参数：\nquery: string # 搜索查询字符串\nload_max_docs：整数 #（可选）要加载的最大文档数。默认值为 2。\n\n输出：\ndocuments: list # 从 Wikipedia 搜索返回的文档\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/03-trip-planning-assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/03-trip-planning-assistant.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eFFmpeg\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n参数：\ncmd: string # 要执行的 FFmpeg 命令\nfile: string # 要处理的 base64 编码文件\n\n输出：\nfileoutput: string # FFmpeg 命令以 base64 编码输出的文件\nresult: boolean # FFmpeg命令是否执行成功\nmime_type: string # 输出文件的 MIME 类型\n```\n\n\u003c/td\u003e\n\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eLlama Parse\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n设置：\nllamaparse_api_key: string # Llama Parse 的 API 密钥\nparams: dict #（可选）Llama Parse 集成的附加参数\n\n参数：\n文件：字符串 | 数组\u003cstring\u003e# 要解析的 base64 编码文件或要加载的 http/https URL 数组。\nfilename：string #（可选）。文件的文件名。默认为随机 UUID。仅当文件是 base64 编码字符串时才使用。\nparams: dict #（可选）Llama Parse 集成的附加参数。覆盖设置参数。\nbase64：boolean # 输入文件是否为 base64 编码。默认为 false。\n\n输出：\ndocuments: list[Document] # 已解析文档的列表\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/07-personalized-research-assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/07-personalized-research-assistant.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eCloudinary\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n\n方法：media_upload | media_edit # 用于 Cloudinary 集成的方法\n\n设置：\ncloudinary_cloud_name: string # 您的 Cloudinary 云名称\ncloudinary_api_key: string # 您的 Cloudinary API 密钥\ncloudinary_api_secret: string # 您的 Cloudinary API 密钥\nparams: dict # （可选）Cloudinary 集成的附加参数\n\n参数：\nfile: string # 文件上传的 URL。仅适用于 media_upload 方法。\nupload_params：dict #（可选）上传的附加参数。仅适用于 media_upload 方法。\npublic_id：字符串 #（可选）文件的公共 ID。对于 media_edit 方法，它是必需的。对于 media_upload 方法，它是可选的。默认为随机 UUID。\ntransformation：list[dict] # 应用于文件的转换。仅适用于 media_edit 方法。\nreturn_base64: boolean # 是否以 base64 编码返回文件。默认为 false。\n\n输出：\nurl：string # 上传文件的 URL。仅适用于 media_upload 方法。\nmeta_data: dict # 来自上传响应的附加元数据。仅适用于 media_upload 方法。\npublic_id: string # 上传文件的公共 ID。仅适用于 media_upload 方法。\n经过转换的 URL：字符串 #（可选）转换后的 URL。仅适用于 media_edit 方法。\nbase64：字符串#（可选）如果 return_base64 为真，则为 base64 编码的文件。\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/05-video-processing-with-natural-language.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/05-video-processing-with-natural-language.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003ctr\u003e\n\u003ctd\u003e \u003cb\u003eArxiv\u003c/b\u003e \u003c/td\u003e\n\u003ctd\u003e\n\n```yaml\n方法：搜索#用于 Arxiv 集成的方法\n\n设置：\n# Arxiv 不需要任何特殊设置参数\n\n参数：\nquery: string # 使用 Arxiv 搜索的搜索查询\nid_list：list[string] | None # （可选）要搜索的 Arxiv ID 列表\nmax_results: 整数 # 返回的最大结果数，必须介于 1 到 300000 之间\ndownload_pdf：boolean # 是否下载结果的 PDF。默认为 false。\nsort_by: string # 结果的排序标准，选项：relevance、lastUpdatedDate、submittedDate\nsort_order: string # 结果的排序顺序，选项：升序、降序\n\n输出：\nresult: list[dict] # 搜索结果列表，每个结果包含：entry_id、title、updated、published、authors、summary、comment、journal_ref、doi、primary_category、categories、links、pdf_url、pdf_downloaded\n```\n\n\u003c/td\u003e\n\n\u003ctd\u003e\n\n**Example cookbook**: [cookbooks/07-personalized-research-assistant.ipynb](https://github.com/julep-ai/julep/blob/dev/cookbooks/07-personalized-research-assistant.ipynb)\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\n\u003c/table\u003e\n\nFor more details, refer to our [Integrations Documentation](#integrations).\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## Other Features\n\nJulep offers a range of advanced features to enhance your AI workflows:\n\n### Adding Tools to Agents\n\nExtend your agent's capabilities by integrating external tools and APIs:\n\n```Python\n客户端.代理.工具.创建（\nagent_id=代理.id，\n名称=\"web_search\",\ndescription=\"在网络上搜索信息。\",\n积分={\n“提供者”：“勇敢”，\n“方法”：“搜索”，\n“设置”：{“api_key”：“你的brave_api_key”}，\n}，\n)\n```\n\n### Managing Sessions and Users\n\nJulep provides robust session management for persistent interactions:\n\n```Python\n会话 = 客户端.会话.创建（\nagent_id=代理.id，\n用户 ID=用户 ID，\ncontext_overflow=\"自适应\"\n)\n\n# 在同一会话中继续对话\n响应 = 客户端.会话.聊天（\nsession_id=会话id，\n消息=[\n      {\n“角色”：“用户”，\n\"content\": \"跟进之前的对话。\"\n      }\n    ]\n)\n```\n\n### Document Integration and Search\n\nEasily manage and search through documents for your agents:\n\n```Python\n# 上传文档\n文档 = 客户端.代理.docs.创建（\ntitle=\"人工智能进步\",\ncontent=\"人工智能正在改变世界...\",\n元数据={“category”：“research_paper”}\n)\n\n# 搜索文档\n结果 = 客户端.代理.docs.搜索（\ntext=\"AI 进步\",\nmetadata_filter={“category”：“research_paper”}\n)\n```\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n＃＃ 参考\n\n### SDK 参考\n\n- **Node.js** [SDK 参考](https://github.com/julep-ai/node-sdk/blob/main/api.md) | [NPM 包](https://www.npmjs.com/package/@julep/sdk)\n- **Python** [SDK 参考](https://github.com/julep-ai/python-sdk/blob/main/api.md) | [PyPI 包](https://pypi.org/project/julep/)\n\n### API 参考\n\n浏览我们的 API 文档以了解有关代理、任务和执行的更多信息：\n\n- [代理 API](https://dev.julep.ai/api/docs#tag/agents)\n- [任务 API]（https://dev.julep.ai/api/docs#tag/tasks）\n- [执行 API](https://dev.julep.ai/api/docs#tag/executions)\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n## 本地快速启动\n\n**要求**：\n\n- 安装了最新的docker compose\n\n**步骤**：\n\n1. `git 克隆 https://github.com/julep-ai/julep.git`\n2. `cd julep`\n3. `docker 卷创建 cozo_backup`\n4. `docker 卷创建 cozo_data`\n5. `cp .env.example .env # \u003c-- 编辑此文件`\n6. `docker compose --env-file .env --profile temporary-ui --profile single-tenant --profile self-hosted-db up --build`\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n## Julep 和 LangChain 等有什么区别？\n\n### 不同的用例\n\n可以将 LangChain 和 Julep 视为 AI 开发堆栈中具有不同重点的工具。\n\nLangChain 非常适合创建提示序列和管理与 LLM 的交互。它拥有庞大的生态系统，包含大量预构建的集成，如果您想快速启动和运行某些功能，这会非常方便。LangChain 非常适合涉及线性提示链和 API 调用的简单用例。\n\n另一方面，Julep 更侧重于构建持久的 AI 代理，这些代理可以在长期交互​​中保持上下文。当您需要涉及多步骤任务、条件逻辑以及在代理流程中直接与各种工具或 API 集成的复杂工作流时，它会大放异彩。它从头开始设计，以管理持久会话和复杂的工作流。\n\n如果您想构建一个需要执行以下操作的复杂 AI 助手，请使用 Julep：\n\n- 跟踪几天或几周内的用户互动。\n- 执行计划任务，例如发送每日摘要或监控数据源。\n- 根据之前的互动或存储的数据做出决策。\n- 作为其工作流程的一部分与多个外部服务进行交互。\n\n然后 Julep 提供支持所有这些的基础设施，而无需您从头开始构建。\n\n### 不同的外形尺寸\n\nJulep 是一个**平台**，其中包括用于描述工作流的语言、用于运行这些工作流的服务器以及用于与平台交互的 SDK。要使用 Julep 构建某些东西，您需要在“YAML”中编写工作流描述，然后在云中运行工作流。\n\nJulep 专为繁重、多步骤和长时间运行的工作流程而构建，并且工作流程的复杂程度没有限制。\n\nLangChain 是一个**库**，其中包含一些工具和一个用于构建线性提示和工具链的框架。为了使用 LangChain 构建某些东西，您通常需要编写 Python 代码来配置和运行要使用的模型链。\n\n对于涉及线性提示和 API 调用链的简单用例，LangChain 可能足够并且能够更快地实现。\n\n＃＃＃ 总之\n\n当您需要在无状态或短期环境中管理 LLM 交互和提示序列时，请使用 LangChain。\n\n当您需要一个具有高级工作流功能、持久会话和复杂任务编排的状态代理的强大框架时，请选择 Julep。\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"#top\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Back%20to%20Top-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Back to Top\"\u003e\n    \u003c/a\u003e\u0026nbsp;|\u0026nbsp;\n    \u003ca href=\"#-table-of-contents\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/Table%20of%20Contents-000000?style=for-the-badge\u0026logo=github\u0026logoColor=white\" alt=\"Table of Contents\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulep-ai%2Fjulep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjulep-ai%2Fjulep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjulep-ai%2Fjulep/lists"}