knowledge-and-ocr
Operate Yuxi knowledge-base, retrieval, document parsing, OCR, graph, mindmap, and knowledge evaluation workflows safely.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- knowledge-and-ocr
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Operate Yuxi knowledge-base, retrieval, document parsing, OCR, graph, mindmap, and knowledge evaluation workflows safely.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/knowledge-workflows.md15.7 KB
- 参考文档references/ocr-engine-matrix.md9.7 KB
- 参考文档references/troubleshooting.md12.3 KB
03 SKILL.md 正文
Yuxi knowledge and OCR operating guide
Load this sub-skill when the task touches Yuxi knowledge bases, RAG retrieval, document upload/parse/chunk/index flows, OCR configuration, graph/mindmap features, knowledge evaluation, KB agent tools, or read_file OCR fallback behavior.
Owned capabilities
- Knowledge-base types: Milvus document KBs, Dify Dataset read-only retrieval connectors, and Notion Data Source read-only retrieval connectors.
- Document lifecycle: upload/import/fetch, file records, parsing to Markdown, chunking/indexing, re-indexing, file search/open/find/download, previews, and image proxy handling.
- Retrieval: vector, keyword/BM25, hybrid, reranker, file-name scoped search, and optional graph-enhanced retrieval for Milvus KBs.
- OCR: default engine resolution, per-file engine selection, config/health endpoints, local/service/cloud engines, and agent
ocr_parse_filefallback. - Knowledge structure: mindmap generation/diff/incremental update, generated sample questions, Milvus knowledge graph build/query/reset/reconcile.
- Evaluation: JSONL benchmark upload, LLM-generated benchmarks, RAG evaluation runs, result inspection, and metrics interpretation.
Use sibling sub-skills instead for deployment startup details, CLI command syntax, agent runtime internals unrelated to KB data, or general repo development workflow.
Safety gates before acting
- Classify the runtime need. Parser facade and metadata checks are CPU-safe; real KB ingestion/retrieval requires running services such as API, Postgres, Redis/task workers, MinIO, and Milvus. Graph build also needs Neo4j and a configured LLM provider. Some OCR engines require GPU services or cloud credentials.
- Do not assume credentials. Dify, Notion, MinerU Official, DeepSeek OCR, PaddleOCR API, rerankers, embeddings, and LLM-based graph/evaluation features may call external services. Confirm credentials and side effects before running them.
- Respect file boundaries. Knowledge files should enter via Yuxi upload/import/fetch APIs and be stored in MinIO before document record creation. Agent OCR fallback only accepts sandbox virtual paths under user-data
workspace,uploads, oroutputsand writes Markdown underoutputs/ocr. - Do not treat read-only connectors as Milvus. Dify and Notion are normal KB types for retrieval, but public document upload/open/find/download workflows are gated to document-supporting KBs; expect read-only connectors to reject file operations.
- Keep secrets out of logs and artifacts. Config APIs intentionally redact sensitive values; never print tokens or API keys while debugging.
First routing question
Choose the narrow workflow before touching code or services:
- Create/query/manage a KB: use references/knowledge-workflows.md.
- OCR or parser issue: use references/ocr-engine-matrix.md first, then references/troubleshooting.md.
- Agent KB tools: use references/knowledge-workflows.md.
- Graph or mindmap: use references/knowledge-workflows.md.
- Knowledge evaluation: use references/knowledge-workflows.md.
- Unknown failure: use references/troubleshooting.md and classify by KB type, file status, OCR engine, service dependency, and credential requirement.
Safe entry points
Prefer these entry points because they preserve Yuxi's permission, config, storage, and task semantics:
- Web/API routes under
/api/knowledge/*,/api/system/ocr/*,/api/system/config*,/api/system/config/options*,/api/evaluation/*, and/api/graph/*. - Python service/facade calls:
yuxi.knowledge.runtime.knowledge_base,yuxi.services.ocr_service.parse_document,yuxi.services.ocr_service.get_ocr_options,yuxi.services.ocr_service.check_all_ocr_health, andyuxi.knowledge.graphs.milvus_graph_service.MilvusGraphService. - Agent tools made available by the built-in
knowledge-baseskill dependency:list_kbs,get_mindmap,query_kb,search_file,open_kb_document,find_kb_document, anddownload_kb_file. - Agent built-in OCR helper:
ocr_parse_filefor sandbox PDF/Office/image to Markdown conversion.
Avoid calling low-level parser functions directly unless the task is specifically parser internals. The business entry point is parse_document; low-level PDF/image parsers expect an already resolved ocr_engine and can bypass DB/environment fallback if called incorrectly.
Verification candidates
- CPU-safe native candidate:
pytest backend/test/unit/knowledge/test_parser_facade.py— proves parser registry metadata, engine selection, parser facade, credential-safe cache keys, and common document conversion behavior. - Service-required candidate:
pytest backend/test/e2e/test_ocr_config_center_e2e.py— proves configured default OCR drives real temporary attachment parsing when API services and MinIO are available. - Service/model-required candidate:
pytest backend/test/e2e/test_read_file_multimodal_e2e.py— proves imageread_fileand non-vision OCR fallback only when model/OCR prerequisites are configured.
Run service-required candidates only after the deployment sub-skill's runtime checks pass and the needed credentials/providers are approved.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).