├── .gitignore ├── README.md ├── drop.py ├── example ├── hf_index.sh ├── hf_search.sh ├── ollama_index.sh ├── ollama_search.sh ├── openai_index.sh └── openai_search.sh ├── index.log ├── index.sh ├── requirements.txt ├── search.log ├── search.py ├── src ├── __init__.py ├── index │ ├── __init__.py │ ├── api_index.py │ ├── cypher_query.py │ ├── prompts.py │ ├── pydantic_models.py │ ├── tqdm_LLMGraphTransformer.py │ └── utils.py ├── query │ ├── __init__.py │ ├── custom_types │ │ ├── __init__.py │ │ ├── graphs │ │ │ ├── __init__.py │ │ │ ├── community.py │ │ │ └── embedding.py │ │ ├── prompts.py │ │ └── tokens.py │ ├── global_search │ │ ├── __init__.py │ │ ├── community_report.py │ │ ├── community_weight_calculator.py │ │ ├── key_points_aggregator │ │ │ ├── __init__.py │ │ │ ├── _system_prompt.py │ │ │ ├── aggregator.py │ │ │ ├── context_builder.py │ │ │ └── prompt_builder.py │ │ ├── key_points_generator │ │ │ ├── __init__.py │ │ │ ├── _output_parser.py │ │ │ ├── _system_prompt.py │ │ │ ├── context_builder.py │ │ │ ├── generator.py │ │ │ ├── prompt_builder.py │ │ │ ├── temp.txt │ │ │ └── utils.py │ │ └── search.py │ ├── local_search │ │ ├── __init__.py │ │ ├── _system_prompt.py │ │ ├── context_builders │ │ │ ├── __init__.py │ │ │ ├── communities_reports.py │ │ │ ├── context.py │ │ │ ├── entities.py │ │ │ ├── relationships.py │ │ │ └── text_units.py │ │ ├── context_selectors │ │ │ ├── __init__.py │ │ │ ├── communities_reports.py │ │ │ ├── context.py │ │ │ ├── entities.py │ │ │ ├── relationships.py │ │ │ └── text_units.py │ │ ├── prompt_builder.py │ │ ├── retriever.py │ │ └── search.py │ ├── search.py │ └── utils │ │ ├── __init__.py │ │ └── token_counter.py ├── splitter │ ├── __init__.py │ └── slide_window_splitter.py └── utils │ ├── __init__.py │ └── logger.py ├── test_change.py └── txt ├── 三体_星际交锋.txt └── 三体_星际交锋2.txt /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/.gitignore -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/README.md -------------------------------------------------------------------------------- /drop.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/drop.py -------------------------------------------------------------------------------- /example/hf_index.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/example/hf_index.sh -------------------------------------------------------------------------------- /example/hf_search.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/example/hf_search.sh -------------------------------------------------------------------------------- /example/ollama_index.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/example/ollama_index.sh -------------------------------------------------------------------------------- /example/ollama_search.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/example/ollama_search.sh -------------------------------------------------------------------------------- /example/openai_index.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/example/openai_index.sh -------------------------------------------------------------------------------- /example/openai_search.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/example/openai_search.sh -------------------------------------------------------------------------------- /index.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/index.log -------------------------------------------------------------------------------- /index.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/index.sh -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/requirements.txt -------------------------------------------------------------------------------- /search.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/search.log -------------------------------------------------------------------------------- /search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/search.py -------------------------------------------------------------------------------- /src/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/index/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/__init__.py -------------------------------------------------------------------------------- /src/index/api_index.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/api_index.py -------------------------------------------------------------------------------- /src/index/cypher_query.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/cypher_query.py -------------------------------------------------------------------------------- /src/index/prompts.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/prompts.py -------------------------------------------------------------------------------- /src/index/pydantic_models.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/pydantic_models.py -------------------------------------------------------------------------------- /src/index/tqdm_LLMGraphTransformer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/tqdm_LLMGraphTransformer.py -------------------------------------------------------------------------------- /src/index/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/index/utils.py -------------------------------------------------------------------------------- /src/query/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/__init__.py -------------------------------------------------------------------------------- /src/query/custom_types/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/query/custom_types/graphs/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/query/custom_types/graphs/community.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/custom_types/graphs/community.py -------------------------------------------------------------------------------- /src/query/custom_types/graphs/embedding.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/custom_types/graphs/embedding.py -------------------------------------------------------------------------------- /src/query/custom_types/prompts.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/custom_types/prompts.py -------------------------------------------------------------------------------- /src/query/custom_types/tokens.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/custom_types/tokens.py -------------------------------------------------------------------------------- /src/query/global_search/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/__init__.py -------------------------------------------------------------------------------- /src/query/global_search/community_report.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/community_report.py -------------------------------------------------------------------------------- /src/query/global_search/community_weight_calculator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/community_weight_calculator.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_aggregator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_aggregator/__init__.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_aggregator/_system_prompt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_aggregator/_system_prompt.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_aggregator/aggregator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_aggregator/aggregator.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_aggregator/context_builder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_aggregator/context_builder.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_aggregator/prompt_builder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_aggregator/prompt_builder.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/__init__.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/_output_parser.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/_output_parser.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/_system_prompt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/_system_prompt.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/context_builder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/context_builder.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/generator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/generator.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/prompt_builder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/prompt_builder.py -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/temp.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/temp.txt -------------------------------------------------------------------------------- /src/query/global_search/key_points_generator/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/key_points_generator/utils.py -------------------------------------------------------------------------------- /src/query/global_search/search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/global_search/search.py -------------------------------------------------------------------------------- /src/query/local_search/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/__init__.py -------------------------------------------------------------------------------- /src/query/local_search/_system_prompt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/_system_prompt.py -------------------------------------------------------------------------------- /src/query/local_search/context_builders/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_builders/__init__.py -------------------------------------------------------------------------------- /src/query/local_search/context_builders/communities_reports.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_builders/communities_reports.py -------------------------------------------------------------------------------- /src/query/local_search/context_builders/context.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_builders/context.py -------------------------------------------------------------------------------- /src/query/local_search/context_builders/entities.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_builders/entities.py -------------------------------------------------------------------------------- /src/query/local_search/context_builders/relationships.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_builders/relationships.py -------------------------------------------------------------------------------- /src/query/local_search/context_builders/text_units.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_builders/text_units.py -------------------------------------------------------------------------------- /src/query/local_search/context_selectors/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_selectors/__init__.py -------------------------------------------------------------------------------- /src/query/local_search/context_selectors/communities_reports.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_selectors/communities_reports.py -------------------------------------------------------------------------------- /src/query/local_search/context_selectors/context.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_selectors/context.py -------------------------------------------------------------------------------- /src/query/local_search/context_selectors/entities.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_selectors/entities.py -------------------------------------------------------------------------------- /src/query/local_search/context_selectors/relationships.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_selectors/relationships.py -------------------------------------------------------------------------------- /src/query/local_search/context_selectors/text_units.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/context_selectors/text_units.py -------------------------------------------------------------------------------- /src/query/local_search/prompt_builder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/prompt_builder.py -------------------------------------------------------------------------------- /src/query/local_search/retriever.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/retriever.py -------------------------------------------------------------------------------- /src/query/local_search/search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/local_search/search.py -------------------------------------------------------------------------------- /src/query/search.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/search.py -------------------------------------------------------------------------------- /src/query/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/query/utils/token_counter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/query/utils/token_counter.py -------------------------------------------------------------------------------- /src/splitter/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/splitter/slide_window_splitter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/splitter/slide_window_splitter.py -------------------------------------------------------------------------------- /src/utils/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/utils/logger.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/src/utils/logger.py -------------------------------------------------------------------------------- /test_change.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /txt/三体_星际交锋.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/txt/三体_星际交锋.txt -------------------------------------------------------------------------------- /txt/三体_星际交锋2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Bui1dMySea/LangChainGraphRAG/HEAD/txt/三体_星际交锋2.txt --------------------------------------------------------------------------------