MA

matiaspautasso/ai-bussiness

开发工具

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

0 stars 0 forks 质量 58 趋势 14

企业AI助手:RAG、带工具调用的AI代理、模型上下文协议(MCP)服务器及评估。TypeScript单仓库——NestJS、React、PostgreSQL + pgvector、Vercel AI SDK。

概览

这是一种企业风格,能够回答公司问题。它展示了生产型实现,an 与 、 、 、 以及 —— 构建在一个单仓库上。 投资组合项目。AI提供商位于接口(接缝)后面,因此整个系统今天运行于一个界面,并通过设置一个环境变量来切换。详见 PENDING.md。 - — 文档摄取(PDF、Markdown、纯文本)、递归文本分块、向量嵌入等,并带有索引。- — 一个多步代理(最多5步),可在四个只读和使用工具之间选择。- — 在官方 、 重复使用与HTTP API(唯一真源)完全相同的领域逻辑上,暴露相同的业务工具。- — 一个包含22个案例的数据集,评分 、 和 ,可在CI中运行。- — 基于端口和适配器背后的框架无关业务逻辑,使代码与提供者无关。- — (单元+集成)以及一个端到端的栈,经过真实PostgreSQL验证。 仓库是一个 .

概述(AI 翻译)

一款企业级的AI助手,能回答公司问题 内部文档和业务数据。它展示了生产形态 实现了检索增强生成(RAG),一个AI代理 工具调用,一个模型上下文协议(MCP)服务器,以及一个 评估套件——基于TypeScript单存储库,带有六边形 建筑。

投资组合项目。人工智能提供商位于一个接口(接缝)后面,所以 整个系统现在运行在确定性模拟上,并替换了OpenAI 设置一个环境变量。详见 PENDING.md。

精彩片段

  • RAG 流水线 — 文档摄取(PDF,Markdown,纯文本),递归 文本分块、向量嵌入和余弦相似语义搜索 PostgreSQL + pgvector,带有HNSW索引。
  • 带工具调用的AI代理 — 多步代理(最多5步),选择 介于四个只读的业务数据工具和文档搜索之间 使用Vercel AI SDK的工具。
  • 模型上下文协议(MCP)服务器 — 在

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

README

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

AI Business Assistant

An enterprise-style AI assistant that answers questions over a company’s internal documentation and business data. It demonstrates a production-shaped implementation of Retrieval-Augmented Generation (RAG), an AI agent with tool calling, a Model Context Protocol (MCP) server, and an evaluation suite — built on a TypeScript monorepo with hexagonal architecture.

Portfolio project. The AI provider sits behind an interface (a seam), so the whole system runs today against a deterministic mock and swaps in OpenAI by setting a single environment variable. See PENDING.md.

Highlights

  • RAG pipeline — document ingestion (PDF, Markdown, plain text), recursive text chunking, vector embeddings, and cosine-similarity semantic search on PostgreSQL + pgvector with an HNSW index.
  • AI agent with tool calling — a multi-step agent (max 5 steps) that chooses between four read-only business-data tools and a documentation search tool using the Vercel AI SDK.
  • Model Context Protocol (MCP) server — exposes the same business tools over the official MCP TypeScript SDK, reusing the exact same domain logic as the HTTP API (one source of truth).
  • Evaluation suite — a 22-case dataset scoring retrieval hit rate, tool-selection accuracy and answer accuracy, runnable in CI.
  • Hexagonal architecture — framework-agnostic business logic behind ports and adapters, making the code testable, AI-navigable and provider-agnostic.
  • Fully typed, fully tested — 51 automated tests (unit + integration) and an end-to-end Docker Compose stack verified against real PostgreSQL.

Tech stack

Area Technologies
Language TypeScript (strict), Node.js 20
Frontend React 19, Vite, @ai-sdk/react (streaming chat UI)
Backend NestJS, Vercel AI SDK (ai, @ai-sdk/openai)
RAG LangChain text splitters, OpenAI embeddings (mocked for now)
Database PostgreSQL, pgvector, Prisma ORM, raw SQL for vector search
Protocol Model Context Protocol (@modelcontextprotocol/* SDK)
Testing Jest, Supertest (HTTP + MCP integration)
Tooling pnpm workspaces, SWC, Docker Compose, GitHub Actions CI

Architecture

The repository is a pnpm monorepo. Business logic is written once and reused by both the HTTP API and the MCP server.

┌────────────┐     HTTP/stream      ┌─────────────────────────────┐
│  React UI  │ ───────────────────▶ │  NestJS API (apps/api)      │
│ (apps/web) │   /api proxy (nginx) │  ┌───────────────────────┐  │
└────────────┘                      │  │ AI agent + tool calling│  │
                                    │  │ RAG retrieval + ingest │  │
┌────────────┐     stdio / MCP      │  │ business use-cases     │  │
在 GitHub 查看完整 README

安装

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

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