Skip to content

Commit 4867ba8

Browse files
Thomas TupperThomas Tupper
authored andcommitted
feat(deploy): add one/split/external modes and smoke scripts for provider contract
1 parent 4e0488d commit 4867ba8

7 files changed

Lines changed: 82 additions & 26 deletions

File tree

.env.example

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
FOXMEMORY_INFER_IMAGE=docker.io/foxlightfoundation/foxmemory-infer:latest
33
FOXMEMORY_STORE_IMAGE=docker.io/foxlightfoundation/foxmemory-store:latest
44

5-
# Infer service
5+
# infer runtime
66
OLLAMA_BASE_URL=http://host.docker.internal:11434
77
OLLAMA_EMBED_MODEL=nomic-embed-text
8+
OLLAMA_CHAT_MODEL=llama3.1:8b
9+
INFER_API_KEY=
810

9-
# Store service / mem0 OSS config inputs
11+
# store runtime
12+
OPENAI_BASE_URL=http://infer:8081/v1
1013
OPENAI_API_KEY=
1114
MEM0_LLM_MODEL=gpt-4.1-nano
1215
MEM0_EMBED_MODEL=text-embedding-3-small
1316
QDRANT_COLLECTION=foxmemory
14-
QDRANT_HOST=qdrant
17+
QDRANT_HOST=127.0.0.1
1518
QDRANT_PORT=6333

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# foxmemory-deploy
22

3-
Deployment pack for FoxMemory (Node/TS services + Mem0 OSS-compatible store).
3+
Deployment pack for FoxMemory.
44

55
## Modes
6-
1. `compose.one.yml` — one-node (infer + store with embedded qdrant)
7-
2. `compose.split.yml` — split topology for Mini/R720 style deployments
6+
1. `compose.one.yml` — one-node (infer + store-with-embedded-qdrant)
7+
2. `compose.split.yml` — split topology (infer and store on different infrastructure)
8+
3. `compose.external.yml` — store only; inference via external OpenAI-compatible API
89

9-
## Quick start
10+
## Quick start (one-node)
1011
```bash
1112
cp .env.example .env
1213
docker compose -f compose.one.yml up -d
@@ -29,7 +30,7 @@ curl -s -X POST http://localhost:8082/v1/memories/search \
2930
-d '{"user_id":"demo","query":"movie preference","top_k":5}'
3031
```
3132

32-
## Notes
33-
- Uses Docker Hub images by default.
34-
- Configure OPENAI_API_KEY if using OpenAI LLM/embedder path.
35-
- In one-node mode, Qdrant is embedded in store and persisted via `foxmemory_store_data`.
33+
## Design contract
34+
- `foxmemory-store` requires no external container other than optional `foxmemory-infer`.
35+
- Inference integration uses OpenAI-compatible API shape.
36+
- Embedded Qdrant is included in store container for two-container deployments.

compose.external.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# External mode: no infer container; store points to any OpenAI-compatible endpoint.
2+
services:
3+
store:
4+
image: ${FOXMEMORY_STORE_IMAGE}
5+
container_name: foxmemory-store
6+
ports:
7+
- "8082:8082"
8+
- "6333:6333"
9+
environment:
10+
- OPENAI_BASE_URL=${OPENAI_BASE_URL}
11+
- OPENAI_API_KEY=${OPENAI_API_KEY}
12+
- MEM0_LLM_MODEL=${MEM0_LLM_MODEL}
13+
- MEM0_EMBED_MODEL=${MEM0_EMBED_MODEL}
14+
- QDRANT_HOST=127.0.0.1
15+
- QDRANT_PORT=6333
16+
- QDRANT_COLLECTION=${QDRANT_COLLECTION}
17+
- MEM0_HISTORY_DB_PATH=/tmp/history.db
18+
- QDRANT_STORAGE_PATH=/qdrant/storage
19+
volumes:
20+
- foxmemory_store_data:/qdrant/storage
21+
22+
volumes:
23+
foxmemory_store_data:

compose.one.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
environment:
88
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL}
99
- OLLAMA_EMBED_MODEL=${OLLAMA_EMBED_MODEL}
10+
- OLLAMA_CHAT_MODEL=${OLLAMA_CHAT_MODEL}
11+
- INFER_API_KEY=${INFER_API_KEY}
1012

1113
store:
1214
image: ${FOXMEMORY_STORE_IMAGE}
@@ -15,7 +17,8 @@ services:
1517
- "8082:8082"
1618
- "6333:6333"
1719
environment:
18-
- OPENAI_API_KEY=${OPENAI_API_KEY}
20+
- OPENAI_BASE_URL=http://infer:8081/v1
21+
- OPENAI_API_KEY=${INFER_API_KEY}
1922
- MEM0_LLM_MODEL=${MEM0_LLM_MODEL}
2023
- MEM0_EMBED_MODEL=${MEM0_EMBED_MODEL}
2124
- QDRANT_HOST=127.0.0.1

compose.split.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1+
# Split mode: deploy these services on separate hosts if desired.
12
services:
2-
# Deploy on host A (e.g., Mini)
33
infer:
44
image: ${FOXMEMORY_INFER_IMAGE}
55
ports:
66
- "8081:8081"
77
environment:
88
- OLLAMA_BASE_URL=${OLLAMA_BASE_URL}
99
- OLLAMA_EMBED_MODEL=${OLLAMA_EMBED_MODEL}
10-
11-
# Deploy on host B (e.g., R720)
12-
qdrant:
13-
image: qdrant/qdrant:v1.13.2
14-
ports:
15-
- "6333:6333"
16-
volumes:
17-
- qdrant_data:/qdrant/storage
10+
- OLLAMA_CHAT_MODEL=${OLLAMA_CHAT_MODEL}
11+
- INFER_API_KEY=${INFER_API_KEY}
1812

1913
store:
2014
image: ${FOXMEMORY_STORE_IMAGE}
2115
ports:
2216
- "8082:8082"
17+
- "6333:6333"
2318
environment:
19+
- OPENAI_BASE_URL=${OPENAI_BASE_URL}
2420
- OPENAI_API_KEY=${OPENAI_API_KEY}
2521
- MEM0_LLM_MODEL=${MEM0_LLM_MODEL}
2622
- MEM0_EMBED_MODEL=${MEM0_EMBED_MODEL}
27-
- QDRANT_HOST=${QDRANT_HOST:-qdrant}
28-
- QDRANT_PORT=${QDRANT_PORT:-6333}
23+
- QDRANT_HOST=127.0.0.1
24+
- QDRANT_PORT=6333
2925
- QDRANT_COLLECTION=${QDRANT_COLLECTION}
3026
- MEM0_HISTORY_DB_PATH=/tmp/history.db
31-
depends_on:
32-
- qdrant
27+
- QDRANT_STORAGE_PATH=/qdrant/storage
28+
volumes:
29+
- foxmemory_store_data:/qdrant/storage
3330

3431
volumes:
35-
qdrant_data:
32+
foxmemory_store_data:

scripts/smoke-external.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
cd "$(dirname "$0")/.."
4+
if [ ! -f .env ]; then
5+
echo "Create .env from .env.example and set OPENAI_BASE_URL/OPENAI_API_KEY first." >&2
6+
exit 1
7+
fi
8+
cleanup(){ docker compose -f compose.external.yml down -v >/dev/null 2>&1 || true; }
9+
trap cleanup EXIT
10+
11+
docker compose -f compose.external.yml up -d
12+
sleep 6
13+
curl -fsS http://localhost:8082/health >/dev/null
14+
15+
echo "smoke-external: store healthy"

scripts/smoke-one.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
cd "$(dirname "$0")/.."
4+
cp -f .env.example .env
5+
cleanup(){ docker compose -f compose.one.yml down -v >/dev/null 2>&1 || true; rm -f .env; }
6+
trap cleanup EXIT
7+
8+
docker compose -f compose.one.yml up -d
9+
sleep 8
10+
curl -fsS http://localhost:8082/health >/dev/null
11+
curl -fsS -X POST http://localhost:8082/v1/memories -H 'content-type: application/json' -d '{"user_id":"smoke","messages":[{"role":"user","content":"remember I like tea"}]}' >/dev/null
12+
curl -fsS -X POST http://localhost:8082/v1/memories/search -H 'content-type: application/json' -d '{"user_id":"smoke","query":"tea","top_k":3}' >/dev/null
13+
14+
echo "smoke-one: OK"

0 commit comments

Comments
 (0)