Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e9712a9
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 15, 2024
b52c45e
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 16, 2024
84c1780
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 17, 2024
47d4782
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 21, 2024
bc7a2f9
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 22, 2024
a945284
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 22, 2024
4e13c23
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 23, 2024
5367bed
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 24, 2024
21d1223
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 25, 2024
3329cd7
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 25, 2024
d8f6364
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Oct 28, 2024
4cec2f3
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Nov 4, 2024
4445b49
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Nov 5, 2024
939b18c
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Nov 18, 2024
1104519
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Nov 22, 2024
1893b85
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Nov 25, 2024
6e4ebda
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Nov 28, 2024
8db7f01
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Dec 9, 2024
d601268
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Dec 10, 2024
3b00587
Merge branch 'main' of https://github.com/neo4j/neo4j-graphrag-python
stellasia Dec 11, 2024
74ec90b
Add documentation for the "extra" dependency groups
stellasia Dec 11, 2024
f72b79a
Use multiline strings instead of mixing '' and ""
stellasia Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,32 @@ pip install neo4j-graphrag

### Optional Dependencies

This package has some optional features that can be enabled using
the extra dependencies described below:

- LLM providers (at least one is required for RAG and KG Builder Pipeline):
- **openai**: LLMs from OpenAI (including AzureOpenAI)
- **google**: LLMs from Vertex AI
- **cohere**: LLMs from Cohere
- **anthropic**: LLMs from Anthropic
- **mistralai**: LLMs from MistralAI
- **sentence-transformers** : to use embeddings from the `sentence-transformers` Python package
- Vector database (to use :ref:`External Retrievers`):
- **weaviate**: store vectors in Weaviate
- **pinecone**: store vectors in Pinecone
- **qdrant**: store vectors in Qdrant
- **experimental**: experimental features such as the Knowledge Graph creation pipelines.
- Warning: this dependency group requires `pygraphviz`. See below for installation instructions.


Install package with optional dependencies with (for instance):

```shell
pip install "neo4j-graphrag[openai]"
# or
pip install "neo4j-graphrag[openai, experimental]"
```

#### pygraphviz

`pygraphviz` is used for visualizing pipelines.
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ FilterValidationError


EmbeddingsGenerationError
========================
=========================

.. autoclass:: neo4j_graphrag.exceptions.EmbeddingsGenerationError
:show-inheritance:
Expand Down
30 changes: 30 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,36 @@ To install the latest stable version, use:

It is always recommended to install python packages for user space in a virtual environment.

*********************
Optional Dependencies
*********************

Extra dependencies can be installed with:

.. code:: bash

pip install "neo4j-graphrag[openai]"
# or
pip install "neo4j-graphrag[openai, experimental]"


List of extra dependencies:

- LLM providers (at least one is required for RAG and KG Builder Pipeline):
- **openai**: LLMs from OpenAI (including AzureOpenAI)
- **google**: LLMs from Vertex AI
- **cohere**: LLMs from Cohere
- **anthropic**: LLMs from Anthropic
- **mistralai**: LLMs from MistralAI
- **sentence-transformers** : to use embeddings from the `sentence-transformers` Python package
- Vector database (to use :ref:`External Retrievers`):
- **weaviate**: store vectors in Weaviate
- **pinecone**: store vectors in Pinecone
- **qdrant**: store vectors in Qdrant
- **experimental**: experimental features such as the Knowledge Graph creation pipelines.
- Warning: this requires `pygraphviz`. Installation instructions can be found `here <https://pygraphviz.github.io/documentation/stable/install.html>`_.


********
Examples
********
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/cohere.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class CohereEmbeddings(Embedder):
def __init__(self, model: str = "", **kwargs: Any) -> None:
if cohere is None:
raise ImportError(
"Could not import cohere python client. "
"Please install it with `pip install cohere`."
"""Could not import cohere python client.
Please install it with `pip install "neo4j-graphrag[cohere]"`."""
)
self.model = model
self.client = cohere.Client(**kwargs)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/mistral.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class MistralAIEmbeddings(Embedder):
def __init__(self, model: str = "mistral-embed", **kwargs: Any) -> None:
if Mistral is None:
raise ImportError(
"Could not import mistralai. "
"Please install it with `pip install mistralai`."
"""Could not import mistralai.
Please install it with `pip install "neo4j-graphrag[mistralai]"`."""
)
api_key = kwargs.pop("api_key", None)
if api_key is None:
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def __init__(self, model: str = "text-embedding-ada-002", **kwargs: Any) -> None
import openai
except ImportError:
raise ImportError(
"Could not import openai python client. "
"Please install it with `pip install openai`."
"""Could not import openai python client.
Please install it with `pip install "neo4j-graphrag[openai]"`."""
)
self.openai = openai
self.model = model
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/sentence_transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def __init__(
import torch
except ImportError:
raise ImportError(
"Could not import sentence_transformers python package. "
"Please install it with `pip install sentence-transformers`."
"""Could not import sentence_transformers python package.
Please install it with `pip install "neo4j-graphrag[sentence-transformers]"`."""
)
self.torch = torch
self.np = np
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/embeddings/vertexai.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ class VertexAIEmbeddings(Embedder):
def __init__(self, model: str = "text-embedding-004") -> None:
if vertexai is None:
raise ImportError(
"Could not import Vertex AI Python client. "
"Please install it with `pip install google-cloud-aiplatform`."
"""Could not import Vertex AI Python client.
Please install it with `pip install "neo4j-graphrag[google]"`."""
)
self.vertexai_model = (
vertexai.language_models.TextEmbeddingModel.from_pretrained(model)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/anthropic_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def __init__(
import anthropic
except ImportError:
raise ImportError(
"Could not import Anthropic Python client. "
"Please install it with `pip install anthropic`."
"""Could not import Anthropic Python client.
Please install it with `pip install "neo4j-graphrag[anthropic]"`."""
)
super().__init__(model_name, model_params)
self.anthropic = anthropic
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/cohere_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def __init__(
import cohere
except ImportError:
raise ImportError(
"Could not import cohere python client. "
"Please install it with `pip install cohere`."
"""Could not import cohere python client.
Please install it with `pip install "neo4j-graphrag[cohere]"`."""
)

self.cohere = cohere
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/mistralai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def __init__(
"""
if Mistral is None:
raise ImportError(
"Could not import Mistral Python client. "
"Please install it with `pip install mistralai`."
"""Could not import Mistral Python client.
Please install it with `pip install "neo4j-graphrag[mistralai]"`."""
)
super().__init__(model_name, model_params)
api_key = kwargs.pop("api_key", None)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/openai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def __init__(
import openai
except ImportError:
raise ImportError(
"Could not import openai Python client. "
"Please install it with `pip install openai`."
"""Could not import openai Python client.
Please install it with `pip install "neo4j-graphrag[openai]"`."""
)
self.openai = openai
super().__init__(model_name, model_params)
Expand Down
4 changes: 2 additions & 2 deletions src/neo4j_graphrag/llm/vertexai_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def __init__(
):
if GenerativeModel is None or ResponseValidationError is None:
raise ImportError(
"Could not import Vertex AI Python client. "
"Please install it with `pip install google-cloud-aiplatform`."
"""Could not import Vertex AI Python client.
Please install it with `pip install "neo4j-graphrag[google]"`."""
)
super().__init__(model_name, model_params)
self.model = GenerativeModel(model_name=model_name, **kwargs)
Expand Down
Loading