VoltAgent 是一个开源 TypeScript 框架,用于构建和编排 AI 代理

news2025/6/2 9:11:16

​一、软件介绍

文末提供程序和源码下载

      VoltAgent 是一个开源 TypeScript 框架,用于构建和编排 AI 代理

二、什么是 VoltAgent?

AI 代理框架提供了构建由自主代理提供支持的应用程序所需的基础结构和工具。这些代理通常由大型语言模型 ()LLMs 驱动,可以感知其环境、做出决策并采取行动来实现特定目标。从头开始构建此类代理涉及管理复杂的交互LLMs、处理状态、连接到外部工具和数据以及编排工作流程。

VoltAgent 是一个开源的 TypeScript 框架,充当这个必不可少的工具包。它通过提供模块化构建块、标准化模式和抽象来简化 AI 代理应用程序的开发。无论您是创建聊天机器人、虚拟助手、自动化工作流程还是复杂的多代理系统,VoltAgent 都能处理底层的复杂性,让您专注于定义代理的功能和逻辑。

VoltAgent 不是从头开始构建所有内容,而是提供现成的模块化构建块:

  • Core Engine (@voltagent/core): The heart of VoltAgent, providing fundamental capabilities for your AI agents Define individual agents with specific roles, tools, and memory.
    核心引擎 ( @voltagent/core ):VoltAgent 的核心,为您的 AI 代理提供基本功能定义具有特定角色、工具和内存的单个代理。
  • Multi-Agent Systems: Architect complex applications by coordinating multiple specialized agents using Supervisors.
    多代理系统:通过使用 Supervisor 协调多个专用代理来构建复杂的应用程序。
  • Extensible Packages: Enhance functionality with packages like @voltagent/voice for voice interactions.
    可扩展包:使用包增强功能,例如 @voltagent/voice 用于语音交互。
  • Tooling & Integrations: Equip agents with tools to connect to external APIs, databases, and services, enabling them to perform real-world tasks. Supports the Model Context Protocol (MCP) for standardized tool interactions.
    工具和集成:为代理配备工具以连接到外部API、数据库和服务,使他们能够执行实际任务。支持用于标准化工具交互的模型上下文协议 (MCP)。
  • Data Retrieval & RAG: Implement specialized retriever agents for efficient information fetching and Retrieval-Augmented Generation (RAG).
    数据检索和RAG:实施专门的检索代理,以实现高效的信息获取和检索增强生成(RAG)。
  • Memory: Enable agents to remember past interactions for more natural and context-aware conversations.
    内存:使座席能够记住过去的交互,以实现更自然和上下文感知的对话。
  • LLM Compatibility: Works with popular AI models from OpenAI, Google, Anthropic, and more, allowing easy switching.
    LLM兼容性: 可与 OpenAI、Google、Thropic 等流行的 AI 模型配合使用,轻松切换。
  • Developer Ecosystem: Includes helpers like create-voltagent-app@voltagent/cli, and the visual VoltAgent Console for quick setup, monitoring, and debugging.
    开发人员生态系统:包括 、 @voltagent/cli 等 create-voltagent-app 帮助程序,以及用于快速设置、监控和调试的可视化 VoltAgent 控制台。

In essence, VoltAgent helps developers build sophisticated AI applications faster and more reliably, avoiding repetitive setup and the limitations of simpler tools.
从本质上讲,VoltAgent 可帮助开发人员更快、更可靠地构建复杂的 AI 应用程序,避免重复设置和更简单工具的限制。

三、为什么选择 VoltAgent?

构建 AI 应用程序通常涉及权衡:

  1. DIY Approach: Using basic AI provider tools offers control but leads to complex, hard-to-manage code and repeated effort.
    DIY 方法:使用基本的 AI 提供商工具可以提供控制权,但会导致复杂、难以管理的代码和重复的工作。
  2. No-Code Builders: Simpler initially but often restrictive, limiting customization, provider choice, and complexity.
    无代码构建器:最初更简单,但通常具有限制性,限制了定制、提供商选择和复杂性。

VoltAgent provides a middle ground, offering structure and components without sacrificing flexibility:
VoltAgent 提供了一个中间地带,在不牺牲灵活性的情况下提供结构和组件:

  • Build Faster: Accelerate development with pre-built components compared to starting from scratch.
    更快地构建:与从头开始相比,使用预构建的组件加速开发。
  • Maintainable Code: Encourages organization for easier updates and debugging.
    可维护代码:鼓励组织更轻松地进行更新和调试。
  • Scalability: Start simple and easily scale to complex, multi-agent systems handling intricate workflows.
    可扩展性:从简单开始,然后轻松扩展到处理复杂工作流程的复杂多代理系统。
  • Flexibility: Full control over agent behavior, LLM choice, tool integrations, and UI connections.
    灵活性:完全控制代理行为、LLM选择、工具集成和 UI 连接。
  • Avoid Lock-in: Freedom to switch AI providers and models as needed.
    避免锁定:根据需要自由切换 AI 提供商和模型。
  • Cost Efficiency: Features designed to optimize AI service usage and reduce redundant calls.
    成本效益:旨在优化 AI 服务使用和减少冗余调用的功能。
  • Visual Monitoring: Use the VoltAgent Console to track agent performance, inspect state, and debug visually.
    可视化监控:使用 VoltAgent 控制台跟踪代理性能、检查状态并直观地进行调试。

VoltAgent empowers developers to build their envisioned AI applications efficiently, from simple helpers to complex systems.
VoltAgent 使开发人员能够高效地构建他们设想的 AI 应用程序,从简单的帮助程序到复杂的系统。

四、Quick Start ⚡ 快速开始

使用 CLI 工具在几秒钟内创建一个新的 create-voltagent-app VoltAgent 项目:

npm create voltagent-app@latest

This command guides you through setup.
此命令将指导您完成设置。

You'll see the starter code in src/index.ts to get you started with the VoltAgent framework.
您将在 中看到 src/index.ts 起始代码,以帮助您开始使用 VoltAgent 框架。

import { VoltAgent, Agent } from "@voltagent/core";
import { VercelAIProvider } from "@voltagent/vercel-ai"; // Example provider
import { openai } from "@ai-sdk/openai"; // Example model

// Define a simple agent
const agent = new Agent({
  name: "my-agent",
  instructions: "A helpful assistant that answers questions without using tools",
  // Note: You can swap VercelAIProvider and openai with other supported providers/models
  llm: new VercelAIProvider(),
  model: openai("gpt-4o-mini"),
});

// Initialize VoltAgent with your agent(s)
new VoltAgent({
  agents: {
    agent,
  },
});

Afterwards, navigate to your project and run:
然后,导航到您的项目并运行:

npm run dev

When you run the dev command, tsx will compile and run your code. You should see the VoltAgent server startup message in your terminal:
当您运行 dev 命令时,tsx 将编译并运行您的代码。您应该会在终端中看到 VoltAgent 服务器启动消息:

<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>══════════════════════════════════════════════════
VOLTAGENT SERVER STARTED SUCCESSFULLY
══════════════════════════════════════════════════
✓ HTTP Server: http://localhost:3141

Developer Console: https://console.voltagent.dev
══════════════════════════════════════════════════
</code></span></span></span></span>

Your agent is now running! To interact with it:
您的代理现在正在运行!要与之交互,请执行以下作:

  1. Open the Console: Click the VoltAgent Console link in your terminal output (or copy-paste it into your browser).
    打开控制台:单击终端输出中的 VoltAgent 控制台链接(或将其复制粘贴到浏览器中)。
  2. Find Your Agent: On the VoltAgent Console page, you should see your agent listed (e.g., "my-agent").
    找到您的代理:在 VoltAgent 控制台页面上,您应该会看到您的代理列出(例如,“my-agent”)。
  3. Open Agent Details: Click on your agent's name.
    打开 Agent Details(代理详细信息):单击您的代理名称。
  4. Start Chatting: On the agent detail page, click the chat icon in the bottom right corner to open the chat window.
    开始聊天:在坐席详情页面,点击右下角的聊天图标,打开聊天窗口。
  5. Send a Message: Type a message like "Hello" and press Enter.
    发送消息:键入类似于“Hello”的消息,然后按 Enter。

五、Key Features 主要特点

  • Agent Core: Define agents with descriptions, LLM providers, tools, and memory management.
    Agent Core:使用描述、LLM提供程序、工具和内存管理定义代理。
  • Multi-Agent Systems: Build complex workflows using Supervisor Agents coordinating multiple specialized Sub-Agents.
    多代理系统:使用协调多个专用子代理的 Supervisor Agent 构建复杂的工作流程。
  • Tool Usage & Lifecycle: Equip agents with custom or pre-built tools (functions) with type-safety (Zod), lifecycle hooks, and cancellation support to interact with external systems.
    工具使用和生命周期:为代理配备自定义或预构建的工具(函数),具有类型安全(Zod)、生命周期钩子和取消支持,以便与外部系统交互。
  • Flexible LLM Support: Integrate seamlessly with various LLM providers (OpenAI, Anthropic, Google, etc.) and easily switch between models.
    灵活的LLM支持:与各种LLM提供商(OpenAI、Anthropic、Google 等)无缝集成,并在模型之间轻松切换。
  • Memory Management: Enable agents to retain context across interactions using different configurable memory providers.
    内存管理:使代理能够使用不同的可配置内存提供程序在交互中保留上下文。
  • Observability & Debugging: Visually monitor agent states, interactions, logs, and performance via the VoltAgent Console.
    可观察性和调试:通过VoltAgent控制台直观地监控代理状态、交互、日志和性能。
  • Voice Interaction: Build voice-enabled agents capable of speech recognition and synthesis using the @voltagent/voice package.
    语音交互:使用 @voltagent/voice 软件包构建能够进行语音识别和合成的支持语音的代理。
  • Data Retrieval & RAG: Integrate specialized retriever agents for efficient information fetching and Retrieval-Augmented Generation (RAG) from various sources.
    数据检索和RAG:集成专门的检索代理,以便从各种来源高效获取信息和检索增强生成(RAG)。
  • Model Context Protocol (MCP) Support: Connect to external tool servers (HTTP/stdio) adhering to the MCP standard for extended capabilities.
    模型上下文协议 (MCP) 支持:连接到符合 MCP 标准的外部工具服务器 (HTTP/stdio),以实现扩展功能。
  • Prompt Engineering Tools: Leverage utilities like createPrompt for crafting and managing effective prompts for your agents.
    提示工程工具: 利用实用程序 createPrompt 为您的座席制作和管理有效的提示。
  • Framework Compatibility: Designed for easy integration into existing Node.js applications and popular frameworks.
    框架兼容性:旨在轻松集成到现有的 Node.js 应用程序和流行的框架中。

六、Use Cases 使用案例

VoltAgent 用途广泛,可以为各种 AI 驱动的应用程序提供支持:

  • Complex Workflow Automation: Orchestrate multi-step processes involving various tools, APIs, and decision points using coordinated agents.
    复杂的工作流程自动化:使用协调的代理编排涉及各种工具、API 和决策点的多步骤流程。
  • Intelligent Data Pipelines: Build agents that fetch, process, analyze, and transform data from diverse sources.
    Intelligent Data Pipelines:构建代理,用于从不同来源获取、处理、分析和转换数据。
  • AI-Powered Internal Tools & Dashboards: Create interactive internal applications that leverage AI for analysis, reporting, or task automation, often integrated with UIs using hooks.
    AI驱动的内部工具和仪表板:创建利用AI进行分析、报告或任务自动化的交互式内部应用程序,通常使用钩子与UI集成。
  • Automated Customer Support Agents: Develop sophisticated chatbots that can understand context (memory), use tools (e.g., check order status), and escalate complex issues.
    自动化客户支持代理:开发复杂的聊天机器人,这些机器人可以理解上下文(记忆)、使用工具(例如,检查订单状态)并上报复杂问题。
  • Repository Analysis & Codebase Automation: Analyze code repositories, automate refactoring tasks, generate documentation, or manage CI/CD processes.
    存储库分析和代码库自动化:分析代码存储库,自动化重构任务,生成文档或管理CI/CD流程。
  • Retrieval-Augmented Generation (RAG) Systems: Build agents that retrieve relevant information from knowledge bases (using retriever agents) before generating informed responses.
    检索增强生成 (RAG) 系统:构建代理,在生成明智的响应之前从知识库中检索相关信息(使用检索代理)。
  • Voice-Controlled Interfaces & Applications: Utilize the @voltagent/voice package to create applications that respond to and generate spoken language.
    语音控制界面和应用程序:利用该 @voltagent/voice 软件包创建响应并生成口语的应用程序。
  • Personalized User Experiences: Develop agents that adapt responses and actions based on user history and preferences stored in memory.
    个性化用户体验:开发代理,根据存储在内存中的用户历史记录和偏好调整响应和作。
  • Real-time Monitoring & Alerting: Design agents that continuously monitor data streams or systems and trigger actions or notifications based on defined conditions.
    实时监控和警报:设计持续监控数据流或系统并根据定义条件触发作或通知的代理。
  • And Virtually Anything Else...: If you can imagine an AI agent doing it, VoltAgent can likely help you build it! ⚡
    以及几乎任何其他...:如果您能想象一个 AI 代理来做这件事,VoltAgent 可能会帮助您构建它!⚡

七、软件下载

夸克网盘分享

本文信息来源于GitHub作者地址:GitHub - VoltAgent/voltagent: Open Source TypeScript AI Agent Framework

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2393718.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Unity 中实现首尾无限循环的 ListView

之前已经实现过&#xff1a; Unity 中实现可复用的 ListView-CSDN博客文章浏览阅读5.6k次&#xff0c;点赞2次&#xff0c;收藏27次。源码已放入我的 github&#xff0c;地址&#xff1a;Unity-ListView前言实现一个列表组件&#xff0c;表现方面最核心的部分就是重写布局&…

mongodb集群之副本集

目录 1. 适用场景备份高可用性 2. 集群搭建如何搭建资源规划根据资源完成各节点conf文件的配置启动各个mongodb节点初始化集群信息 搭建实例Linux搭建实例&#xff08;待定&#xff09;Windows搭建实例 3. 副本集基础操作4.集群平滑升级 1. 适用场景 备份 1&#xff09;服务器…

基于微服务架构的社交学习平台WEB系统的设计与实现

设计&#xff08;论文&#xff09;题目 基于微服务架构的社交学习平台WEB系统的设计与实现 摘 要 社交学习平台 web 系统要为学习者打造一个开放、互动且社交性强的在线教育环境&#xff0c;打算采用微服务架构来设计并实现一个社交学习平台 web 系统&#xff0c;以此适应学…

放假带出门的充电宝买哪种好用耐用?倍思超能充35W了解一下!

端午节的到来和毕业季的临近&#xff0c;让很多人开始计划出游或长途旅行。而在旅途中&#xff0c;一款好用耐用的充电宝可以省不少事。今天&#xff0c;我们就来聊聊放假带出门的充电宝买哪种好用耐用&#xff0c;看看为什么倍思超能充35W更适合带出门~ 一、为什么需要一款好用…

AI智能体策略FunctionCalling和ReAct有什么区别?

Dify 内置了两种 Agent 策略&#xff1a;Function Calling 和 ReAct&#xff0c;但二者有什么区别呢&#xff1f;在使用时又该如何选择呢&#xff1f;接下来我们一起来看。 1.Function Calling Function Call 会通过将用户指令映射到预定义函数或工具&#xff0c;LLM 先识别用…

改进自己的图片 app

1. 起因&#xff0c; 目的: 前面我写过一个图片 app &#xff0c; 最新做了些改动。 把原来的一列&#xff0c;改为3列&#xff0c; 继续使用瀑布流手机上使用&#xff0c;更流畅&#xff0c;横屏显示为2列。 2. 先看效果 3. 过程: 过程太细碎了&#xff0c;这里只是做一下…

Uniapp+UView+Uni-star打包小程序极简方案

一、减少主包体积 主包污染源&#xff08;全局文件依赖&#xff09;劲量独立导入 componentsstaticmain.jsApp.vueuni.css 分包配置缺陷&#xff0c;未配置manifest.json中mp-weixin节点 "usingComponents" : true,"lazyCodeLoading" : "requiredC…

算法题(159):快速幂

审题&#xff1a; 本题需要我们计算出(a^b)%c的值&#xff0c;并按照规定格式输出 思路&#xff1a; 方法一&#xff1a;暴力解法 我们直接循环b次计算出a^b,然后再取余c&#xff0c;从而得出最终结果 时间上&#xff1a;会进行2^31次&#xff0c;他的数量级非常大&#xff0c;…

【新品发布】嵌入式人工智能实验箱EDU-AIoT ELF 2正式发布

在万物互联的智能化时代&#xff0c;将AI算法深度植入硬件终端的技术&#xff0c;正悄然改变着工业物联网、智慧交通、智慧医疗等领域的创新边界。为了助力嵌入式人工智能在教育领域实现高质量发展&#xff0c;飞凌嵌入式旗下教育品牌ElfBoard&#xff0c;特别推出嵌入式人工智…

基于javaweb的SpringBoot体检管理系统设计与实现(源码+文档+部署讲解)

技术范围&#xff1a;SpringBoot、Vue、SSM、HLMT、Jsp、PHP、Nodejs、Python、爬虫、数据可视化、小程序、安卓app、大数据、物联网、机器学习等设计与开发。 主要内容&#xff1a;免费功能设计、开题报告、任务书、中期检查PPT、系统功能实现、代码编写、论文编写和辅导、论文…

IPD的基础理论与框架——(四)矩阵型组织:打破部门壁垒,构建高效协同的底层

在传统的组织架构中&#xff0c;企业多采用直线职能制&#xff0c;就像一座等级森严的金字塔&#xff0c;信息沿着垂直的层级传递&#xff0c;员工被划分到各个职能部门。这种架构职责清晰、分工明确&#xff0c;在稳定的市场环境中&#xff0c;能让企业高效运作&#xff0c;发…

小程序为什么要安装SSL安全证书

小程序需要部署SSL安全证书&#xff0c;这是小程序开发及运营的强制性要求&#xff0c;也是保障用户数据安全、提升用户体验和满足平台规范的必要措施。 一、平台强制要求 微信小程序官方规范 微信小程序明确要求所有网络请求必须通过HTTPS协议传输&#xff0c;服务器域名需配…

python打卡训练营打卡记录day40

知识点回顾&#xff1a; 彩色和灰度图片测试和训练的规范写法&#xff1a;封装在函数中展平操作&#xff1a;除第一个维度batchsize外全部展平dropout操作&#xff1a;训练阶段随机丢弃神经元&#xff0c;测试阶段eval模式关闭dropout 作业&#xff1a;仔细学习下测试和训练代码…

【清晰教程】利用Git工具将本地项目push上传至GitHub仓库中

Git 是一个分布式版本控制系统&#xff0c;由 Linus Torvalds 创建&#xff0c;用于有效、高速地处理从小到大的项目版本管理。GitHub 是一个基于 Git 的代码托管平台&#xff0c;提供了额外的协作和社交功能&#xff0c;使项目管理更加高效。它们为项目代码管理、团队协作和持…

20250529-C#知识:静态类、静态构造函数和拓展方法

C#知识&#xff1a;静态类、静态构造函数和拓展方法 静态类一般用来编写工具类 1、静态类 用static关键字修饰的类一般充当工具类只能包含静态成员,不能包含静态索引器不能被实例化静态方法只能使用静态成员非静态方法既可以使用非静态成员&#xff0c;也可以使用静态成员 sta…

实验设计与分析(第6版,Montgomery)第4章随机化区组,拉丁方, 及有关设计4.5节思考题4.18~4.19 R语言解题

本文是实验设计与分析&#xff08;第6版&#xff0c;Montgomery著&#xff0c;傅珏生译) 第章随机化区组&#xff0c;拉丁方&#xff0c; 及有关设计4.5节思考题4.18~4.19 R语言解题。主要涉及方差分析&#xff0c;拉丁方。 batch <- c(rep("batch1",5), rep(&quo…

【吾爱】逆向实战crackme160学习记录(一)

前言 最近想拿吾爱上的crackme程序练练手&#xff0c;发现论坛上已经有pk8900总结好的160个crackme&#xff0c;非常方便&#xff0c;而且有很多厉害的前辈已经写好经验贴和方法了&#xff0c;我这里只是做一下自己练习的记录&#xff0c;欢迎讨论学习&#xff0c;感谢吾爱论坛…

vue2 + webpack 老项目升级 node v22 + vite + vue2 实战全记录

前言 随着这些年前端技术的飞速发展&#xff0c;几年前的一些老项目在最新的环境下很可能会出现烂掉的情况。如果项目不需要升级&#xff0c;只需要把编译后的文件放在那里跑而不用管的话还好。但是&#xff0c;某一天产品跑过来给你讲要升级某一个功能&#xff0c;你不得不去…

STM32的HAL编码流程总结(上部)

目录 一、GPIO二、中断系统三、USART串口通信四、I2C通信五、定时器 一、GPIO 1.选择调试类型 在SYS中Debug选择Serial Wire模式 2.选择时钟源 在RCC中将HSE和LSH都选择为内部晶振 3.时钟树配置 4.GPIO配置 在芯片图上选择开启的引脚和其功能 配置引脚的各自属性 5.工…

深度学习|pytorch基本运算

【1】引言 pytorch是深度学习常用的包&#xff0c;顾名思义&#xff0c;就是python适用的torch包&#xff0c;在python里面使用时直接import torch就可以调用。 需要注意的是&#xff0c;pytorch包与电脑配置、python版本有很大关系&#xff0c;一定要仔细阅读安装要求、找到…