Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57 changes: 57 additions & 0 deletions .github/workflows/test_memgraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: test | memgraph

on:
workflow_dispatch:
pull_request:
types: [labeled, synchronize]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
RUNTIME__LOG_LEVEL: ERROR

jobs:
run_memgraph_integration_test:
name: test
runs-on: ubuntu-22.04

defaults:
run:
shell: bash

steps:
- name: Check out
uses: actions/checkout@master

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10.x'

- name: Install Poetry
uses: snok/[email protected]
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

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

- name: Run default Memgraph
env:
ENV: 'dev'
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }}
LLM_API_KEY: ${{ secrets.LLM_API_KEY }}
LLM_API_VERSION: ${{ secrets.LLM_API_VERSION }}
EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }}
EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }}
EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }}
EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }}
GRAPH_DATABASE_URL: ${{ secrets.MEMGRAPH_API_URL }}
GRAPH_DATABASE_PASSWORD: ${{ secrets.MEMGRAPH_API_KEY }}
GRAPH_DATABASE_USERNAME: " "
run: poetry run python ./cognee/tests/test_memgraph.py
12 changes: 12 additions & 0 deletions cognee/infrastructure/databases/graph/get_graph_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ def create_graph_engine(

return KuzuAdapter(db_path=graph_file_path)

elif graph_database_provider == "memgraph":
if not (graph_database_url and graph_database_username and graph_database_password):
raise EnvironmentError("Missing required Memgraph credentials.")

from .memgraph.memgraph_adapter import MemgraphAdapter

return MemgraphAdapter(
graph_database_url=graph_database_url,
graph_database_username=graph_database_username,
graph_database_password=graph_database_password,
)

from .networkx.adapter import NetworkXAdapter

graph_client = NetworkXAdapter(filename=graph_file_path)
Expand Down
Empty file.
Loading
Loading