This document provides an overview of MaxKB, an open-source enterprise-grade AI assistant platform that integrates Retrieval-Augmented Generation (RAG) pipelines with robust workflow capabilities. MaxKB is designed to solve high technical barriers, deployment costs, and long iteration cycles faced by enterprises implementing AI solutions.
This overview covers the high-level system architecture, core components, key features, and technology stack. For detailed information about specific subsystems, see the following related pages:
MaxKB implements a layered architecture with clear separation of concerns across client, API gateway, application logic, processing, AI integration, and data layers.
Sources: installer/Dockerfile1-57 pyproject.toml1-87 apps/common/utils/tool_code.py39-277
MaxKB is organized into several Django apps, each handling a specific domain:
| Component | Location | Primary Responsibility |
|---|---|---|
| ToolExecutor | apps/common/utils/tool_code.py | Executes custom tool code in sandboxed environment |
| sandbox.so | installer/sandbox.c | C library for system call interception and security |
| CONFIG | maxkb/const.py | Global configuration management |
| WorkflowManage | Workflow engine | Orchestrates node-based workflow execution |
| PipelineManage | Pipeline system | Alternative execution model for chat flows |
| LLM Providers | langchain-* packages | Integrations with 15+ LLM services |
Sources: apps/common/utils/tool_code.py39-277 installer/sandbox.c1-592 pyproject.toml23-62
MaxKB implements a sophisticated security model for code execution:
The sandbox implementation (sandbox.c) intercepts system calls via LD_PRELOAD to enforce:
SANDBOX_PYTHON_ALLOW_SUBPROCESS)SANDBOX_PYTHON_ALLOW_SYSCALL)Sources: installer/sandbox.c1-592 apps/common/utils/tool_code.py26-90 installer/Dockerfile1-57
MaxKB provides comprehensive AI assistant capabilities through several integrated systems:
| Feature Category | Implementation | Key Code Components |
|---|---|---|
| RAG Pipeline | Document ingestion, vectorization, similarity search | sentence-transformers, pgvector, apps/dataset/ |
| Workflow Engine | Node-based DAG execution with streaming support | langgraph, WorkflowManage, workflow nodes |
| Secure Code Execution | Sandboxed tool execution with resource limits | ToolExecutor, sandbox.c, LD_PRELOAD |
| MCP Integration | Model Context Protocol for tool interoperability | langchain-mcp-adapters, MCP server config |
| Multi-LLM Support | 15+ LLM provider integrations | langchain-openai, langchain-anthropic, qianfan, zhipuai |
| Multi-Tenant System | Workspace-based resource isolation | RBAC system, workspace management |
MaxKB implements a complete RAG pipeline through the knowledge base system:
pymupdf (PDF), python-docx (Word), openpyxl (Excel), beautifulsoup4 (HTML)sentence-transformers at version 5.0.0pgvector extension for efficient similarity searchbeautifulsoup4MaxKB provides two complementary execution models:
langgraph for complex multi-step flowsThe ToolExecutor class (apps/common/utils/tool_code.py) provides sandboxed Python code execution:
sandbox.c compiled as sandbox.so and loaded via LD_PRELOADSANDBOX_PYTHON_BANNED_HOSTS)SANDBOX_PYTHON_PROCESS_LIMIT_CPU_CORES), memory (SANDBOX_PYTHON_PROCESS_LIMIT_MEM_MB), timeoutSANDBOX_PYTHON_PACKAGE_PATHS)MaxKB integrates MCP for standardized tool interaction:
ToolExecutor.get_tool_mcp_config()stdio and streamable_http transportslangchain-mcp-adapters packageMaxKB integrates with 15+ LLM providers through dedicated adapters:
| Provider Type | Providers | Integration Package |
|---|---|---|
| Western LLMs | OpenAI, Anthropic, Google Gemini, AWS Bedrock, Cohere | langchain-openai, langchain-anthropic, langchain-google-genai, langchain-aws |
| Chinese LLMs | Baidu Qianfan, Zhipu AI, Volcengine, Tencent Cloud, Alibaba Qwen, DeepSeek | qianfan, zhipuai, volcengine-python-sdk, tencentcloud-sdk-python, dashscope, langchain-deepseek |
| Local Models | Ollama, Xinference | langchain-ollama, xinference-client |
| Embedding Models | HuggingFace, Local Transformers | langchain-huggingface, sentence-transformers |
Sources: pyproject.toml23-62 apps/common/utils/tool_code.py92-277 installer/sandbox.c26-592
MaxKB is built on a modern, scalable technology stack designed for enterprise deployment:
| Component | Technology | Version | Purpose |
|---|---|---|---|
| Frontend | Vue.js | 3.x | Reactive user interface |
| Backend | Django | 5.2.4 | Web framework and APIs |
| Database | PostgreSQL | Latest | Primary data storage |
| Vector DB | pgvector | Latest | Embedding storage and search |
| Cache | Redis | Latest | Session and result caching |
| Task Queue | Celery | 5.5.3 | Asynchronous task processing |
| AI Framework | LangChain | Multiple versions | LLM integration and workflows |
| ML Library | PyTorch | 2.7.1 | Deep learning operations |
| Embeddings | Sentence Transformers | 5.0.0 | Text vectorization |
MaxKB supports multiple deployment scenarios:
docker rungunicorn for production WSGI servingSources: README.md52-56 pyproject.toml10-42 pyproject.toml72-76 apps/maxkb/settings/logging.py1-126
Refresh this wiki
This wiki was recently refreshed. Please wait 7 days to refresh again.