Skip to content

Commit

Permalink
Merge pull request #241 from topoteretes/COG-595-optional-dependencies
Browse files Browse the repository at this point in the history
chore: Add optional dependencies
  • Loading branch information
Vasilije1990 authored Dec 2, 2024
2 parents b0eb9af + ec65354 commit 1c47870
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 110 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_neo4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
installer-parallel: true

- name: Install dependencies
run: poetry install --no-interaction
run: poetry install -E neo4j --no-interaction

- name: Run default Neo4j
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_qdrant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
installer-parallel: true

- name: Install dependencies
run: poetry install --no-interaction
run: poetry install -E qdrant --no-interaction

- name: Run default Qdrant
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_weaviate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
installer-parallel: true

- name: Install dependencies
run: poetry install --no-interaction
run: poetry install -E weaviate --no-interaction

- name: Run default Weaviate
env:
Expand Down
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ If you have questions, join our <a href="https://discord.gg/NQPKmU5CCg">Discord

## 📦 Installation

You can install Cognee using either **pip** or **poetry**.
Support for various databases and vector stores is available through extras.

### With pip

```bash
Expand All @@ -32,6 +35,24 @@ pip install cognee
pip install 'cognee[postgres]'
```

### With pip with Weaviate support

```bash
pip install 'cognee[weaviate]'
```

### With pip with Qdrant support

```bash
pip install 'cognee[qdrant]'
```

### With pip with Neo4j support

```bash
pip install 'cognee[neo4j]'
```

### With poetry

```bash
Expand All @@ -44,6 +65,24 @@ poetry add cognee
poetry add cognee -E postgres
```

### With poetry with Weaviate support

```bash
poetry add cognee -E weaviate
```

### With poetry with Qdrant support

```bash
poetry add cognee -E qdrant
```

### With poetry with Neo4j support

```bash
poetry add cognee -E neo4j
```


## 💻 Basic Usage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import asyncio
from uuid import UUID
from pgvector.sqlalchemy import Vector
from typing import List, Optional, get_type_hints
from sqlalchemy.orm import Mapped, mapped_column
from sqlalchemy import JSON, Column, Table, select, delete
Expand Down Expand Up @@ -68,6 +67,8 @@ async def create_collection(self, collection_name: str, payload_schema=None):
vector_size = self.embedding_engine.get_vector_size()

if not await self.has_collection(collection_name):

from pgvector.sqlalchemy import Vector
class PGVectorDataPoint(Base):
__tablename__ = collection_name
__table_args__ = {"extend_existing": True}
Expand Down Expand Up @@ -105,6 +106,7 @@ async def create_data_points(

vector_size = self.embedding_engine.get_vector_size()

from pgvector.sqlalchemy import Vector
class PGVectorDataPoint(Base):
__tablename__ = collection_name
__table_args__ = {"extend_existing": True}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from ...relational.ModelBase import Base
from ..get_vector_engine import get_vector_engine, get_vectordb_config
from sqlalchemy import text

Expand Down
Loading

0 comments on commit 1c47870

Please sign in to comment.