Skip to main content

langchain_agentx

langchain_agentx 是一组基于 LangChain / LangGraph 的“代码智能体”工具函数,帮助你在自己的项目里快速集成:

  • OpenCode 风格的 LangGraph Agent(代码理解、重构、分析)
  • DeepAgent 兼容的 Agent 工厂
  • 上下文感知中间件、性能监控等基础设施

安装

发布到 PyPI 后,你可以直接通过 pip 安装:

pip install langchain-agentx

快速上手

from langchain_agentx import create_opencode_style_agent, create_opencode_style_deepagent

# 这里省略 LangChain / LangGraph 相关模型与工具配置
agent = create_opencode_style_agent(...)
deep_agent = create_opencode_style_deepagent(...)

具体的能力和使用方式可以参考源码中的 docstring 以及各模块下的 README.md。

发布新版本流程(备忘)

以下命令默认在项目根目录(c:\git_code\langchain_agentx)并已激活 kw_venv。

1. 准备代码与版本号

  • 修改版本号:编辑 pyproject.toml:
    • 把 [project] 里的 version = "0.x.y" 改成新版本(例如 0.2.0)。
  • 确认工作区干净:
    • 运行 git status,确认只有本次要发版的变更。

2. 安装构建与发布工具

只需偶尔执行一次(环境更新或新机器时):

python -m pip install -U build twine

3. 本地构建分发包

在项目根目录执行:

python -m build

构建成功后会生成:

  • dist/langchain_agentx-<version>.tar.gz
  • dist/langchain_agentx-<version>-py3-none-any.whl

4. 上传到 TestPyPI(可选,推荐先试)

  1. 在浏览器里登录 https://test.pypi.org/,创建/获取 API token。
  2. 在本机用户目录创建/编辑 ~/.pypirc:
[distutils]
index-servers =
    testpypi

[testpypi]
  username = __token__
  password = pypi-xxxxxxxxxxxxxxxxxxxx
  1. 运行上传命令:
python -m twine upload --repository testpypi dist/*
  1. 在一个干净的虚拟环境里测试安装:
python -m pip install -i https://test.pypi.org/simple/ langchain-agentx==<version>

5. 上传到正式 PyPI

  1. 在浏览器里登录 https://pypi.org/,创建/获取 API token。
  2. 在 ~/.pypirc 中增加正式仓库配置(若尚未配置):
[distutils]
index-servers =
    pypi
    testpypi

[pypi]
  username = __token__
  password = pypi-xxxxxxxxxxxxxxxxxxxx

[testpypi]
  username = __token__
  password = pypi-xxxxxxxxxxxxxxxxxxxx
  1. 上传到 PyPI:
python -m twine upload dist/*

6. 打 Tag 并推送(可选但推荐)

git add .
git commit -m "release: langchain-agentx <version>"
git tag v<version>
git push
git push --tags

下次发布时按本节从上到下依次执行即可。***

Metadata

Release files for langchain-agentx 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-agentx 0.1.1
File Size Uploaded
langchain_agentx-0.1.1.tar.gz 109.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-agentx 0.1.1
File Interpreter ABI Platform
langchain_agentx-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 240.9 kB

Release files / langchain_agentx-0.1.1.tar.gz

Download URL langchain_agentx-0.1.1.tar.gz
Size 109.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1778d165b2f0685188f8a44194dd185eb9b65e75806f7d13d279ddbea527f5e8
BLAKE2b-256 checksum
How to use checksums
775d62ba9509dfdad023acb3df1d976de608bc67395c706aeff3cffe3f3699e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / langchain_agentx-0.1.1-py3-none-any.whl

Download URL langchain_agentx-0.1.1-py3-none-any.whl
Size 131.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5580a040ff2e0f50b9331d3db057d5ee39732a6081beae565a20946f7868b89c
BLAKE2b-256 checksum
How to use checksums
d032298f07467457e0c9c1e05a845f337f9aa55c1ef81d23e1ff093108c6846c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page