repowisehkuds/rag-anything

Architecture of hkuds/rag-anything

hkuds/rag-anything is 59 source files holding 481 symbols across 6 modules, written mainly in Python. The largest module is raganything, with 19 files, and 1 file is an entry point into the dependency graph.

How rag-anything fits together

Documents enter through parsing, where raganything/parser.py relies on MinerU to extract structure and separate text, images, tables and equations. The modality processors in raganything/modalprocessors.py then analyze the non-text elements, and the results feed a multimodal knowledge graph that records entities and cross-modal relationships. raganything/raganything.py and raganything/query.py are the central files for the framework and for answering queries over that graph. raganything/processor.py is also a central file of the package, and reproduce/index.py is the repository's single entry point. The examples/ directory holds runnable scripts such as raganything_example.py that show end-to-end usage.

Largest modules

  • raganything: 19 files and 10,091 lines of code
  • examples: 13 files and 3,546 lines of code
  • .github: 9 files and 238 lines of code
  • docs: 6 files and 1,287 lines of code
  • root: 5 files and 2,326 lines of code
  • reproduce: 3 files and 1,943 lines of code
  • tests: 3 files and 448 lines of code
  • scripts: 1 file and 10 lines of code

More on rag-anything: summary and FAQ, codebase overview, code health.

Related guide: Best dependency graph tools for monorepos