@@ -60,6 +60,7 @@ STORAGE_SERVICES=(
6060 " milvus"
6161 " qdrant"
6262 " memgraph"
63+ " opensearch"
6364)
6465DEFAULT_RUNTIME_TARGET=" host"
6566COMPOSE_LIGHTRAG_WORKING_DIR=" /app/data/rag_storage"
@@ -434,6 +435,11 @@ set_managed_service_compose_overrides() {
434435 set_compose_override " MEMGRAPH_URI" " bolt://memgraph:7687"
435436 fi
436437 ;;
438+ opensearch)
439+ if [[ -z " ${COMPOSE_ENV_OVERRIDES[OPENSEARCH_HOSTS]+set} " ]]; then
440+ set_compose_override " OPENSEARCH_HOSTS" " opensearch:9200"
441+ fi
442+ ;;
437443 esac
438444}
439445
@@ -472,7 +478,7 @@ prepare_compose_runtime_overrides() {
472478 fi
473479 fi
474480
475- for root_service in postgres neo4j mongodb redis milvus qdrant memgraph; do
481+ for root_service in postgres neo4j mongodb redis milvus qdrant memgraph opensearch ; do
476482 if [[ -n " ${DOCKER_SERVICE_SET[$root_service]+set} " ]]; then
477483 set_managed_service_compose_overrides " $root_service "
478484 fi
@@ -485,7 +491,8 @@ prepare_compose_runtime_overrides() {
485491 " NEO4J_URI" \
486492 " MILVUS_URI" \
487493 " QDRANT_URL" \
488- " MEMGRAPH_URI" ; do
494+ " MEMGRAPH_URI" \
495+ " OPENSEARCH_HOSTS" ; do
489496 if [[ -n " ${COMPOSE_ENV_OVERRIDES[$key]+set} " ]]; then
490497 continue
491498 fi
@@ -557,7 +564,7 @@ restore_storage_docker_services_from_env() {
557564 local db_type
558565 local marker_key=" "
559566 local service_name=" "
560- local db_types=(" postgresql" " neo4j" " mongodb" " redis" " milvus" " qdrant" " memgraph" )
567+ local db_types=(" postgresql" " neo4j" " mongodb" " redis" " milvus" " qdrant" " memgraph" " opensearch " )
561568
562569 for db_type in " ${db_types[@]} " ; do
563570 marker_key=" $( storage_deployment_marker_key " $db_type " ) "
@@ -917,7 +924,7 @@ storage_service_name_for_db_type() {
917924 postgresql)
918925 printf ' postgres'
919926 ;;
920- neo4j|mongodb|redis|milvus|qdrant|memgraph)
927+ neo4j|mongodb|redis|milvus|qdrant|memgraph|opensearch )
921928 printf ' %s' " $db_type "
922929 ;;
923930 * )
@@ -951,6 +958,9 @@ storage_deployment_marker_key() {
951958 memgraph)
952959 printf ' LIGHTRAG_SETUP_MEMGRAPH_DEPLOYMENT'
953960 ;;
961+ opensearch)
962+ printf ' LIGHTRAG_SETUP_OPENSEARCH_DEPLOYMENT'
963+ ;;
954964 * )
955965 printf ' '
956966 ;;
@@ -995,7 +1005,7 @@ persist_storage_deployment_choice() {
9951005clear_unused_storage_deployment_markers () {
9961006 local db_type
9971007
998- for db_type in postgresql neo4j mongodb redis milvus qdrant memgraph; do
1008+ for db_type in postgresql neo4j mongodb redis milvus qdrant memgraph opensearch ; do
9991009 if [[ -z " ${REQUIRED_DB_TYPES[$db_type]+set} " ]]; then
10001010 persist_storage_deployment_choice " $db_type " " no"
10011011 fi
@@ -1030,6 +1040,9 @@ collect_database_config() {
10301040 memgraph)
10311041 collect_memgraph_config " $default_docker "
10321042 ;;
1043+ opensearch)
1044+ collect_opensearch_config " $default_docker "
1045+ ;;
10331046 * )
10341047 echo " Unknown database type: $db_type " >&2
10351048 return 1
@@ -1370,6 +1383,46 @@ collect_memgraph_config() {
13701383 fi
13711384}
13721385
1386+ collect_opensearch_config () {
1387+ local default_docker=" ${1:- no} "
1388+ local use_docker=" no"
1389+ local hosts user password
1390+
1391+ if [[ " $default_docker " == " yes" ]]; then
1392+ if confirm_default_yes " Run OpenSearch locally via Docker?" ; then
1393+ use_docker=" yes"
1394+ fi
1395+ else
1396+ if confirm_default_no " Run OpenSearch locally via Docker?" ; then
1397+ use_docker=" yes"
1398+ fi
1399+ fi
1400+
1401+ if [[ " $use_docker " == " yes" ]]; then
1402+ add_docker_service " opensearch"
1403+ hosts=" $( prefer_local_service_uri " ${ENV_VALUES[OPENSEARCH_HOSTS]:- } " " localhost:9200" " opensearch" " localhost" " 127.0.0.1" " 0.0.0.0" ) "
1404+ else
1405+ hosts=" ${ENV_VALUES[OPENSEARCH_HOSTS]:- localhost: 9200} "
1406+ fi
1407+
1408+ hosts=" $( prompt_with_default " OpenSearch hosts" " $hosts " ) "
1409+ user=" $( prompt_with_default " OpenSearch user" " ${ENV_VALUES[OPENSEARCH_USER]:- admin} " ) "
1410+ password=" $( prompt_secret_with_default " OpenSearch password: " " ${ENV_VALUES[OPENSEARCH_PASSWORD]:- LightRAG2026_!@ } " ) "
1411+
1412+ ENV_VALUES[" OPENSEARCH_HOSTS" ]=" $hosts "
1413+ ENV_VALUES[" OPENSEARCH_USER" ]=" $user "
1414+ ENV_VALUES[" OPENSEARCH_PASSWORD" ]=" $password "
1415+ ENV_VALUES[" OPENSEARCH_USE_SSL" ]=" ${ENV_VALUES[OPENSEARCH_USE_SSL]:- true} "
1416+ ENV_VALUES[" OPENSEARCH_VERIFY_CERTS" ]=" ${ENV_VALUES[OPENSEARCH_VERIFY_CERTS]:- false} "
1417+ ENV_VALUES[" OPENSEARCH_USE_PPL_GRAPHLOOKUP" ]=" ${ENV_VALUES[OPENSEARCH_USE_PPL_GRAPHLOOKUP]:- false} "
1418+
1419+ if [[ " $use_docker " == " yes" ]]; then
1420+ set_compose_override " OPENSEARCH_HOSTS" " opensearch:9200"
1421+ else
1422+ set_compose_override " OPENSEARCH_HOSTS" " "
1423+ fi
1424+ }
1425+
13731426clear_bedrock_credentials () {
13741427 unset ' ENV_VALUES[AWS_ACCESS_KEY_ID]'
13751428 unset ' ENV_VALUES[AWS_SECRET_ACCESS_KEY]'
@@ -2244,7 +2297,7 @@ finalize_base_setup() {
22442297env_storage_flow () {
22452298 local env_file=" ${REPO_ROOT} /.env"
22462299 local db_type
2247- local db_order=(" postgresql" " neo4j" " mongodb" " redis" " milvus" " qdrant" " memgraph" )
2300+ local db_order=(" postgresql" " neo4j" " mongodb" " redis" " milvus" " qdrant" " memgraph" " opensearch " )
22482301
22492302 if [[ ! -f " $env_file " ]]; then
22502303 format_error " No .env file found." " Run 'make env-base' first to configure LLM and embedding."
@@ -2640,6 +2693,10 @@ validate_env_file() {
26402693 format_error " Invalid POSTGRES_PORT" " Use a port between 1 and 65535."
26412694 errors=1
26422695 fi
2696+ if [[ -n " ${ENV_VALUES[OPENSEARCH_HOSTS]:- } " ]] && [[ -z " ${ENV_VALUES[OPENSEARCH_HOSTS]} " ]]; then
2697+ format_error " Empty OPENSEARCH_HOSTS" " Set it to host:port (e.g. localhost:9200)."
2698+ errors=1
2699+ fi
26432700 if (( errors != 0 )) ; then
26442701 return 1
26452702 fi
@@ -2752,6 +2809,16 @@ security_check_env_file() {
27522809 fi
27532810 fi
27542811
2812+ if [[ -n " ${ENV_VALUES[OPENSEARCH_PASSWORD]:- } " ]]; then
2813+ local os_pass=" ${ENV_VALUES[OPENSEARCH_PASSWORD]} "
2814+ if [[ " $os_pass " == " admin" || " $os_pass " == " LightRAG2026_!@" ]]; then
2815+ report_security_issue \
2816+ " OPENSEARCH_PASSWORD uses a well-known default value." \
2817+ " Set a unique, strong password for the OpenSearch admin account."
2818+ findings=$(( findings + 1 ))
2819+ fi
2820+ fi
2821+
27552822 if (( findings == 0 )) ; then
27562823 log_success " No obvious security issues found in ${env_file} ."
27572824 return 0
0 commit comments