Nous 是高热度开源 Agent 框架,集成自主代理、软件工程代理和 WebUI。直接降低开发者构建智能工作流的门槛。
面向开发者、以 TypeScript 为先的 AI 平台,用于构建自主 AI Agent 和基于 LLM 的工作流。
首页 | 设置 | 可观测性 | Function calling | 自主 AI Agent | AI 软件工程师 | AI 代码审查 | 工具/集成 | 路线图
功能 | UI 示例 | 代码示例 | 参与贡献
TypedAI 是一个功能完备的平台,可用于开发和运行 Agent、基于 LLM 的工作流以及聊天机器人。
其中包括能力强大的软件工程 Agent,它们也参与协助构建了这个平台。
支持众多 LLM 服务——OpenAI、Anthropic(原生及 Vertex)、Gemini、Groq、Fireworks、Together.ai、DeepSeek、Ollama、Cerebras、SambaNova、OpenRouter、X.ai
LLM 接口的多 Agent 扩展推理实现
可配置的 Human-in-the-loop 设置
函数式可调用工具/集成(Filesystem、Jira、Slack、Perplexity、Google Cloud、GitLab、GitHub 等)
CLI 和 Web UI 界面
既可在本地运行,也可通过支持多用户/SSO 的云端部署运行
基于 OpenTelemetry 的可观测性
通过执行 Python 脚本/包,充分利用庞大的 Python AI 生态系统
TypedAI 提供了强大的命令行工具,可用于自动化和开发工作流:
# Quick examples using the ai wrapper script
ai query "What test frameworks does this repository use?"
ai code "Add error handling to the user authentication function"
ai research "Latest developments in large language models"
ai 脚本在本地运行,而 aid 则在 Docker 中运行以实现隔离。两者都可以使用全部 CLI Agent,包括专门处理自主代码编辑任务的 codeAgent。
完整的 CLI 文档请参阅 CLI 使用指南。
推理/规划机制的灵感来自 Google 的 Self-Discover 及其他论文
为复杂工作流保留记忆和 function call 历史记录
通过分层任务拆解进行迭代式规划
在沙箱中执行生成的代码,以支持多步骤 function calling 和逻辑处理
根据源代码自动生成 LLM function schema
通过 Human-in-the-loop 实现预算控制、处理 Agent 主动提出的问题以及错误处理
更多详情请参阅自主 Agent 文档。
本地代码仓库的代码编辑 Agent:自动检测项目初始化、编译、测试和 lint;任务文件选择 Agent 会选出相关文件;设计 Agent 负责制订实现方案;通过代码编辑循环完成编译、lint、测试和修复;编译错误分析器可以在线搜索、添加其他文件并安装 package;最后审查所有变更,并在必要时额外执行一轮代码编辑循环。
自动检测项目初始化、编译、测试和 lint
任务文件选择 Agent 会选出相关文件
设计 Agent 负责制订实现方案。
通过代码编辑循环完成编译、lint、测试和修复;编译错误分析器可以在线搜索、添加其他文件并安装 package
编译错误分析器可以在线搜索、添加其他文件并安装 package
最后审查所有变更,并在必要时额外执行一轮代码编辑循环。
软件工程师 Agent(用于从工单到 Pull Request 的工作流):从 GitLab/GitHub 中找到合适的代码仓库;克隆仓库并创建分支;调用代码编辑 Agent;创建 merge request
从 GitLab/GitHub 中找到合适的代码仓库
克隆仓库并创建分支
调用代码编辑 Agent
代码审查 Agent:支持配置代码审查准则;在 GitLab merge request 的相应代码行发布评论,并给出修改建议
支持配置代码审查准则
在 GitLab merge request 的相应代码行发布评论,并给出修改建议
代码仓库临时查询 Agent
代码库感知能力——可选择创建索引,供任务文件选择 Agent 使用
更多详情请参阅软件开发 Agent 文档。
可以直接从代码仓库运行,也可以使用所提供的 Dockerfile,以单用户模式运行。
在 Firestore 和 Cloud Run 上进行可缩容至零的部署
支持多用户 SSO 的企业级部署(使用 Google Cloud IAP)
Terraform、基础设施脚本以及更多身份验证选项即将推出。
示例 trace(Google Cloud)
Human-in-the-loop 通知
代码审查配置
也可以通过环境变量设置默认值。
TypedAI 没有使用 LangChain,原因有很多,你可以在网上找到相关讨论。
TypedAI 平台的功能范围涵盖了 LangChain 和 LangSmith 所提供的功能。
下面将 LangChain 文档中的 Multiple Chains 示例,与对应的 TypedAI 实现进行比较。
import { PromptTemplate } from "@langchain/core/prompts";
import { RunnableSequence } from "@langchain/core/runnables";
import { StringOutputParser } from "@langchain/core/output_parsers";
import { ChatAnthropic } from "@langchain/anthropic";
const prompt1 = PromptTemplate.fromTemplate(
`What is the city {person} is from? Only respond with the name of the city.`
);
const prompt2 = PromptTemplate.fromTemplate(
`What country is the city {city} in? Respond in {language}.`
);
const model = new ChatAnthropic({});
const chain = prompt1.pipe(model).pipe(new StringOutputParser());
const combinedChain = RunnableSequence.from([
{
city: chain,
language: (input) => input.language,
},
prompt2,
model,
new StringOutputParser(),
]);
const result = await combinedChain.invoke({
person: "Obama",
language: "German",
});
console.log(result);
import { runAgentWorkflow } from '#agent/agentWorkflowRunner';
import { anthropicLLMs } from '#llms/anthropic'
const cityFromPerson = (person: string) => `What is the city ${person} is from? Only respond with the name of the city.`;
const countryFromCity = (city: string, language: string) => `What country is the city ${city} in? Respond in ${language}.`;
runAgentWorkflow({ llms: anthropicLLMs() }, async () => {
const city = await llms().easy.generateText(cityFromPerson('Obama'));
const country = await llms().easy.generateText(countryFromCity(city, 'German'));
console.log(country);
});
TypedAI 代码还具备静态类型检查的优势,prompt 参数同样拥有静态类型,让重构变得更加轻松。使用简单的控制流,也便于通过断点或日志进行调试。
要运行一个完全自主的 Agent:
startAgent({
agentName: 'Create ollama',
initialPrompt: 'Research how to use ollama using node.js and create a new implementation under the llm folder. Look at a couple of the other files in that folder for the style which must be followed',
functions: [FileSystem, Perplexity, CodeEditinAgent],
llms,
});
只需在类方法上添加 @func decorator,即可自动生成 LLM function calling schema,避免使用 zod 或 JSON 重复定义。
@funcClass(__filename)
export class Jira {
instance: AxiosInstance | undefined;
/**
* Gets the description of a JIRA issue
* @param {string} issueId - the issue id (e.g. XYZ-123)
* @returns {Promise<string>} the issue description
*/
@func()
async getJiraDescription(issueId: string): Promise<string> {
if (!issueId) throw new Error('issueId is required');
const response = await this.axios().get(`issue/${issueId}`);
return response.data.fields.description;
}
}
我们热忱欢迎大家通过 issue、Pull Request 或讨论参与项目贡献。