|
| 1 | +# Examples Index |
| 2 | + |
| 3 | +This folder contains examples usage for the different features |
| 4 | +supported by the `neo4j-graphrag` package: |
| 5 | + |
| 6 | +- [Build Knowledge Graph](#build-knowledge-graph) from PDF or text |
| 7 | +- [Retrieve](#retrieve) information from the graph |
| 8 | +- [Question Answering](#answer-graphrag) (Q&A) |
| 9 | + |
| 10 | +Each of these steps have many customization options which |
| 11 | +are listed in [the last section of this file](#customize). |
| 12 | + |
| 13 | +## Build Knowledge Graph |
| 14 | + |
| 15 | +- [End to end PDF to graph simple pipeline](build_graph/simple_kg_builder_from_pdf.py) |
| 16 | +- [End to end text to graph simple pipeline](build_graph/simple_kg_builder_from_text.py) |
| 17 | + |
| 18 | + |
| 19 | +## Retrieve |
| 20 | + |
| 21 | +- [Retriever from an embedding vector](retrieve/similarity_search_for_vector.py) |
| 22 | +- [Retriever from a text](retrieve/similarity_search_for_text.py) |
| 23 | +- [Graph-based retrieval with VectorCypherRetriever](retrieve/vector_cypher_retriever.py) |
| 24 | +- [Hybrid retriever](./retrieve/hybrid_retriever.py) |
| 25 | +- [Hybrid Cypher retriever](./retrieve/hybrid_cypher_retriever.py) |
| 26 | +- [Text2Cypher retriever](./retrieve/text2cypher_search.py) |
| 27 | + |
| 28 | + |
| 29 | +### External Retrievers |
| 30 | + |
| 31 | +#### Weaviate |
| 32 | + |
| 33 | +- [Vector search](customize/retrievers/external/weaviate/weaviate_vector_search.py) |
| 34 | +- [Text search with local embeder](customize/retrievers/external/weaviate/weaviate_text_search_local_embedder.py) |
| 35 | +- [Text search with remote embeder](customize/retrievers/external/weaviate/weaviate_text_search_remote_embedder.py) |
| 36 | + |
| 37 | +#### Pinecone |
| 38 | + |
| 39 | +- [Vector search](./customize/retrievers/external/pinecone/pinecone_vector_search.py) |
| 40 | +- [Text search](./customize/retrievers/external/pinecone/pinecone_text_search.py) |
| 41 | + |
| 42 | + |
| 43 | +### Qdrant |
| 44 | + |
| 45 | +- [Vector search](./customize/retrievers/external/qdrant/qdrant_vector_search.py) |
| 46 | +- [Text search](./customize/retrievers/external/qdrant/qdrant_text_search.py) |
| 47 | + |
| 48 | + |
| 49 | +## Answer: GraphRAG |
| 50 | + |
| 51 | +- [End to end GraphRAG](./answer/graphrag.py) |
| 52 | + |
| 53 | + |
| 54 | +## Customize |
| 55 | + |
| 56 | +### Retriever |
| 57 | + |
| 58 | +- [Control result format for VectorRetriever](customize/retrievers/result_formatter_vector_retriever.py) |
| 59 | +- [Control result format for VectorCypherRetriever](customize/retrievers/result_formatter_vector_cypher_retriever.py) |
| 60 | + |
| 61 | + |
| 62 | +### LLMs |
| 63 | + |
| 64 | +- [OpenAI (GPT)](./customize/llms/openai_llm.py) |
| 65 | +- [Azure OpenAI]() |
| 66 | +- [VertexAI (Gemini)](./customize/llms/vertexai_llm.py) |
| 67 | +- [MistralAI](./customize/llms/mistalai_llm.py) |
| 68 | +- [Cohere](./customize/llms/cohere_llm.py) |
| 69 | +- [Anthropic (Claude)](./customize/llms/anthropic_llm.py) |
| 70 | +- [Ollama]() |
| 71 | +- [Custom LLM](./customize/llms/custom_llm.py) |
| 72 | + |
| 73 | + |
| 74 | +### Prompts |
| 75 | + |
| 76 | +- [Using a custom prompt](old/graphrag_custom_prompt.py) |
| 77 | + |
| 78 | + |
| 79 | +### Embedders |
| 80 | + |
| 81 | +- [OpenAI](./customize/embeddings/openai_embeddings.py) |
| 82 | +- [Azure OpenAI](./customize/embeddings/azure_openai_embeddings.py) |
| 83 | +- [VertexAI](./customize/embeddings/vertexai_embeddings.py) |
| 84 | +- [MistralAI](./customize/embeddings/mistalai_embeddings.py) |
| 85 | +- [Cohere](./customize/embeddings/cohere_embeddings.py) |
| 86 | +- [Ollama](./customize/embeddings/ollama_embeddings.py) |
| 87 | +- [Custom LLM](./customize/embeddings/custom_embeddings.py) |
| 88 | + |
| 89 | + |
| 90 | +### KG Construction - Pipeline |
| 91 | + |
| 92 | +- [End to end example with explicit components and text input](./customize/build_graph/pipeline/kg_builder_from_text.py) |
| 93 | +- [End to end example with explicit components and PDF input](./customize/build_graph/pipeline/kg_builder_from_pdf.py) |
| 94 | + |
| 95 | +#### Components |
| 96 | + |
| 97 | +- Loaders: |
| 98 | + - [Load PDF file](./customize/build_graph/components/loaders/pdf_loader.py) |
| 99 | + - [Custom](./customize/build_graph/components/loaders/custom_loader.py) |
| 100 | +- Text Splitter: |
| 101 | + - [Fixed size splitter](./customize/build_graph/components/splitters/fixed_size_splitter.py) |
| 102 | + - [Splitter from LangChain](./customize/build_graph/components/splitters/langhchain_splitter.py) |
| 103 | + - [Splitter from LLamaIndex](./customize/build_graph/components/splitters/llamaindex_splitter.py) |
| 104 | + - [Custom](./customize/build_graph/components/splitters/custom_splitter.py) |
| 105 | +- [Chunk embedder]() |
| 106 | +- Schema Builder: |
| 107 | + - [User-defined](./customize/build_graph/components/schema_builders/schema.py) |
| 108 | +- Entity Relation Extractor: |
| 109 | + - [LLM-based](./customize/build_graph/components/extractors/llm_entity_relation_extractor.py) |
| 110 | + - [LLM-based with custom prompt](./customize/build_graph/components/extractors/llm_entity_relation_extractor_with_custom_prompt.py) |
| 111 | + - [Custom](./customize/build_graph/components/extractors/custom_extractor.py) |
| 112 | +- Knowledge Graph Writer: |
| 113 | + - [Neo4j writer](./customize/build_graph/components/writers/neo4j_writer.py) |
| 114 | + - [Custom](./customize/build_graph/components/writers/custom_writer.py) |
| 115 | +- Entity Resolver: |
| 116 | + - [SinglePropertyExactMatchResolver](./customize/build_graph/components/resolvers/simple_entity_resolver.py) |
| 117 | + - [SinglePropertyExactMatchResolver with pre-filter](./customize/build_graph/components/resolvers/simple_entity_resolver_pre_filter.py) |
| 118 | + - [Custom resolver](./customize/build_graph/components/resolvers/custom_resolver.py) |
| 119 | +- [Custom component](./customize/build_graph/components/custom_component.py) |
| 120 | + |
| 121 | + |
| 122 | +### Answer: GraphRAG |
| 123 | + |
| 124 | +- [LangChain compatibility](./customize/answer/langchain_compatiblity.py) |
| 125 | +- [Use a custom prompt](./customize/answer/custom_prompt.py) |
| 126 | + |
| 127 | + |
| 128 | +## Database Operations |
| 129 | + |
| 130 | +- [Create vector index](database_operations/create_vector_index.py) |
| 131 | +- [Create full text index](create_fulltext_index.py) |
| 132 | +- [Populate vector index](populate_vector_index.py) |
0 commit comments