add updates
This commit is contained in:
1 parent
c1aabbb7ee
commit
a57cc024c6
16 files changed
+636
-334
No files matched your search
@@ -0,0 +1,7 @@
|
||||
LLM_API_KEY=
|
||||
ENABLE_BACKEND_ACCESS_CONTROL="false"
|
||||
|
||||
|
||||
COGNEE_API_KEY=
|
||||
|
||||
CLAWDBOT_GATEWAY_TOKEN=
|
||||
@@ -0,0 +1,35 @@
|
||||
# Sample Clawdbot config for testing Cognee integration
|
||||
# Copy this to ~/.clawdbot/config.yaml inside the dev container
|
||||
#
|
||||
# Inside container:
|
||||
# mkdir -p ~/.clawdbot
|
||||
# cp /app/examples/cognee-clawdbot-config.yaml ~/.clawdbot/config.yaml
|
||||
|
||||
agents:
|
||||
defaults:
|
||||
# Enable Cognee as the memory provider
|
||||
memorySearch:
|
||||
enabled: true
|
||||
provider: cognee
|
||||
sources: [memory] # Start with just memory files
|
||||
|
||||
cognee:
|
||||
# Inside Docker network, Cognee is at this address
|
||||
baseUrl: http://cognee:8000
|
||||
# No API key needed for local Docker setup
|
||||
# apiKey: ""
|
||||
|
||||
# Dataset name for organizing memories
|
||||
datasetName: clawdbot-test
|
||||
|
||||
# Search mode: "insights" (recommended), "chunks", or "summaries"
|
||||
searchType: insights
|
||||
|
||||
# Max results per search
|
||||
maxResults: 6
|
||||
|
||||
# Auto-process documents after adding
|
||||
autoCognify: true
|
||||
|
||||
# Request timeout
|
||||
timeoutSeconds: 30
|
||||
@@ -21,8 +21,8 @@ agents:
|
||||
# Dataset name for organizing memories
|
||||
datasetName: clawdbot
|
||||
|
||||
# Search mode: "insights" (recommended), "chunks", or "summaries"
|
||||
searchType: insights
|
||||
# Search mode: "GRAPH_COMPLETION" (recommended), "chunks", or "summaries"
|
||||
searchType: GRAPH_COMPLETION
|
||||
|
||||
# Maximum search results to return
|
||||
maxResults: 6
|
||||
|
||||
@@ -1,77 +1,36 @@
|
||||
# Docker Compose configuration for running Cognee locally with Clawdbot
|
||||
# Minimal Docker Compose for Cognee (local-only)
|
||||
#
|
||||
# Usage:
|
||||
# 1. Copy this file to your preferred location
|
||||
# 2. Run: docker-compose -f cognee-docker-compose.yaml up -d
|
||||
# 3. Verify: curl http://localhost:8000/status
|
||||
# 1. Export your LLM key: export LLM_API_KEY="your-openai-api-key"
|
||||
# 2. Run: docker compose -f examples/cognee-docker-compose.yaml up -d
|
||||
# 3. Verify: curl http://localhost:8000/health
|
||||
# 4. Configure Clawdbot with baseUrl: http://localhost:8000
|
||||
#
|
||||
# For production, see docs/memory-cognee.md for additional configuration
|
||||
# Defaults (no extra DB setup):
|
||||
# - Relational DB: SQLite (file-based)
|
||||
# - Vector DB: LanceDB (file-based)
|
||||
# - Graph DB: Kuzu (file-based)
|
||||
|
||||
version: '3.8'
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
# Cognee API server
|
||||
cognee:
|
||||
image: topoteretes/cognee:latest
|
||||
image: cognee/cognee:latest
|
||||
container_name: cognee
|
||||
ports:
|
||||
- "8000:8000"
|
||||
- "127.0.0.1:8000:8000"
|
||||
environment:
|
||||
# Optional: Set API key for authentication
|
||||
# Remove or comment out for local development without auth
|
||||
- COGNEE_API_KEY=${COGNEE_API_KEY:-}
|
||||
|
||||
# Database connection
|
||||
- DATABASE_URL=postgresql://cognee:cognee@postgres:5432/cognee
|
||||
|
||||
# Optional: Configure LLM provider for entity extraction
|
||||
# Uncomment and set if you want to use specific providers
|
||||
# - OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
||||
# - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
||||
- LLM_API_KEY=${LLM_API_KEY}
|
||||
volumes:
|
||||
- cognee_data:/app/data
|
||||
- cognee_logs:/app/logs
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
- cognee_data:/app/cognee/.cognee_system
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/status"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
networks:
|
||||
- cognee-network
|
||||
|
||||
# PostgreSQL database for Cognee
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: cognee-postgres
|
||||
environment:
|
||||
- POSTGRES_USER=cognee
|
||||
- POSTGRES_PASSWORD=cognee
|
||||
- POSTGRES_DB=cognee
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U cognee"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- cognee-network
|
||||
|
||||
volumes:
|
||||
cognee_data:
|
||||
driver: local
|
||||
cognee_logs:
|
||||
driver: local
|
||||
postgres_data:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
cognee-network:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,117 @@
|
||||
# Docker Compose for testing Clawdbot + Cognee integration
|
||||
#
|
||||
# Usage:
|
||||
# 1. cd examples
|
||||
# 2. docker-compose -f cognee-test-compose.yaml up -d
|
||||
# 3. docker-compose -f cognee-test-compose.yaml exec dev bash
|
||||
# 4. Inside container:
|
||||
# - pnpm install # Install dependencies
|
||||
# - pnpm build # Build Clawdbot
|
||||
# - pnpm test src/memory/cognee-* # Run unit tests
|
||||
# - pnpm clawdbot agent --message "test" # Run Clawdbot CLI
|
||||
#
|
||||
# To tear down: docker-compose -f cognee-test-compose.yaml down -v
|
||||
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Cognee API server
|
||||
cognee:
|
||||
image: topoteretes/cognee:latest
|
||||
container_name: cognee-test
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
# No API key for local testing
|
||||
- COGNEE_API_KEY=
|
||||
# Database connection
|
||||
- DATABASE_URL=postgresql://cognee:cognee@postgres:5432/cognee
|
||||
volumes:
|
||||
- cognee_data:/app/data
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/status"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
networks:
|
||||
- cognee-test-network
|
||||
|
||||
# PostgreSQL database for Cognee
|
||||
postgres:
|
||||
image: postgres:15-alpine
|
||||
container_name: cognee-test-postgres
|
||||
environment:
|
||||
- POSTGRES_USER=cognee
|
||||
- POSTGRES_PASSWORD=cognee
|
||||
- POSTGRES_DB=cognee
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U cognee"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
networks:
|
||||
- cognee-test-network
|
||||
|
||||
# Development container for running Clawdbot + tests
|
||||
dev:
|
||||
image: node:22-bookworm
|
||||
container_name: clawdbot-cognee-dev
|
||||
working_dir: /app
|
||||
volumes:
|
||||
# Mount the entire clawdbot repo
|
||||
- ..:/app
|
||||
# Use a separate node_modules volume to avoid conflicts
|
||||
- node_modules:/app/node_modules
|
||||
# Clawdbot config directory (persisted)
|
||||
- clawdbot_config:/root/.clawdbot
|
||||
environment:
|
||||
- HOME=/root
|
||||
- TERM=xterm-256color
|
||||
# Point to Cognee running in Docker network
|
||||
- COGNEE_BASE_URL=http://cognee:8000
|
||||
# Optional: Add your API keys here for full testing
|
||||
# - ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY:-}
|
||||
# - OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
||||
depends_on:
|
||||
cognee:
|
||||
condition: service_healthy
|
||||
stdin_open: true
|
||||
tty: true
|
||||
# Install pnpm and keep container running
|
||||
command: >
|
||||
bash -c "
|
||||
corepack enable &&
|
||||
echo '=== Clawdbot + Cognee Test Environment ===' &&
|
||||
echo 'Cognee is available at: http://cognee:8000' &&
|
||||
echo '' &&
|
||||
echo 'Quick start:' &&
|
||||
echo ' pnpm install && pnpm build' &&
|
||||
echo ' pnpm test src/memory/cognee-client.test.ts' &&
|
||||
echo ' pnpm clawdbot --help' &&
|
||||
echo '' &&
|
||||
sleep infinity
|
||||
"
|
||||
networks:
|
||||
- cognee-test-network
|
||||
|
||||
volumes:
|
||||
cognee_data:
|
||||
driver: local
|
||||
postgres_data:
|
||||
driver: local
|
||||
node_modules:
|
||||
driver: local
|
||||
clawdbot_config:
|
||||
driver: local
|
||||
|
||||
networks:
|
||||
cognee-test-network:
|
||||
driver: bridge
|
||||
@@ -0,0 +1,66 @@
|
||||
#!/usr/bin/env bash
|
||||
# Test script for Cognee integration
|
||||
# Run this inside the dev container after starting docker-compose
|
||||
|
||||
set -e
|
||||
|
||||
echo "=== Clawdbot + Cognee Integration Test ==="
|
||||
echo ""
|
||||
|
||||
# 1. Check if Cognee is reachable
|
||||
echo "1. Testing Cognee connection..."
|
||||
if curl -sf http://cognee:8000/status > /dev/null 2>&1; then
|
||||
echo " ✓ Cognee is healthy at http://cognee:8000"
|
||||
curl -s http://cognee:8000/status | head -c 200
|
||||
echo ""
|
||||
else
|
||||
echo " ✗ Cannot reach Cognee at http://cognee:8000"
|
||||
echo " Make sure Cognee container is running and healthy"
|
||||
exit 1
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# 2. Install dependencies if needed
|
||||
if [ ! -d "node_modules/.pnpm" ]; then
|
||||
echo "2. Installing dependencies..."
|
||||
pnpm install
|
||||
else
|
||||
echo "2. Dependencies already installed"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# 3. Run unit tests
|
||||
echo "3. Running Cognee unit tests..."
|
||||
pnpm test src/memory/cognee-client.test.ts src/memory/cognee-provider.test.ts
|
||||
echo ""
|
||||
|
||||
# 4. Quick integration check (manual API test)
|
||||
echo "4. Quick API smoke test..."
|
||||
echo " Adding test data to Cognee..."
|
||||
|
||||
# Add test data
|
||||
RESULT=$(curl -sf -X POST http://cognee:8000/add \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"data": "Test memory entry: The capital of France is Paris. This is a test document for Clawdbot integration.",
|
||||
"dataset_name": "clawdbot-test"
|
||||
}' 2>&1) || true
|
||||
|
||||
if echo "$RESULT" | grep -q "dataset"; then
|
||||
echo " ✓ Data added successfully"
|
||||
echo " Response: $RESULT"
|
||||
else
|
||||
echo " ⚠ Add may have failed (this is OK if Cognee API differs)"
|
||||
echo " Response: $RESULT"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
echo "=== Test Complete ==="
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " - The unit tests verify the client/provider logic"
|
||||
echo " - For full integration, configure Clawdbot with:"
|
||||
echo " memorySearch:"
|
||||
echo " provider: cognee"
|
||||
echo " cognee:"
|
||||
echo " baseUrl: http://cognee:8000 # or http://localhost:8000 from host"
|
||||
Reference in new issue
Block a user