Skip to content

Commit

Permalink
Merge branch 'dev' into pgvector-add-normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
dexters1 authored Jan 24, 2025
2 parents 23ecf24 + 7d23b32 commit 89d4b7a
Show file tree
Hide file tree
Showing 19 changed files with 1,339 additions and 3,120 deletions.
40 changes: 20 additions & 20 deletions .github/workflows/profiling.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,32 @@ jobs:
echo "HEAD_SHA=${{ github.event.pull_request.head.sha }}" >> $GITHUB_ENV
# Run profiler on the base branch
- name: Run profiler on base branch
env:
BASE_SHA: ${{ env.BASE_SHA }}
run: |
echo "Profiling the base branch for code_graph_pipeline.py"
echo "Checking out base SHA: $BASE_SHA"
git checkout $BASE_SHA
echo "This is the working directory: $PWD"
# Ensure the script is executable
chmod +x cognee/api/v1/cognify/code_graph_pipeline.py
# Run Scalene
poetry run pyinstrument --renderer json -o base_results.json cognee/api/v1/cognify/code_graph_pipeline.py
# Run profiler on head branch
# - name: Run profiler on head branch
# - name: Run profiler on base branch
# env:
# HEAD_SHA: ${{ env.HEAD_SHA }}
# BASE_SHA: ${{ env.BASE_SHA }}
# run: |
# echo "Profiling the head branch for code_graph_pipeline.py"
# echo "Checking out head SHA: $HEAD_SHA"
# git checkout $HEAD_SHA
# echo "Profiling the base branch for code_graph_pipeline.py"
# echo "Checking out base SHA: $BASE_SHA"
# git checkout $BASE_SHA
# echo "This is the working directory: $PWD"
# # Ensure the script is executable
# chmod +x cognee/api/v1/cognify/code_graph_pipeline.py
# # Run Scalene
# poetry run pyinstrument --renderer json -o head_results.json cognee/api/v1/cognify/code_graph_pipeline.py
# poetry run pyinstrument --renderer json -o base_results.json cognee/api/v1/cognify/code_graph_pipeline.py

# Run profiler on head branch
- name: Run profiler on head branch
env:
HEAD_SHA: ${{ env.HEAD_SHA }}
run: |
echo "Profiling the head branch for code_graph_pipeline.py"
echo "Checking out head SHA: $HEAD_SHA"
git checkout $HEAD_SHA
echo "This is the working directory: $PWD"
# Ensure the script is executable
chmod +x cognee/api/v1/cognify/code_graph_pipeline.py
# Run Scalene
poetry run pyinstrument --renderer json -o head_results.json cognee/api/v1/cognify/code_graph_pipeline.py
# # Compare profiling results
# - name: Compare profiling results
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/reusable_python_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
description: "Location of example script to run"
required: true
type: string
arguments:
description: "Arguments for example script"
required: false
type: string
secrets:
GRAPHISTRY_USERNAME:
required: true
Expand Down Expand Up @@ -53,4 +57,4 @@ jobs:
LLM_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GRAPHISTRY_USERNAME: ${{ secrets.GRAPHISTRY_USERNAME }}
GRAPHISTRY_PASSWORD: ${{ secrets.GRAPHISTRY_PASSWORD }}
run: poetry run python ${{ inputs.example-location }}
run: poetry run python ${{ inputs.example-location }} ${{ inputs.arguments }}
22 changes: 22 additions & 0 deletions .github/workflows/test_code_graph_example.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: test | code graph example

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


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

jobs:
run_simple_example_test:
uses: ./.github/workflows/reusable_python_example.yml
with:
example-location: ./examples/python/code_graph_example.py
arguments: "--repo_path ./evals"
secrets:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GRAPHISTRY_USERNAME: ${{ secrets.GRAPHISTRY_USERNAME }}
GRAPHISTRY_PASSWORD: ${{ secrets.GRAPHISTRY_PASSWORD }}
32 changes: 32 additions & 0 deletions Dockerfile_modal
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM python:3.11-slim

# Set environment variables
ENV PIP_NO_CACHE_DIR=true
ENV PATH="${PATH}:/root/.poetry/bin"
ENV PYTHONPATH=/app
ENV RUN_MODE=modal
ENV SKIP_MIGRATIONS=true

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

WORKDIR /app


ENV PYTHONPATH=/app
WORKDIR /app
COPY pyproject.toml poetry.lock /app/


RUN pip install poetry

RUN poetry install --all-extras --no-root --without dev

COPY cognee/ /app/cognee
COPY README.md /app/README.md
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,28 @@ Please see the cognee [Development Guide](https://docs.cognee.ai/quickstart/) fo
```bash
pip install cognee
```
### Deployment at Scale (Modal)

Scale cognee in 4(+1) simple steps to handle enterprise workloads using [Modal](https://modal.com)'s GPU-powered infrastructure

**1. Install the modal python client**
```bash
pip install modal
```
**2. Create a free account on [Modal](https://modal.com)**

**3. Set Up Modal API Key**
```bash
modal token set --token-id TOKEN_ID --token-secret TOKEN_SECRET --profile=PROFILE
modal profile activate PROFILE
```
**4. Run cognee example**

This simple example will deploy separate cognee instances building their own memory stores and answering a list of questions at scale.
```bash
modal run -d modal_deployment.py
```
**5. Change the modal_deploy script and develop your own AI memory at scale 🚀**

## 💫 Contributors

Expand Down
45 changes: 12 additions & 33 deletions cognee-mcp/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
# cognee MCP server




### Installing Manually
A MCP server project
=======
1. Clone the [cognee](https://github.com/topoteretes/cognee) repo



2. Install dependencies

```
pip install uv
```
```
brew install postgresql
```

```
brew install rust
brew install uv
```

```jsx
cd cognee-mcp
uv sync --dev --all-extras
uv sync --dev --all-extras --reinstall
```

3. Activate the venv with
Expand All @@ -48,8 +36,6 @@ nano claude_desktop_config.json
```

```
{
"mcpServers": {
"cognee": {
Expand All @@ -65,16 +51,7 @@ nano claude_desktop_config.json
"TOKENIZERS_PARALLELISM": "false",
"LLM_API_KEY": "sk-"
}
},
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/Users/{user}/Desktop",
"/Users/{user}/Projects"
]
}
}
}
}
```
Expand All @@ -95,13 +72,15 @@ Restart your Claude desktop.

To use debugger, run:
```bash
npx @modelcontextprotocol/inspector uv --directory /Users/name/folder run cognee
mcp dev src/server.py
```
Open inspector with timeout passed:
```
http://localhost:5173?timeout=120000
```

To apply new changes while development you do:

1. Poetry lock in cognee folder
2. uv sync --dev --all-extras --reinstall
3. npx @modelcontextprotocol/inspector uv --directory /Users/vasilije/cognee/cognee-mcp run cognee

To apply new changes while developing cognee you need to do:

1. `poetry lock` in cognee folder
2. `uv sync --dev --all-extras --reinstall `
3. `mcp dev src/server.py`
15 changes: 0 additions & 15 deletions cognee-mcp/cognee_mcp/__init__.py

This file was deleted.

Loading

0 comments on commit 89d4b7a

Please sign in to comment.