# MaxKB4j **Repository Path**: thinkis/MaxKB4j ## Basic Information - **Project Name**: MaxKB4j - **Description**: ๐Ÿ”ฅMaxKB4j ๆ˜ฏไธ€ๆฌพๅŸบไบŽJava่ฏญ่จ€ๅผ€ๅ‘็š„LLMๅทฅไฝœๆตๅบ”็”จๅ’Œ RAG ็š„ๅผ€ๆบLLMOpsๅนณๅฐ๏ผŒ้กน็›ฎไธป่ฆๅ€Ÿ้‰ดไบ†MaxKBใ€AIFlowyใ€Difyๅ’ŒFastGPT, ไฝฟ็”จ้ซ˜ๆ€ง่ƒฝใ€้ซ˜็จณๅฎšๆ€งไปฅๅŠๅฎ‰ๅ…จๅฏ้ ็š„JAVA่ฏญ่จ€้‡ๆ–ฐ่ฎพ่ฎกๅผ€ๅ‘ใ€‚MaxKB4jๅนฟๆณ›ๅบ”็”จไบŽๆ™บ่ƒฝๅฎขๆœใ€ไผไธšๅ†…้ƒจ็Ÿฅ่ฏ†ๅบ“ใ€ๅญฆๆœฏ็ ”็ฉถไธŽๆ•™่‚ฒ็ญ‰ๅœบๆ™ฏใ€‚ - **Primary Language**: Java - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: https://tarzan.blog.csdn.net/ - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 524 - **Created**: 2026-09-03 - **Last Updated**: 2026-09-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ๐Ÿง  MaxKB4j โ€” Enterprise-Grade Intelligent Q&A System: Out-of-the-Box RAG + LLM Workflow Engine > **MaxKB4j = Max Knowledge Brain for Java** > A ready-to-use, secure, model-agnostic **RAG (Retrieval-Augmented Generation) + LLM workflow engine**, purpose-built for enterprise-grade intelligent Q&A systems. > Widely used in scenarios such as intelligent customer service, internal enterprise knowledge bases, data analysis, academic research, and education.

License: GPL v3 CI Java 21+ Spring Boot 3.x LangChain4j GitHub Stars Last Commit
[ไธญๆ–‡(็ฎ€ไฝ“)] | [English]

> ๐Ÿš€ **Quick Start**: `docker-compose up -d` -> open `http://localhost:8080` ยท ๐ŸŒ [Live Demo](http://43.143.235.194:8080/) (`demo` / `demo@123456`) > ๐Ÿ’– **Sponsor this project** โ€” if MaxKB4j helps you, consider supporting us in the **๐Ÿ’– Support & Sponsorship** section at the bottom. Every โ˜• keeps the project growing! --- ## ๐Ÿ“š Documentation - ๐Ÿ“„ [MaxKB4j Business Value Whitepaper](./docs/MaxKB4j-ๅ•†ไธšไปทๅ€ผ็™ฝ็šฎไนฆ.md) - ๐Ÿงช [MaxKB4j Regression Test Report](./docs/MaxKB4j-ๅ›žๅฝ’ๆต‹่ฏ•ๆŠฅๅ‘Š.md) - ๐Ÿ—’๏ธ [Changelog](./CHANGELOG.md) --- ## ๐Ÿ’ก Why Choose MaxKB4j? In today's AI application boom, are you facing these challenges? - โŒ Complex Integration: Existing solutions rely on the Python ecosystem, making it costly for Java teams to get started? - โŒ Serious Hallucinations: Generic large models answer inaccurately and cannot integrate with internal enterprise data? - โŒ Concurrency Bottlenecks: Traditional architectures struggle to support high-concurrency scenarios with high response latency? - โŒ Limited Functionality: Only simple Q&A, unable to handle complex business workflows and multi-Agent collaboration? **MaxKB4j Provides You with a One-Stop Solution:** Built on **Java 21 + Spring Boot 3 + Virtual Threads**, perfectly integrating **RAG (Retrieval-Augmented Generation)** with **visual workflow**. Empower your applications with AI capabilities of "understanding, reasoning, and execution" without modifying your existing systems. ### ๐Ÿ“Š How MaxKB4j Compares (Capability Matrix) | Capability | **MaxKB4j** | Dify | MaxKB | FastGPT | RAGFlow | | :--- | :--- | :--- | :--- | :--- | :--- | | Backend Stack | **Java 21 + Spring Boot 3** | Python + TS | Python (Django) | TypeScript (Node.js) | Python (Flask) | | High-Concurrency Arch | โœ… Virtual Threads + Reactive | โš ๏ธ Async workers | โš ๏ธ WSGI workers | โš ๏ธ Node event loop | โš ๏ธ Python workers | | RAG Knowledge Base | โœ… | โœ… | โœ… | โœ… | โœ… | | Visual Workflow | โœ… | โœ… | โœ… | โœ… | โœ… | | Multi-Agent Collaboration | โœ… | โœ… | โš ๏ธ | โš ๏ธ | โš ๏ธ | | MCP Protocol | โœ… | โœ… | โœ… | โœ… | โœ… | | Multimodal (ASR/TTS/OCR) | โœ… | โš ๏ธ | โœ… | โš ๏ธ | โœ… | | Triggers (Cron / Webhook) | โœ… | โœ… | โš ๏ธ | โš ๏ธ | โš ๏ธ | | Permission Management | โœ… | โœ… | โœ… | โœ… | โœ… | | Embed into Existing Systems | โœ… | โœ… | โœ… | โœ… | โœ… | | **Java-Team Adoption** | โœ… **Native - zero Python/TS** | โš ๏ธ Needs Python/TS | โš ๏ธ Needs Python | โš ๏ธ Needs TS | โš ๏ธ Needs Python | --- ## โœจ Core Features | Feature Category | Detailed Description | | :--- |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | โฐ Triggers | โ€ข **Scheduled Task Trigger**: Supports configuring Cron expressions or visual timeline for unattended automation of agents and tools (e.g., daily automatic data report generation, scheduled competitor information crawling).
โ€ข **Event Callback Trigger**: Supports Webhook integration with external system events for real-time response (e.g., automatically trigger customer profiling Agent when new leads are added in CRM, trigger alert notifications when database data changes). | | ๐Ÿ” Out-of-the-Box Knowledge Base Q&A | โ€ข Supports uploading local documents (PDF/Word/TXT/Markdown, etc.)
โ€ข Supports automatic web content crawling
โ€ข Supports custom workflow knowledge base writing
โ€ข Automatically handles: text chunking โ†’ vectorization โ†’ storage in vector database โ†’ RAG pipeline construction
โ€ข Significantly reduces LLM "hallucinations", improving answer accuracy and reliability | | ๐Ÿง  AgenticRAG & Advanced RAG | โ€ข **Advanced RAG**: Supports vector search, full-text search, and hybrid retrieval (multi-route recall); built-in Reranker node re-ranks multi-route recall results, with tunable parameters such as Top-K and similarity threshold to significantly improve retrieval accuracy.
โ€ข **AgenticRAG**: Powered by visual workflow orchestration, combines intent classification, knowledge base search, re-ranking, and conditional branching nodes; the agent dynamically decides retrieval paths and reasoning flows, supporting multi-hop Q&A and automatic decomposition of complex tasks for advanced scenarios. | | โšก High Concurrency & High Performance | โ€ข Built on Java 21 + Spring Boot 3 + Virtual Threads (Project Loom), fully leveraging modern JVM's lightweight concurrency capabilities for significantly improved throughput and response speed.
โ€ข Adopts reactive programming model (Reactor) and asynchronous non-blocking I/O, effectively handling thousands of concurrent requests with lower resource usage and lower latency.
โ€ข Built-in multi-level caching mechanism to accelerate knowledge retrieval and model invocation chains. | | ๐ŸŒ Model-Agnostic & Flexible Integration | Supports various mainstream large language models, including:
โ€ข **Local Private Models**: DeepSeek-R1, Llama 3, Qwen 2, etc. (via Ollama / Xorbits Inference / LocalAI)
โ€ข **Chinese Public Models**: Tongyi Qianwen, Tencent HunYuan, ByteDance Doubao, Baidu Qianfan, Zhipu GLM, Kimi, DeepSeek, etc.
โ€ข **International Public Models**: OpenAI (GPT), Anthropic (Claude), Google (Gemini) | | โš™๏ธ Visual Workflow Orchestration | โ€ข Built-in low-code AI workflow engine, supports conditional branching, function calling, multi-turn conversation memory, and long-term memory
โ€ข Provides a rich built-in function library (HTTP requests, database queries, time processing, regex extraction, etc.)
โ€ข Suitable for complex business scenarios: customer support ticket generation, data report interpretation, internal policy Q&A, etc. | | ๐Ÿค Multi-Agent Collaboration | โ€ข Built-in Multi-Agent collaboration framework, supports multiple specialized AI Agents working in parallel or sequentially
โ€ข Each Agent can be configured with independent roles (e.g., data analyst, code reviewer, customer service specialist), dedicated knowledge bases and toolsets
โ€ข Supports dynamic task distribution and context-aware Agent routing; complex tasks are automatically decomposed, assigned, and aggregated (e.g., user question โ†’ requirement understanding Agent โ†’ data query Agent โ†’ report generation Agent)
โ€ข Provides inter-Agent communication mechanism and shared memory bus, ensuring information consistency and collaboration coherence
โ€ข Suitable for advanced scenarios: cross-department process automation, end-to-end product design, joint fault diagnosis, etc. | | ๐Ÿงฉ Seamless Integration into Existing Systems | โ€ข Provides RESTful API and frontend embedding components (iframe / Web SDK)
โ€ข No need to modify existing systems, integrate intelligent Q&A capabilities in 5 minutes
โ€ข Provides OpenAI-compatible dialogue interface
โ€ข Provides agent integration via stream_http MCP-compatible interface | | ๐Ÿค– Skill Tools | โ€ข Supports the [MCP](https://modelcontextprotocol.io/) protocol, enabling AI to understand code context, project structure, and dependencies
โ€ข Supports local code function programming tool calls
โ€ข Supports HTTP interface tool calls
โ€ข Supports Claude SKILLS skill invocation | | ๐ŸŽ™๏ธ Multimodal Extensions | โ€ข Speech Recognition (ASR), Speech Synthesis (TTS)
โ€ข Image Recognition (OCR), Image Generation (Stable Diffusion) | | ๐Ÿ”’ User Permission Management | โ€ข Fine-grained permission control (application / knowledge base / tool / model)
โ€ข Audit logs, authentication and authorization (based on Sa-Token) | | ๐ŸŒฑ Ecosystem Extensions (Extensibility & Out-of-the-Box) | โ€ข Rich Agent template library: Provides dozens of pre-built Agent templates (e.g., customer service assistant, data analyst, code mentor, meeting note taker), one-click enable, quick adaptation to business scenarios.
โ€ข Flexible plugin tool marketplace: Supports dynamic loading of functional modules through plugin mechanism, including:
โœ… Data connectors (MySQL, PostgreSQL, MongoDB, etc.)
โœ… Third-party service integrations (Feishu, DingTalk, WeCom)
โœ… Web search tools (Google Search, SearchApi, SearXNg, etc.) | --- ## ๐Ÿš€ Quick Start ### 1. System Requirements - Java 21+ - PostgreSQL 12+ (with pgvector extension enabled) - MongoDB 6.0+ (optional, for full-text search) ### 2. Deployment #### 2.1 Local Startup (JAR Mode) ```bash # Start the application java -jar maxkb4j-start.jar ``` #### 2.2 Docker Deployment ```bash docker run --name maxkb4j -d --restart always -p 8080:8080 -e SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/MaxKB4j -e SPRING_DATASOURCE_USERNAME=postgres -e SPRING_DATASOURCE_PASSWORD=123456 -e SPRING_DATA_MONGODB_URI=mongodb://admin:123456@localhost:27017/MaxKB4j?authSource=admin registry.cn-hangzhou.aliyuncs.com/tarzanx/maxkb4j ``` - The first 8080 in `-p 8080:8080` is the host port, the second 8080 is the container port - `-e SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/MaxKB4j -e SPRING_DATASOURCE_USERNAME=postgres -e SPRING_DATASOURCE_PASSWORD=123456` are PostgreSQL database connection parameters, can be modified as needed - `-e SPRING_DATA_MONGODB_URI=mongodb://admin:123456@localhost:27017/MaxKB4j?authSource=admin` is the MongoDB connection parameter, can be modified as needed #### 2.3 Docker-Compose Deployment (Recommended) ```yaml # See docker-compose.yml example in project root directory docker-compose up -d ``` #### 2.4 Deploy to Third-Party Platforms
Deploy to Sealos
> Sealos servers are located overseas, no need to handle network issues separately, supports high concurrency & dynamic scaling. Click the button below for one-click deployment: [![](https://sealos.run/app_store/img/sealos.svg)](https://blog.csdn.net/weixin_40986713/article/details/156026021)
#### 2.5 One-Click Install Script (All-in-One) The `deploy/` directory ships interactive installers that handle prerequisite checks, image pull/build, and docker-compose orchestration end-to-end: | Script | Platform | Available Modes | | :--- | :--- | :--- | | `deploy/install.sh` | Linux / macOS | (1) Docker-Compose (prebuilt image) - (2) Source build -> image -> compose - (3) Uninstall | | `deploy/install.bat` | Windows | (1) Docker-Compose (prebuilt image) - (2) Source build -> image -> compose - (3) Uninstall | ```bash # Linux / macOS chmod +x deploy/install.sh ./deploy/install.sh # Windows (run from the project root) deploy\install.bat ``` > Pick **mode 1** to pull the prebuilt image (fastest), or **mode 2** to build from source into a local image before composing. PostgreSQL (pgvector) and MongoDB are wired up automatically. #### 2.6 Build from Source To produce the executable JAR locally with Maven (requires JDK 21+ and Maven 3.6.3+): ```bash mvn clean package -DskipTests # Output: maxkb4j-start/target/maxkb4j-start.jar java -jar maxkb4j-start/target/maxkb4j-start.jar ``` Spring profiles (`dev` / `prod` / `test`) are defined in `maxkb4j-start/src/main/resources/application-{profile}.yml`. Start with a specific profile: ```bash java -jar maxkb4j-start/target/maxkb4j-start.jar --spring.profiles.active=dev ``` > Before the first run, ensure PostgreSQL (with the `pgvector` extension) and MongoDB are reachable, and that the datasource / MongoDB URIs in the active profile are configured. ### 3. Access Web Interface - URL: http://localhost:8080/admin/login - Default username: `admin` - Default password: `tarzan@123456` > On first launch, the database (PostgreSQL + MongoDB) will be automatically initialized. Please ensure the ports are not occupied. --- ## ๐Ÿ›  Tech Stack | Category | Technology | |-----------|--------------------------------------| | **Backend** | Java 21, Spring Boot 3, Sa-Token (Authentication) | | **AI Framework** | LangChain4j | | **Vector Database** | PostgreSQL 15 + pgvector | | **Full-Text Search** | MongoDB 6.0+ | | **Caching** | Caffeine | | **Frontend** | Vue 3, Node.js v20.16.0 | | **Script Sandbox** | groovy-sandbox | --- ## ๐Ÿ“‚ Project Structure MaxKB4j adopts a layered multi-module Maven layout (parent POM driven by `${revision}`): ``` MaxKB4j/ โ”œโ”€โ”€ maxkb4j-common/ โ”œโ”€โ”€ maxkb4j-core/ โ”œโ”€โ”€ maxkb4j-service/ โ”‚ โ”œโ”€โ”€ maxkb4j-application/ โ”‚ โ”œโ”€โ”€ maxkb4j-chat/ โ”‚ โ”œโ”€โ”€ maxkb4j-knowledge/ โ”‚ โ”œโ”€โ”€ maxkb4j-model/ โ”‚ โ”œโ”€โ”€ maxkb4j-oss/ โ”‚ โ”œโ”€โ”€ maxkb4j-system/ โ”‚ โ”œโ”€โ”€ maxkb4j-tool/ โ”‚ โ”œโ”€โ”€ maxkb4j-trigger/ โ”‚ โ””โ”€โ”€ maxkb4j-workflow/ โ”œโ”€โ”€ maxkb4j-service-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-application-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-knowledge-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-model-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-oss-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-system-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-tool-api/ โ”‚ โ”œโ”€โ”€ maxkb4j-user-api/ โ”‚ โ””โ”€โ”€ maxkb4j-workflow-api/ โ”œโ”€โ”€ maxkb4j-start/ โ”‚ โ””โ”€โ”€ src/main/resources/ โ”‚ โ”œโ”€โ”€ application.yml โ”‚ โ”œโ”€โ”€ application-dev.yml โ”‚ โ”œโ”€โ”€ application-prod.yml โ”‚ โ””โ”€โ”€ application-test.yml โ”œโ”€โ”€ deploy/ โ”‚ โ”œโ”€โ”€ install.sh โ”‚ โ””โ”€โ”€ install.bat โ”œโ”€โ”€ docker-compose.yml โ””โ”€โ”€ docker-compose.dev.yml ``` | Module | Responsibility | | :--- | :--- | | `maxkb4j-common` | Shared utilities, constants, and base classes | | `maxkb4j-core` | Core abstractions and domain models | | `maxkb4j-service` | Business service implementations (application, chat, knowledge, model, oss, system, tool, trigger, workflow) | | `maxkb4j-service-api` | Public service interfaces, DTOs, and VOs | | `maxkb4j-start` | Spring Boot entry point, configuration, and packaging | | `deploy` | One-click install scripts (`install.sh` / `install.bat`) | > Dependency direction flows top-down: `start` -> `service` -> `service-api` -> `core` -> `common`. Keep public contracts in `-api` modules and implementations in `service` modules. --- ## Online Demo - URL: http://43.143.235.194:8080/ - Demo account (regular user permissions): `demo` - Demo password: `demo@123456` --- ## ๐Ÿ“ธ UI Preview MaxKB4j team --- ## ๐Ÿค Contributing Guide We welcome community contributions! If you have suggestions, bug reports, or new feature requests, please submit them via [Issue](https://gitee.com/taisan/MaxKB4j/issues) or directly submit a Pull Request. | Category | Description | | :--- |:---------------------------------------------------| | ๐ŸŽฏ How to Contribute | Fix bugs, develop new features, improve documentation, write tests, or optimize UI/UX. | | ๐Ÿ“‹ Process | Fork project โ†’ Create branch โ†’ Commit changes โ†’ Push to DEV branch โ†’ Open Pull Request. | | ๐ŸŽจ Standards | Follow Alibaba Java Coding Guidelines, include unit tests, and update documentation. | ## ๐Ÿ’– Support & Sponsorship > **๐ŸŒŸ Open source is not easy, persistence is harder** > MaxKB4j is **maintained** by individual developers and community members, with no corporate backing. Your support goes directly to server costs, token testing, API testing, bug fixes, and new feature development - keeping the project moving forward! > ๐Ÿ“Œ **Early-bird note**: the Enterprise / Strategic tiers **continue to rise in price** - current pricing is the lowest it will ever be, so lock in benefits early. ### Sponsorship Tiers | Tier | Amount | Core Benefits | Target Audience | |:---:|:---:|:---|:---| | โ˜• Coffee Support | ยฅ10 | โ€ข Add the author on **WeChat:** `vxhqqh`
โ€ข Join the core discussion group (mention "sponsored")
โ€ข Priority notification of project updates | Individual developers who recognize project value | | ๐Ÿ“š Learning Member ๐Ÿ† | ยฅ99 | โ€ข All Coffee Support benefits
โ€ข Free access to [ใ€Š๐Ÿ‘‰ Knowledge Planet๐Ÿ”ฅใ€‹](https://wx.zsxq.com/group/28882525858841)
โ€ข Priority answers to questions in the Planet | Developers who want to learn in depth | | ๐Ÿข Enterprise Partner โญ | ยฅ799 | โ€ข All Learning Member benefits
โ€ข One-time access to **frontend source code**
โ€ข After-sales technical support
โ€ข Suited for enterprise / production use (price continues to riseโ€ฆ) | Enterprise users / Advanced users | | ๐Ÿ‘‘ Strategic Partner | ยฅ1399 | โ€ข All Enterprise Partner benefits
โ€ข Free frontend source code upgrades within 6 months
โ€ข Enterprise Logo displayed on official website sponsor wall (price continues to riseโ€ฆ) | Deep cooperation partners | > ๐Ÿ† Most popularใ€€ยทใ€€โญ Best value
Alipay QR Code
WeChat QR Code
Alipay QR Code WeChat QR Code
### ๐Ÿชœ How to Sponsor 1. **Choose a tier** - pick the sponsorship tier that fits you from the table above 2. **Scan & pay** - pay via Alipay / WeChat QR code (tip: note your GitHub handle) 3. **Contact the author** - add WeChat `vxhqqh`, send the payment screenshot, and your perks will be activated right away > ๐Ÿ’ก Please contact the author after paying - otherwise we can't identify you or deliver your benefits. ### ๐Ÿ… Sponsor Wall Thanks to everyone supporting MaxKB4j (ordered by sponsorship time): > ๐ŸŽฏ We'd love to have you on board - your enterprise Logo / nickname will be displayed here, gaining continuous community exposure. ### ๐Ÿค Enterprise Custom Cooperation Need **private deployment, secondary development, team training, SLA guarantees**, or a deeper partnership? Contact the author on WeChat `vxhqqh` for a tailored plan and quote. > Sponsorship amounts are used only for continuous project development and maintenance. ๐Ÿ’ก Open source is not easy - thank you for every contribution. You are what keeps MaxKB4j moving forward! --- ## ๐Ÿ“œ License Copyright ยฉ 2025โ€“2035 Luoyang Taishan TARZAN. All rights reserved. Licensed under the GNU General Public License Version 3 (GPLv3) ("License"); you may not use this project file except in compliance with the License. You may obtain a copy of the License at [๐Ÿ”—https://www.gnu.org/licenses/gpl-3.0.html](https://www.gnu.org/licenses/gpl-3.0.html) Unless required by applicable law or agreed to in writing, software distributed under the License is provided on an "AS IS" basis, without warranties or conditions of any kind, either express or implied. See the License for the specific language governing permissions and limitations under the License. --- ## ๐Ÿ”— Related Resources - ๐Ÿ“˜ [Open-source Model Library](https://modelscope.cn/models) - ๐Ÿฆ [MCP Plaza](https://modelscope.cn/mcp) - ๐ŸŒ [Skills Center](https://modelscope.cn/skills) - ๐Ÿฆ [Skillhub](https://skillhub.cloud.tencent.com/) > ๐ŸŒŸ **Star this project to support China's open-source AI ecosystem!**
--- โœ… **MaxKB4j โ€” Easily build high-performance and stable agent workflows and RAG knowledge base solutions**