Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/just-cameron/comind. Comind, the cognitive layer for the web. comind.stream/docs/getting-started
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163#!/bin/bash
# Comind Services Management Script# Makes it easy to start different combinations of services
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_ROOT"
show_help() { echo "Comind Services Management" echo "" echo "Usage: $0 <command> [options]" echo "" echo "Commands:" echo " start <profile> Start services" echo " stop <profile> Stop services" echo " restart <profile> Restart services" echo " status Show running services" echo " logs <service> Show logs for a service" echo " shell Connect to Neo4j shell" echo " sync Sync ATProto records to Neo4j" echo "" echo "Profiles:" echo " database Start only Neo4j database" echo " inference Start only inference services (LLM + embeddings)" echo " all Start all services" echo " (no profile) Start default services (database only)" echo "" echo "Examples:" echo " $0 start database # Start only Neo4j" echo " $0 start inference # Start only inference services" echo " $0 start all # Start everything" echo " $0 start # Start default (database)" echo " $0 logs neo4j # Show Neo4j logs" echo " $0 shell # Connect to Neo4j shell" echo " $0 sync # Sync records to graph database"}
start_services() { local profile="$1" if [ -z "$profile" ]; then echo "Starting default services (database)..." docker compose up -d else echo "Starting $profile services..." docker compose --profile "$profile" up -d fi echo "" echo "Services started. Access points:" if [ "$profile" = "database" ] || [ "$profile" = "all" ] || [ -z "$profile" ]; then echo " Neo4j Browser: http://localhost:7474" echo " Neo4j Bolt: bolt://localhost:7687" echo " Username: neo4j, Password: comind123" fi if [ "$profile" = "inference" ] || [ "$profile" = "all" ]; then echo " LLM API: http://localhost:8002" echo " Embeddings API: http://localhost:8001" fi}
stop_services() { local profile="$1" if [ -z "$profile" ]; then echo "Stopping all services..." docker compose down else echo "Stopping $profile services..." docker compose --profile "$profile" down fi}
restart_services() { local profile="$1" stop_services "$profile" start_services "$profile"}
show_status() { echo "Running Comind services:" echo "" docker compose ps}
show_logs() { local service="$1" if [ -z "$service" ]; then echo "Error: Please specify a service name" echo "Available services: neo4j, srv-llm, embeddings" exit 1 fi docker compose logs -f "$service"}
neo4j_shell() { echo "Connecting to Neo4j shell..." echo "Use 'MATCH (n) RETURN n LIMIT 10;' to test the connection" docker compose exec neo4j cypher-shell -u neo4j -p comind123}
sync_graph() { echo "Starting graph sync..." echo "This will sync ATProto records to Neo4j for graph analysis" echo "" # Check if Neo4j is running if ! docker compose ps neo4j | grep -q "Up"; then echo "Neo4j is not running. Starting database services..." start_services "database" echo "Waiting for Neo4j to be ready..." sleep 10 fi # Run the graph sync script python3 scripts/graph_sync.py --setup-schema --sync-all echo "" echo "Graph sync complete! You can now:" echo " - Browse the graph: http://localhost:7474" echo " - Query concepts: python3 scripts/graph_sync.py --concept-network 'your concept'" echo " - Find clusters: python3 scripts/graph_sync.py --concept-clusters"}
# Main command handlingcase "$1" in "start") start_services "$2" ;; "stop") stop_services "$2" ;; "restart") restart_services "$2" ;; "status") show_status ;; "logs") show_logs "$2" ;; "shell") neo4j_shell ;; "sync") sync_graph ;; "help"|"-h"|"--help"|"") show_help ;; *) echo "Error: Unknown command '$1'" echo "" show_help exit 1 ;;esac