Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0cf07fa
chore: update cognee version
borisarzentar Apr 19, 2025
8a61e4b
fix: remove filesystem extra
borisarzentar Apr 21, 2025
fab80f3
version: v0.1.38
borisarzentar Apr 21, 2025
66da3d2
Document collection of usage data and how to opt out (#767)
jan-mue Apr 22, 2025
22f106c
feat: expose document deletion via the API (#768)
soobrosa Apr 23, 2025
9bceb98
fix: remove chromadb test from github workflow
borisarzentar Apr 23, 2025
012f1e0
fix: remove filesystem extra
borisarzentar Apr 23, 2025
c5cba01
fix: fixes cases when llm generates inconsistent output (#773)
hajdul88 Apr 23, 2025
60da1c8
fix: graph prompt path (#769)
dexters1 Apr 23, 2025
f404386
fix: hotfix 0.1.38 (#765)
dexters1 Apr 23, 2025
5daa991
Merge remote-tracking branch 'origin/main' into dev
borisarzentar Apr 23, 2025
94c892d
fix: return appropriate result type for chunks search in mcp (#777)
dexters1 Apr 23, 2025
c6ba7a4
version: v0.1.39
borisarzentar Apr 23, 2025
49f2e51
chore: upgrade cognee to 0.1.39 in cognee-mcp
borisarzentar Apr 23, 2025
b9a7c53
fix: run cognee in Docker [COG-1961] (#775) (#779)
borisarzentar Apr 23, 2025
e577363
fix: add missing build tools to mcp docker image
borisarzentar Apr 24, 2025
f94076b
fix: add missing clang build dependency
borisarzentar Apr 24, 2025
7d7df18
Add available languages (#776)
hande-k Apr 25, 2025
500fa9f
feat: Translate README into Portuguese (#762)
diegoabt Apr 30, 2025
0b8931e
Add Russian translations for README and graph visualization (#802)
dm1tryG May 6, 2025
6a1fca8
Update README.md
Vasilije1990 May 6, 2025
2faf238
Update README.md
Vasilije1990 May 6, 2025
0aac93e
Merge dev to main (#827)
borisarzentar May 15, 2025
b1b4ae3
fix: Add baseline overview (#832)
Vasilije1990 May 16, 2025
822cc55
Update Memgraph integration (#850)
matea16 May 23, 2025
4137986
Merge changes from cognee main
Sudhamsha May 28, 2025
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
8 changes: 6 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ EMBEDDING_API_VERSION=""
EMBEDDING_DIMENSIONS=3072
EMBEDDING_MAX_TOKENS=8191

# "neo4j", "networkx" or "kuzu"
# "neo4j", "networkx", "kuzu" or "memgraph"
GRAPH_DATABASE_PROVIDER="networkx"
# Only needed if using neo4j
# Only needed if using neo4j or memgraph
GRAPH_DATABASE_URL=
GRAPH_DATABASE_USERNAME=
GRAPH_DATABASE_PASSWORD=
Expand Down Expand Up @@ -65,3 +65,7 @@ DB_NAME=cognee_db

# LITELLM Logging Level. Set to quiten down logging
LITELLM_LOG="ERROR"

# Set this environment variable to disable sending telemetry data
# TELEMETRY_DISABLED=1

2 changes: 1 addition & 1 deletion .github/actions/cognee_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ runs:

- name: Install dependencies
shell: bash
run: poetry install --no-interaction -E api -E docs -E evals -E gemini -E codegraph -E ollama
run: poetry install --no-interaction -E api -E docs -E evals -E gemini -E codegraph -E ollama -E dev
3 changes: 2 additions & 1 deletion .github/workflows/dockerhub-mcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ jobs:
id: build
uses: docker/build-push-action@v5
with:
context: cognee-mcp
context: .
platforms: linux/amd64,linux/arm64
push: true
file: cognee-mcp/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=cognee/cognee-mcp:buildcache
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/python_version_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ jobs:
python-version: ${{ inputs.python-version }}

- name: Run unit tests
shell: bash
run: poetry run pytest cognee/tests/unit/
env:
PYTHONUTF8: 1
LLM_PROVIDER: openai
LLM_MODEL: ${{ secrets.LLM_MODEL }}
LLM_ENDPOINT: ${{ secrets.LLM_ENDPOINT }}
Expand All @@ -74,10 +76,26 @@ jobs:

- name: Run integration tests
if: ${{ !contains(matrix.os, 'windows') }}
shell: bash
run: poetry run pytest cognee/tests/integration/
env:
PYTHONUTF8: 1
LLM_PROVIDER: openai
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_PROVIDER: openai
EMBEDDING_MODEL: ${{ secrets.EMBEDDING_MODEL }}
EMBEDDING_ENDPOINT: ${{ secrets.EMBEDDING_ENDPOINT }}
EMBEDDING_API_KEY: ${{ secrets.EMBEDDING_API_KEY }}
EMBEDDING_API_VERSION: ${{ secrets.EMBEDDING_API_VERSION }}

- name: Run default basic pipeline
shell: bash
env:
PYTHONUTF8: 1
GRAPHISTRY_USERNAME: ${{ secrets.GRAPHISTRY_USERNAME }}
GRAPHISTRY_PASSWORD: ${{ secrets.GRAPHISTRY_PASSWORD }}

Expand All @@ -95,6 +113,7 @@ jobs:
run: poetry run python ./cognee/tests/test_library.py

- name: Build with Poetry
shell: bash
run: poetry build

- name: Install Package
Expand Down
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
86 changes: 43 additions & 43 deletions .github/workflows/vector_db_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,49 +17,49 @@ on:
required: false

jobs:
run-chromadb-tests:
name: ChromaDB Tests
runs-on: ubuntu-22.04
if: ${{ inputs.databases == 'all' || contains(inputs.databases, 'chromadb') }}
services:
chromadb:
image: chromadb/chroma:0.6.3
env:
CHROMA_SERVER_AUTH_CREDENTIALS: "test-token"
CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER: "chromadb.auth.token.TokenAuthCredentialsProvider"
CHROMA_SERVER_AUTH_PROVIDER: "chromadb.auth.token.TokenAuthServerProvider"
ports:
- 3002:8000
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Cognee Setup
uses: ./.github/actions/cognee_setup
with:
python-version: ${{ inputs.python-version }}

- name: Install specific db dependency
run: |
poetry install -E chromadb

- name: Run ChromaDB Tests
env:
ENV: 'dev'
VECTOR_DB_PROVIDER: chromadb
VECTOR_DB_URL: http://localhost:3002
VECTOR_DB_KEY: test-token
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 }}
run: poetry run python ./cognee/tests/test_chromadb.py
# run-chromadb-tests:
# name: ChromaDB Tests
# runs-on: ubuntu-22.04
# if: ${{ inputs.databases == 'all' || contains(inputs.databases, 'chromadb') }}
# services:
# chromadb:
# image: chromadb/chroma:0.6.3
# env:
# CHROMA_SERVER_AUTH_CREDENTIALS: "test-token"
# CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER: "chromadb.auth.token.TokenAuthCredentialsProvider"
# CHROMA_SERVER_AUTH_PROVIDER: "chromadb.auth.token.TokenAuthServerProvider"
# ports:
# - 3002:8000
# steps:
# - name: Check out
# uses: actions/checkout@v4
# with:
# fetch-depth: 0

# - name: Cognee Setup
# uses: ./.github/actions/cognee_setup
# with:
# python-version: ${{ inputs.python-version }}

# - name: Install specific db dependency
# run: |
# poetry install -E chromadb

# - name: Run ChromaDB Tests
# env:
# ENV: 'dev'
# VECTOR_DB_PROVIDER: chromadb
# VECTOR_DB_URL: http://localhost:3002
# VECTOR_DB_KEY: test-token
# 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 }}
# run: poetry run python ./cognee/tests/test_chromadb.py

run-weaviate-tests:
name: Weaviate Tests
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ git push origin feature/your-feature-name

2. Create a Pull Request:
- Go to the [**cognee** repository](https://github.com/topoteretes/cognee)
- Click "Compare & Pull Request" and make sure to open PR against dev branch
- Click "Compare & Pull Request"
- Fill in the PR template with details about your changes

## 5. 📜 Developer Certificate of Origin (DCO)
Expand Down
84 changes: 46 additions & 38 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,58 +1,66 @@
FROM python:3.11-slim

# Define Poetry extras to install
ARG POETRY_EXTRAS="\
# API \
api \
# Storage & Databases \
filesystem postgres weaviate qdrant neo4j falkordb milvus kuzu chromadb \
# Notebooks & Interactive Environments \
notebook \
# LLM & AI Frameworks \
langchain llama-index gemini huggingface ollama mistral groq anthropic \
# Evaluation & Monitoring \
deepeval evals posthog \
# Graph Processing & Code Analysis \
codegraph graphiti \
# Document Processing \
docs"
# Use a Python image with uv pre-installed
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS uv

# Install the project into `/app`
WORKDIR /app

# Enable bytecode compilation
# ENV UV_COMPILE_BYTECODE=1

# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy

# Set build argument
ARG DEBUG

# Set environment variable based on the build argument
ENV DEBUG=${DEBUG}
ENV PIP_NO_CACHE_DIR=true
ENV PATH="${PATH}:/root/.poetry/bin"

# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
libpq-dev \
curl
gcc \
libpq-dev \
git \
curl \
clang \
build-essential \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY pyproject.toml poetry.lock /app/
# Copy pyproject.toml and lockfile first for better caching
COPY README.md pyproject.toml uv.lock entrypoint.sh ./

RUN pip install poetry
# Install the project's dependencies using the lockfile and settings
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --extra debug --extra api --extra postgres --extra weaviate --extra qdrant --extra neo4j --extra kuzu --extra llama-index --extra gemini --extra ollama --extra mistral --extra groq --extra anthropic --frozen --no-install-project --no-dev --no-editable

# Don't create virtualenv since Docker is already isolated
RUN poetry config virtualenvs.create false
# Copy Alembic configuration
COPY alembic.ini /app/alembic.ini
COPY alembic/ /app/alembic

# Install the dependencies using the defined extras
RUN poetry install --extras "${POETRY_EXTRAS}" --no-root --without dev
# Then, add the rest of the project source code and install it
# Installing separately from its dependencies allows optimal layer caching
COPY ./cognee /app/cognee
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --extra debug --extra api --extra postgres --extra weaviate --extra qdrant --extra neo4j --extra kuzu --extra llama-index --extra gemini --extra ollama --extra mistral --extra groq --extra anthropic --frozen --no-dev --no-editable

# Set the PYTHONPATH environment variable to include the /app directory
ENV PYTHONPATH=/app
FROM python:3.12-slim-bookworm

COPY cognee/ /app/cognee
# Install runtime dependencies
RUN apt-get update && apt-get install -y \

Check warning on line 49 in Dockerfile

View check run for this annotation

Orca Security (AU) / Orca Security - Infrastructure as Code

[INFO] APT-GET Not Avoiding Additional Packages

Details: Check if any apt-get installs don't use '--no-install-recommends' flag to avoid installing additional packages. Recommendation: 'RUN apt-get update && apt-get install -y libpq5 && rm -rf /var/lib/apt/lists/*' uses '--no-install-recommends' flag to avoid installing additional packages

Check warning on line 49 in Dockerfile

View check run for this annotation

Orca Security (AU) / Orca Security - Infrastructure as Code

[LOW] Apt Get Install Pin Version Not Defined

Details: When installing a package, its pin version should be defined Recommendation: Package 'libpq5' has version defined
libpq5 \
&& rm -rf /var/lib/apt/lists/*

# Copy Alembic configuration
COPY alembic.ini /app/alembic.ini
COPY alembic/ /app/alembic
WORKDIR /app

COPY --from=uv /app /app
# COPY --from=uv /app/.venv /app/.venv
# COPY --from=uv /root/.local /root/.local

COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh

RUN sed -i 's/\r$//' /app/entrypoint.sh
# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"

ENV PYTHONPATH=/app

ENTRYPOINT ["/app/entrypoint.sh"]
Loading
Loading