Overview of the yuxi Python backend package
mainyuxi package is the core backend Python package for the Yuxi project. It is designed to be provided as a locally buildable and installable Python package for use within the backend project.repository·main·Indexed 27 days ago
https://github.com/xerrors/yuxiYuxi is a multi-tenant development platform for building intelligent knowledge bases and knowledge graph agents. It integrates RAG, Milvus-based graph storage, and LangGraph orchestration. The platform features a Vue 3 frontend, FastAPI backend, and ARQ worker system, supporting advanced reasoning with cited sources and MCP (Model Context Protocol). It includes the yuxi-cli for remote management, knowledge base uploads, and agent evaluations.
yuxi package is the core backend Python package for the Yuxi project. It is designed to be provided as a locally buildable and installable Python package for use within the backend project.Yuxi is an intelligent knowledge base and knowledge graph Agent development platform designed to build production-grade AI applications that combine Retrieval-Augmented Generation (RAG) with knowledge graph reasoning. It provides orchestration for agents, knowledge retrieval, graph reasoning, tool calling, and file system capabilities.
Yuxi is a multi-tenant agent platform designed to make enterprise knowledge retrievable, reasoned over, and deliverable by agents. It unifies RAG (Retrieval-Augmented Generation) retrieval, Milvus-backed in-knowledge-base graphs, and LangGraph multi-agent orchestration.
Key capabilities include:
The yuxi-cli is the command line client for Yuxi. It provides tools for remote management, server discovery, knowledge base management, and running agent evaluations.
Key capabilities include:
~/.yuxi/config.toml.yuxi kb upload.yuxi agent eval.Yuxi is an AI-powered intelligent knowledge base and knowledge graph agent development platform. It integrates RAG (Retrieval-Augmented Generation), Milvus-based knowledge graph storage, and LangGraph multi-agent orchestration into a unified multi-tenant workspace.
Key features include:
When Langfuse is integrated, Yuxi maps internal entities to Langfuse concepts as follows to allow for unified tracing across user, thread, and agent dimensions:
user_id.session_id.This mapping allows you to view model inputs/outputs, tool call chains, latency, and errors within a single trace, or analyze continuous multi-turn conversations within the same session.
Yuxi tests are organized into three distinct layers to balance speed and coverage. Choose the appropriate layer based on the scope of your test:
backend/test/unit): Pure logic tests that do not depend on running Docker services. Use monkeypatch, fake repositories, stubs, or tmp_path.backend/test/integration): Tests that verify real API behavior. These require a running environment via docker compose up -d and validate authentication, permissions, parameters, and side effects through actual HTTP interfaces.backend/test/e2e): End-to-end tests for critical paths (e.g., run, viewer, attachments, file persistence). These are fewer in number and slower to execute.Yuxi is a knowledge base platform designed for RAG (Retrieval-Augmented Generation), knowledge graphs, and multi-agent workflows. The system architecture consists of a Vue 3 frontend, a FastAPI backend, and an ARQ-based worker system.
Core Components:
web-dev): Vue 3 / Vite application for managing agents, knowledge bases, models, tools, Skills, MCP, and SubAgents.api-dev): FastAPI service handling HTTP requests via /api.worker-dev): ARQ worker that executes dispatched AgentRun tasks and handles exception recovery.AgentRun states, and LangGraph checkpoints.Yuxi uses a multi-layered configuration architecture. Configuration values are resolved in the following order of precedence (from lowest to highest):
saves/config/base.toml.Note that Model Configuration is managed separately via the web interface and is not part of this hierarchy.
MinerU is built-in via the mineru-api service in the all docker-compose profile. It requires a GPU. The service provides a /file_parse interface on port 30001.
To start the service:
docker compose --profile all up -d --build mineru-apiNote: The backend api and worker connect via MINERU_API_URI=http://mineru-api:30001 by default. If you encounter out-of-memory errors, you can adjust the --gpu-memory-utilization parameter in docker-compose.yml.
Yuxi provides an API Key authentication mechanism for automated system-to-system calls. API Keys are prefixed with yxkey_ and are bound to the user who created them, inheriting that user's permissions.
The following endpoints are used to manage API Keys using standard authentication:
GET /api/user/apikey/: List API Keys visible to the current user.POST /api/user/apikey/: Create a new API Key. Note: The full secret is only displayed once upon creation. Save it immediately.PUT /api/user/apikey/{api_key_id}: Update name, status, or expiration time.DELETE /api/user/apikey/{api_key_id}: Delete a key.Authorization header. Always use https://<your-domain> to prevent interception.Administrators can manage OCR settings via Settings → OCR Configuration. You can set a global default OCR method and configure endpoints or credentials for self-hosted or cloud services.
Configuration Behavior:
config_options table.