AI Skill Hub 推荐使用:PostgresAI 是一款优质的Agent工作流。AI 综合评分 7.5 分,在同类工具中表现稳健。如果你正在寻找可靠的Agent工作流解决方案,这是一个值得深入了解的选择。
PostgresAI 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
PostgresAI 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install postgresai
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install postgresai
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/postgres-ai/postgresai
cd postgresai
pip install -e .
# 验证安装
python -c "import postgresai; print('安装成功')"
# 命令行使用
postgresai --help
# 基本用法
postgresai input_file -o output_file
# Python 代码中调用
import postgresai
# 示例
result = postgresai.process("input")
print(result)
# postgresai 配置文件示例(config.yml) app: name: "postgresai" debug: false log_level: "INFO" # 运行时指定配置文件 postgresai --config config.yml # 或通过环境变量配置 export POSTGRESAI_API_KEY="your-key" export POSTGRESAI_OUTPUT_DIR="./output"
postgres_ai monitoring is developed by PostgresAI, bringing years of Postgres expertise into automated monitoring and analysis tools. We provide enterprise consulting and advanced Postgres solutions for fast-growing companies.
| Component | Purpose |
|---|---|
| **Express checkup** | Instant health checks — no setup needed |
| **Grafana dashboards** | 13+ expert views: Node Overview, Query Analysis, Wait Events, Indexes, Tables, Replication, and more |
| **Scheduled reports** | 45+ metrics collected continuously via pgwatch |
| **Metrics collection** | pgwatch v3 + VictoriaMetrics |
| **AI-ready output** | Structured JSON for Claude, GPT, and other agents |
| **Claude Code plugin** | Slash commands for health checks in your IDE |
| **MCP server** | Work with Issues from [console.postgres.ai](https://console.postgres.ai) in AI coding tools |
For checkup (express mode): - Node.js 18+ (includes npm/npx) - Network access to PostgreSQL 14-18
For full monitoring stack: - Linux machine with Docker - pg_stat_statements extension enabled
postgresai mon update-config
npx postgresai prepare-db postgresql://admin@host:5432/dbname # Create monitoring role with minimal permissions npx postgresai mon local-install --api-key=YOUR_TOKEN --db-url="postgresql://..." ```
Get your API key at console.postgres.ai — or use the fully managed version there.
npx postgresai mcp install ```
<details> <summary>See demo</summary> <div align="center"> <img src="assets/demo-mcp.gif" alt="MCP install demo" width="700"> </div> </details>
This enables AI agents to work with Issues and Action Items from console.postgres.ai directly within your IDE.
mon update migrates .env (adds any newly-required keys), refreshes docker-compose.yml to the new stack version, and pulls images — all while preserving your user-managed instances.yml. It does not change PGAI_TAG, so set the new image tag yourself first — otherwise mon update just re-pulls and restarts the old version:
```bash
Deploy postgres_ai monitoring to Kubernetes using helm:
```bash
helm install postgres-ai-monitoring ./postgres_ai_helm
curl -LO https://gitlab.com/postgres-ai/postgresai/-/releases/helm-v<VERSION>/downloads/postgres-ai-monitoring-chart.tgz helm install postgres-ai-monitoring postgres-ai-monitoring-chart.tgz
helm install postgres-ai-monitoring ./postgres_ai_helm -f custom-values.yaml ```
Install dev dependencies (includes pytest, pytest-postgresql, psycopg, etc.):
python3 -m pip install -r reporter/requirements-dev.txt
For developers:
postgresai mon local-install --demo Get a complete monitoring setup with demo data in under 2 minutes.
For production: ```bash postgresai mon local-install --api-key=your_key
npx postgresai mon local-install --demo
```bash
Install from the marketplace:
claude plugin marketplace add postgres-ai/postgresai
claude plugin install pgai@postgresai
Work with Issues from console.postgres.ai:
/pgai:issues
<details> <summary>See demo</summary> <div align="center"> <img src="assets/demo-claude-code.gif" alt="Claude Code plugin demo" width="700"> </div> </details>
postgresai checkup --check-id H002 → finds unused indexesDROP INDEX or creates PR| Check ID | Title |
|---|---|
| D004 | pg_stat_statements and pg_stat_kcache settings |
PostgresAI 是一款由 PostgresAI 团队开发的专业级 PostgreSQL 监控与分析工具。它将多年的 PostgreSQL 专家经验转化为自动化监控方案,旨在为快速发展的企业提供高效的数据库健康检查、性能分析及自动化运维支持,帮助开发者从繁琐的数据库调优中解脱出来。
本项目提供了一套完整的监控生态:通过 Express checkup 实现无需配置的即时健康检查;内置丰富的 Grafana dashboards,涵盖 Node Overview、Query Analysis、Wait Events 及 Replication 等 13 个以上的专家级视图;利用 pgwatch v3 与 Victoria Metrics 实现持续的指标采集;并提供 AI-ready output,确保监控数据能够被 AI 智能体高效处理。
使用 Express checkup 模式仅需 Node.js 18+ 环境及对 PostgreSQL 14-18 的网络访问权限。若需部署完整的监控栈(Full monitoring stack),则需要一台运行 Docker 的 Linux 机器,并且必须在 PostgreSQL 中启用 pg_stat_statements 扩展。
生产环境部署需在 Linux 上使用 Docker。首先通过 npx postgresai prepare-db 命令创建具有最小权限的监控角色,随后使用 local-install 命令并配合从 console.postgres.ai 获取的 API key 进行安装。此外,支持通过 npx postgresai mcp install 安装 MCP server,以便在 AI 编程工具中直接调用。
项目提供了灵活的安装模式:开发者可以通过执行 `postgresai mon local-install --demo` 在 2 分钟内快速搭建包含演示数据的完整监控环境进行测试;而生产环境用户则应使用 `--api-key` 参数进行正式部署,以确保数据的安全性与完整性。
用户可以通过编辑 .env 文件来管理配置。特别���要注意的是,必须确保 .env 文件中的 PGAI_TAG 版本号与当前 CLI 版本保持一致。对于涉及性能、连接数或内存相关的设置,可以通过特定的 Check ID 进行精细化调整。
本项目集成了 CLI 工具与 LLM(大语言模型)能力,通过结构化的输出,使得监控数据能够无缝对接 AI 智能体,实现从数据采集到智能分析的闭环。
项目深度集成了 Claude Code 插件,支持通过 Marketplace 安装。其核心工作流如下:AI Agent 检测到应用日志中的慢查询后,自动运行 `postgresai checkup` 进行诊断,获取结构化的 JSON 分析结果,并最终由 AI 直接提出优化建议(如 DROP INDEX)甚至自动创建 Pull Request。
针对监控过程中的常见问题,如 pg_stat_statements 与 pg_stat_kcache 的配置问题,项目提供了详细的排查指南(如 Check ID D004),帮助开发者快速定位并解决数据库监控中的配置障碍。
高质量的Postgres可观测性平台,集成AI能力
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
总体来看,PostgresAI 是一款质量良好的Agent工作流,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | postgresai |
| 原始描述 | 开源AI工作流:postgresai – Postgres observability built for humans and AI agents。⭐123 · Python |
| Topics | PostgresAI工作流 |
| GitHub | https://github.com/postgres-ai/postgresai |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-05-25 · 更新时间:2026-05-30 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端