TM

the-momentum/python-ai-kit

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

65 stars 15 forks 质量 71 趋势 28MIT

用于创建AI代理、MCP服务器、API微服务和单体服务的Python样板。一站式!

概览

一个用于构建真正能在生产环境中工作的人工智能代理的生产准备框架。 首先,你需要安装复印机。我们建议用UV(https://docs.astral.sh/uv/getting-started/installation/#installation-methods):)来实现。 如果你不想安装这个工具,也可以直接用 uvx 再用复印机复制命令。 不要用$TARGET_DIRECTORY,而是在你想生成项目的地方输入目录名。你可以使用间接路径。- 复制复制不会创建新目录,它只是把文件复制到$TARGET_DIRECTORY——它会从最新版本复制版本——如果你想从最新的未发布提交中抓取,可以使用flag -r HEAD(也接受远程分支名称) 如果你已经创建了项目并且模板被更新,你仍然可以更新你的项目: - 你的项目必须是git仓库才能使用这个命令——省略--defaults标志,如果你想更新答案(比如python_versions)——你也可以在这里用flag -r来更新模板版本......

概述(AI 翻译)

一个用于构建真正能在生产环境中工作的人工智能代理的生产准备框架。

🚀 快速启动

首先,你需要安装copier。我们建议用uv(https://docs.astral.sh/uv/getting-started/installation/#installation-methods):)来实现。

[!提示] 如果你不想安装这个工具,也可以直接在 copier copy 命令前使用 uvx 。

要使用此模板,请运行:

与其用 $TARGET_DIRECTORY ,不如在你想生成项目的地方设置目录名。你可以使用间接路径。

[!重要]

  • copier copy 不会创建新目录,它只是将文件复制到 $TARGET_DIRECTORY
  • 它会从最新版本复制版本
  • 如果你想从最新的未发布提交中获取,可以使用标志 -r HEAD(也接受远程分支名称)

如果你已经创建了项目并且模板被更新,你仍然可以更新你的项目:

[!重要] ——你的项目必须是git仓库才能使用这个命令

  • 如果你想更新答案(比如python_versions),可以省略--defaults标志。
  • 你也可以在这里使用标志 -r 来更新未发布版本的模板版本

🔧 可选附加组件

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Python AI Kit

A production-ready framework for building AI agents that actually work in production.

🚀 Quick Start

First, you need to have copier installed. We suggest to do it with uv (https://docs.astral.sh/uv/getting-started/installation/#installation-methods):

uv tool install copier

[!TIP] You can also just use uvx before copier copy command if you don’t want to install this tool.

To use this template, run:

copier copy https://github.com/the-momentum/python-ai-kit $TARGET_DIRECTORY --trust
# uvx copier copy https://github.com/the-momentum/python-ai-kit $TARGET_DIRECTORY --trust

Instead of $TARGET_DIRECTORY put directory name where you want to generate your project. You can use indirect path.

[!IMPORTANT]

  • copier copy DOESN’T create new directory, it just copies files to $TARGET_DIRECTORY
  • it will copy version from latest release
  • if you want to fetch from latest unreleased commit, use flag -r HEAD (also accepts remote branches names)

If you’ve already created project and templates get updated, you can still update your project:

copier update --trust --defaults
# run this inside ypur project directory

[!IMPORTANT]

  • your project HAS to be a git repo in order to use this command
  • omit --defaults flag, if you want to update answers (like python_versions)
  • you can also use flag -r here to update with template version from unreleased versions

🔧 Optional add-ons

Some setup options require extra tools to be installed beforehand. If you skip them, the template will fail when that option is selected.

DVC (Data Version Control)

  • Requires: dvc installed (e.g. uv tool install dvc) and, when enabled, AWS CLI with a profile that has access to your DVC S3 bucket.
  • During setup: You can enable DVC when prompted; you will then provide the full S3 path (starting with s3://) for the remote and the AWS region.
  • After generation: Set your AWS profile locally in the project root (stays out of Git):
    dvc remote modify --local profile (use the remote name you chose during setup)

Features

Core Framework

  • Multi-agent orchestration - Built-in support for coordinating multiple specialized agents with defined workflows and error handling
  • State management - Persistent memory across sessions using dedicated database storage and thread preservation
  • Observability by default - Integrated logging, tracing, and monitoring with Pydantic Logfire or Opik
  • Structured prompt management - Modular, versioned prompts with POML patterns instead of monolithic strings

Development & Testing

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →