Skip to content

Commit 30470dc

Browse files
fix(retrieve): fixed count on entities and relationships retrieve
1 parent 20fd9bb commit 30470dc

File tree

7 files changed

+45
-301
lines changed

7 files changed

+45
-301
lines changed

.env.example

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# LLM Implementation envs
2+
# The following are just examples of the adapter implementation, you can have completely different envs
3+
AZURE_LARGE_LLM_MODEL="gpt-4o"
4+
AZURE_LARGE_LLM_API_VERSION="2024-12-01-preview"
5+
AZURE_LARGE_LLM_ENDPOINT="https://yourproject.openai.azure.com"
6+
AZURE_LLM_SUBSCRIPTION_KEY="xyz"
7+
8+
# Embedding envs
9+
# The following are just examples of the adapter implementation, you can have completely different envs
10+
AZURE_EMBEDDING_FULL_ENDPOINT="https://yourproject.openai.azure.com/openai/deployments/text-embedding-3-large/embeddings?api-version=2023-05-15"
11+
AZURE_EMBEDDING_KEY="xyz"
12+
13+
# Cache envs
14+
# The following are just examples of the adapter implementation, you can have completely different envs
15+
REDIS_HOST="localhost"
16+
REDIS_PORT=6379
17+
18+
# Worker envs
19+
# Can be whatever you prefer
20+
# CELERY_BACKEND="rabbitmq"
21+
CELERY_BACKEND="redis"
22+
23+
# GraphDB envs
24+
# The following are just examples of the adapter implementation, you can have completely different envs
25+
NEO4J_HOST="localhost"
26+
NEO4J_PORT=7687
27+
NEO4J_USERNAME="neo4j"
28+
NEO4J_PASSWORD="your_password"
29+
30+
# VectorDB envs
31+
# The following are just examples of the adapter implementation, you can have completely different envs
32+
MILVUS_HOST="localhost"
33+
MILVUS_PORT=19530
34+
35+
# DataDB envs
36+
# The following are just examples of the adapter implementation, you can have completely different envs
37+
MONGO_HOST="localhost"
38+
MONGO_PORT=27017
39+
MONGO_USERNAME="root"
40+
MONGO_PASSWORD="password"
41+

Dockerfile

Lines changed: 0 additions & 87 deletions
This file was deleted.

LICENSE

Whitespace-only changes.

README.md

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +0,0 @@
1-
BEFORE OPEN SOURCING REMOVE PAT AND ALL SECRETS
2-
3-
## New deploy config
4-
5-
```
6-
sudo apt update
7-
sudo apt install -y ca-certificates curl gnupg lsb-release
8-
sudo mkdir -p /etc/apt/keyrings
9-
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | \
10-
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
11-
echo \
12-
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] \
13-
https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
14-
$(lsb_release -cs) stable" | \
15-
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
16-
sudo apt update
17-
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
18-
sudo systemctl enable docker
19-
sudo systemctl start docker
20-
sudo docker pull nginx:latest
21-
docker network create appnet || true
22-
sudo docker run -d \
23-
--network appnet \
24-
--name nginx-server \
25-
-p 80:80 \
26-
-v /srv/nginx/html:/usr/share/nginx/html \
27-
-v /srv/nginx/conf:/etc/nginx/conf.d \
28-
--restart always \
29-
nginx
30-
sudo systemctl enable docker
31-
sudo docker run -it --rm \
32-
-v /etc/letsencrypt:/etc/letsencrypt \
33-
-v /var/lib/letsencrypt:/var/lib/letsencrypt \
34-
-p 80:80 \
35-
certbot/certbot certonly --standalone \
36-
-d glo-matcher.brainapi.lumen-labs.ai
37-
sudo tee /srv/nginx/conf/default.conf >/dev/null <<'NGINX'
38-
server {
39-
listen 80;
40-
server_name glo-matcher.brainapi.lumen-labs.ai;
41-
return 301 https://$host$request_uri;
42-
}
43-
server {
44-
listen 443 ssl;
45-
server_name glo-matcher.brainapi.lumen-labs.ai;
46-
47-
ssl_certificate /etc/letsencrypt/live/glo-matcher.brainapi.lumen-labs.ai/fullchain.pem;
48-
ssl_certificate_key /etc/letsencrypt/live/glo-matcher.brainapi.lumen-labs.ai/privkey.pem;
49-
50-
client_max_body_size 50m;
51-
52-
location / {
53-
proxy_pass http://127.0.0.1:8000;
54-
proxy_http_version 1.1;
55-
proxy_set_header Host $host;
56-
proxy_set_header X-Real-IP $remote_addr;
57-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58-
proxy_set_header X-Forwarded-Proto $scheme;
59-
60-
proxy_set_header Upgrade $http_upgrade;
61-
proxy_set_header Connection "upgrade";
62-
63-
proxy_connect_timeout 60s;
64-
proxy_send_timeout 300s;
65-
proxy_read_timeout 300s;
66-
send_timeout 300s;
67-
}
68-
}
69-
NGINX
70-
71-
docker rm -f nginx-server 2>/dev/null || true
72-
docker run -d --name nginx-server \
73-
-p 80:80 -p 443:443 \
74-
-v /srv/nginx/html:/usr/share/nginx/html \
75-
-v /srv/nginx/conf:/etc/nginx/conf.d \
76-
-v /etc/letsencrypt:/etc/letsencrypt:ro \
77-
--restart always \
78-
nginx:latest
79-
80-
echo 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 | docker login ghcr.io -u ChrisCoder9000 --password-stdin
81-
docker pull ghcr.io/lumen-labs/brainapi:latest
82-
docker run -d \
83-
--name brainapi \
84-
-p 8000:8000 \
85-
--network appnet \
86-
--restart always \
87-
ghcr.io/lumen-labs/brainapi:latest
88-
89-
```

docker-compose-partial.yaml

Lines changed: 0 additions & 123 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "brainapi2"
3-
version = "1.5.0"
3+
version = "1.5.1"
44
description = "Version 1.x.x of the BrainAPI memory layer."
55
authors = [
66
{name = "Christian",email = "[email protected]"}

src/lib/neo4j/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,8 @@ def search_relationships(
721721
LIMIT {limit}
722722
"""
723723
cypher_count = """
724-
MATCH ()-[r]-()
724+
MATCH (n)-[r]-(m)
725+
{"WHERE " + " AND ".join(filters) if filters else ""}
725726
RETURN count(r) AS total
726727
"""
727728
result = self.driver.execute_query(cypher_query)
@@ -847,6 +848,7 @@ def search_entities(
847848
"""
848849
cypher_count = """
849850
MATCH (n)
851+
{"WHERE " + " AND ".join(filters) if filters else ""}
850852
RETURN count(n) AS total
851853
"""
852854
result = self.driver.execute_query(cypher_query)

0 commit comments

Comments
 (0)