AGENT SKILL

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

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_file fallback.
  • 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

  1. 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.
  2. 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.
  3. 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, or outputs and writes Markdown under outputs/ocr.
  4. 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.
  5. 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:

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, and yuxi.knowledge.graphs.milvus_graph_service.MilvusGraphService.
  • Agent tools made available by the built-in knowledge-base skill dependency: list_kbs, get_mindmap, query_kb, search_file, open_kb_document, find_kb_document, and download_kb_file.
  • Agent built-in OCR helper: ocr_parse_file for 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 image read_file and 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

VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

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).

★ 351