### Install UI Dependencies and Start Development Server Source: https://docs.falkordb.com/operations/migration/sql-to-falkordb.html Navigate to the control plane UI directory, install npm dependencies, and start the development server for UI development. ```bash cd control-plane/ui npm install npm run dev ``` -------------------------------- ### Quick Start Mem0 with FalkorDB Source: https://docs.falkordb.com/agentic-memory/mem0.html A complete example demonstrating how to initialize Mem0 with FalkorDB as the graph store, add memories for a user, and search those memories using natural language. ```python from mem0_falkordb import register register() from mem0 import Memory config = { "graph_store": { "provider": "falkordb", "config": { "host": "localhost", "port": 6379, "database": "mem0", }, }, "llm": { "provider": "openai", "config": {"model": "gpt-4o-mini"}, }, } m = Memory.from_config(config) # Add memories for a user m.add("I love pizza", user_id="alice") m.add("Alice is a software engineer", user_id="alice") m.add("Alice works on AI projects", user_id="alice") # Search the memory results = m.search("what does alice like?", user_id="alice") print(results) ``` -------------------------------- ### Set and get configuration parameters Source: https://docs.falkordb.com/commands/graph.config-set.html Examples of retrieving and updating a configuration parameter value across different languages. ```python from falkordb import FalkorDB client = FalkorDB() print(client.get_config('TIMEOUT')) client.set_config('TIMEOUT', 10000) print(client.get_config('TIMEOUT')) ``` ```javascript import { FalkorDB } from 'falkordb'; const client = await FalkorDB.connect(); console.log(await client.getConfig('TIMEOUT')); await client.setConfig('TIMEOUT', 10000); console.log(await client.getConfig('TIMEOUT')); ``` ```rust let client = FalkorDB::connect_default(); println!("{:?}", client.get_config("TIMEOUT")?); client.set_config("TIMEOUT", 10000)?; println!("{:?}", client.get_config("TIMEOUT")?); ``` ```java FalkorDB client = new FalkorDB(); System.out.println(client.getConfig("TIMEOUT")); client.setConfig("TIMEOUT", 10000); System.out.println(client.getConfig("TIMEOUT")); ``` ```shell graph.config get TIMEOUT graph.config set TIMEOUT 10000 graph.config get TIMEOUT # Output: # 1) "TIMEOUT" # 2) (integer) 0 # OK # 1) "TIMEOUT" # 2) (integer) 10000 ``` -------------------------------- ### Start Production Setup with Custom Password Source: https://docs.falkordb.com/operations/docker Starts the production compose stack while injecting a secure password via environment variable. ```bash FALKORDB_PASSWORD=your-secure-password docker-compose up -d ``` -------------------------------- ### Install FalkorDB Addon with kbcli Source: https://docs.falkordb.com/operations/kubeblocks Install the kbcli command-line tool and then use it to install the FalkorDB addon. Verify the installation by listing enabled addons. ```bash # Install kbcli curl -fsSL https://kubeblocks.io/installer/install_cli.sh | bash # Verify installation kbcli version ``` ```bash # Install the FalkorDB addon kbcli addon install falkordb # Verify the addon is enabled kbcli addon list | grep falkordb ``` -------------------------------- ### Manual system setup for CentOS 7 Source: https://docs.falkordb.com/operations/building-docker A sequence of shell commands to install dependencies and configure the environment for building FalkorDB on CentOS 7. Ensure these commands are executed with appropriate root privileges. ```bash yum install -q -y ca-certificates yum install -q -y curl wget unzip /usr/bin/python3 -m pip install --disable-pip-version-check wheel virtualenv /usr/bin/python3 -m pip install --disable-pip-version-check setuptools --upgrade /build/deps/readies/bin/enable-utf8 yum install -q -y git automake libtool autoconf yum install -q -y redhat-lsb-core yum groupinstall -y 'Development Tools' yum install -q -y centos-release-scl yum install -q -y devtoolset-10 yum install -q -y devtoolset-10-libatomic-devel rm -f /etc/profile.d/scl-devtoolset-*.sh yum install -q -y m4 libgomp cd /tmp; build_dir=$(mktemp -d); cd $build_dir; wget -q -O peg.tar.gz https://github.com/gpakosz/peg/archive/0.1.18.tar.gz; tar xzf peg.tar.gz; cd peg-0.1.18; make; make install MANDIR=.; cd /tmp; rm -rf $build_dir yum install -q -y valgrind yum install -q -y astyle yum install -q -y ca-certificates yum install -q -y curl wget unzip wget -q -O /tmp/cmake.sh https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-`uname`-`uname -m`.sh; sh /tmp/cmake.sh --skip-license --prefix=/usr/local; rm -f /tmp/cmake.sh /usr/bin/python3 -m pip install --disable-pip-version-check psutil /build/deps/readies/bin/getgcc yum install -q -y python3-devel /usr/bin/python3 -m pip install --disable-pip-version-check psutil yum install -q -y git /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5 /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed redis-py-cluster /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master /usr/bin/python3 -m pip install --disable-pip-version-check -r tests/requirements.txt ``` -------------------------------- ### Alpine 3 Setup Source: https://docs.falkordb.com/operations/building-docker Installs necessary system packages, CMake, and Python dependencies for Alpine Linux. ```bash apk add bash busybox python3 apk add -q ca-certificates apk add -q curl wget unzip /usr/bin/python3 -m pip install --disable-pip-version-check wheel virtualenv /usr/bin/python3 -m pip install --disable-pip-version-check setuptools --upgrade /build/deps/readies/bin/enable-utf8 apk add -q git automake libtool autoconf apk add -q automake make autoconf libtool m4 apk add -q build-base musl-dev gcc g++ cd /tmp; build_dir=$(mktemp -d); cd $build_dir; wget -q -O peg.tar.gz https://github.com/gpakosz/peg/archive/0.1.18.tar.gz; tar xzf peg.tar.gz; cd peg-0.1.18; make; make install MANDIR=.; cd /tmp; rm -rf $build_dir apk add -q valgrind apk add -q astyle apk add -q ca-certificates apk add -q curl wget unzip wget -q -O /tmp/cmake.sh https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-`uname`-`uname -m`.sh; sh /tmp/cmake.sh --skip-license --prefix=/usr/local; rm -f /tmp/cmake.sh apk add -q linux-headers apk add -q git /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5 /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed redis-py-cluster /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master /usr/bin/python3 -m pip install --disable-pip-version-check -r tests/requirements.txt ``` -------------------------------- ### Install SDK and Configure Environment Source: https://docs.falkordb.com/genai-tools/graphrag-sdk.html Install the Python package and set required environment variables for database and LLM connectivity. ```bash pip install graphrag_sdk # FalkorDB Connection (defaults are for on-premises) export FALKORDB_HOST="localhost" export FALKORDB_PORT=6379 export FALKORDB_USERNAME="your-username" # optional for on-premises export FALKORDB_PASSWORD="your-password" # optional for on-premises # LLM Provider (choose one) export OPENAI_API_KEY="your-key" # or GOOGLE_API_KEY, GROQ_API_KEY, etc. ``` -------------------------------- ### Clone Repository, Start FalkorDB, and Run Demo Source: https://docs.falkordb.com/agentic-memory/mem0.html Instructions for setting up the demo environment. This involves cloning the repository, starting FalkorDB using Docker, and running the demo script with an OpenAI API key. ```bash # Clone the repository git clone https://github.com/FalkorDB/mem0-falkordb.git cd mem0-falkordb # Start FalkorDB docker run --rm -p 6379:6379 falkordb/falkordb:latest # Run the demo cd demo uv sync export OPENAI_API_KEY='your-key-here' uv run python demo.py ``` -------------------------------- ### Ubuntu Bionic (18.04) Setup Source: https://docs.falkordb.com/operations/building-docker Installs necessary system packages, CMake, and Python dependencies for Ubuntu Bionic. ```bash apt-get -qq update -y apt-get -qq install -y ca-certificates apt-get -qq install -y curl wget unzip /usr/bin/python3 -m pip install --disable-pip-version-check wheel virtualenv /usr/bin/python3 -m pip install --disable-pip-version-check setuptools --upgrade /build/deps/readies/bin/enable-utf8 apt-get -qq install -y git automake libtool autoconf apt-get -qq install -y locales apt-get -qq update -y apt-get -qq install -y build-essential apt-get -qq install -y peg apt-get -qq install -y valgrind apt-get -qq install -y astyle apt-get -qq update -y apt-get -qq install -y ca-certificates apt-get -qq install -y curl wget unzip wget -q -O /tmp/cmake.sh https://github.com/Kitware/CMake/releases/download/v3.21.1/cmake-3.21.1-`uname`-`uname -m`.sh; sh /tmp/cmake.sh --skip-license --prefix=/usr/local; rm -f /tmp/cmake.sh /usr/bin/python3 -m pip install --disable-pip-version-check psutil apt-get remove -y python3-psutil apt-get -qq update -y apt-get -qq install -y build-essential apt-get -qq install -y python3-dev /usr/bin/python3 -m pip install --disable-pip-version-check psutil apt-get -qq install -y git /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5 /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed redis-py-cluster /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master /usr/bin/python3 -m pip install --disable-pip-version-check -r tests/requirements.txt ``` -------------------------------- ### Complete FalkorDB and OpenTelemetry Example Source: https://docs.falkordb.com/operations/opentelemetry A full example demonstrating how to set up OpenTelemetry, connect to FalkorDB, and instrument database operations like creating and querying persons. ```python import falkordb from opentelemetry import trace from opentelemetry.trace import Status, StatusCode from opentelemetry.instrumentation.redis import RedisInstrumentor from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import ConsoleSpanExporter, BatchSpanProcessor def setup_telemetry(): """Setup OpenTelemetry configuration""" resource = Resource.create({"service.name": "falkordb-telemetry-demo"}) provider = TracerProvider(resource=resource) provider.add_span_processor(BatchSpanProcessor(ConsoleSpanExporter())) trace.set_tracer_provider(provider) return trace.get_tracer(__name__) def main(): # Setup telemetry tracer = setup_telemetry() # Connect to FalkorDB redis_user = 'alice' try: db = falkordb.FalkorDB( host='localhost', port=6379, username=redis_user, password='password' ) g = db.select_graph('telemetry-demo') except Exception as e: print(f"Could not connect to FalkorDB: {e}") return # Example operations with tracing with tracer.start_as_current_span("create_person") as span: span.set_attribute("db.system", "falkordb") span.set_attribute("db.user", redis_user) query = "CREATE (n:Person {name: 'Alice', age: 30}) RETURN n" span.set_attribute("db.statement", query) result = g.query(query).result_set span.set_attribute("db.result.count", len(result)) print("Person created successfully") with tracer.start_as_current_span("find_persons") as span: span.set_attribute("db.system", "falkordb") span.set_attribute("db.user", redis_user) query = "MATCH (n:Person) RETURN n.name, n.age" span.set_attribute("db.statement", query) result = g.query(query).result_set span.set_attribute("db.result.count", len(result)) print(f"Found {len(result)} persons") if __name__ == "__main__": main() ``` -------------------------------- ### Debian Buster (10) Setup Source: https://docs.falkordb.com/operations/building-docker Installs necessary system packages, CMake, and Python dependencies for Debian Buster. ```bash apt-get -qq update -y apt-get -qq install -y ca-certificates apt-get -qq install -y curl wget unzip /usr/bin/python3 -m pip install --disable-pip-version-check wheel virtualenv /usr/bin/python3 -m pip install --disable-pip-version-check setuptools --upgrade /build/deps/readies/bin/enable-utf8 apt-get -qq install -y git automake libtool autoconf apt-get -qq install -y locales apt-get -qq update -y apt-get -qq install -y build-essential apt-get -qq install -y peg apt-get -qq install -y valgrind apt-get -qq install -y astyle /build/deps/readies/bin/getcmake apt-get -qq update -y /usr/bin/python3 -m pip install --disable-pip-version-check psutil apt-get remove -y python3-psutil apt-get -qq update -y apt-get -qq install -y build-essential apt-get -qq install -y python3-dev /usr/bin/python3 -m pip install --disable-pip-version-check psutil apt-get -qq install -y git /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/redisfab/redis-py.git@3.5 /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed redis-py-cluster /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabsModules/RLTest.git@master /usr/bin/python3 -m pip install --disable-pip-version-check --no-cache-dir --ignore-installed git+https://github.com/RedisLabs/RAMP@master /usr/bin/python3 -m pip install --disable-pip-version-check -r tests/requirements.txt ``` -------------------------------- ### Quick Start: Load Data Source: https://docs.falkordb.com/integration/pyg.html Start FalkorDB using Docker and load sample data into a graph using the FalkorDB Python client. ```bash docker run -p 6379:6379 falkordb/falkordb:latest ``` ```python from falkordb import FalkorDB db = FalkorDB(host="localhost", port=6379) graph = db.select_graph("papers") # Create nodes with features and labels graph.query("CREATE (:paper {x: [1.0, 0.0, 1.0], y: 0})") graph.query("CREATE (:paper {x: [0.0, 1.0, 0.5], y: 1})") # Create edges graph.query( "MATCH (a:paper), (b:paper) " "WHERE ID(a) = 0 AND ID(b) = 1 " "CREATE (a)-[:cites]->(b)" ) ``` -------------------------------- ### Install FalkorDB Lite Source: https://docs.falkordb.com/operations/falkordblite/falkordblite-ts Install FalkorDB Lite using npm. Optionally, install the remote client if you plan to connect to an external server. ```bash npm install falkordblite # Optional: also install the remote client when you plan to connect to an external server npm install falkordb ``` -------------------------------- ### Attribute Configuration Example Source: https://docs.falkordb.com/integration/rest.html Example demonstrating how to configure an attribute with STRING type, a default name, not unique, and required. ```plaintext ["STRING", "default_name", "false", "true"] ``` -------------------------------- ### Mem0 FalkorDB Configuration Example Source: https://docs.falkordb.com/agentic-memory/mem0.html Example configuration for Mem0 to use FalkorDB, including connection details for a self-hosted instance. ```python config = { "graph_store": { "provider": "falkordb", "config": { "host": "localhost", # FalkorDB server host "port": 6379, # FalkorDB server port "database": "mem0", # Graph name prefix "username": None, # Authentication username (optional) "password": None, # Authentication password (optional) "base_label": True, # Use __Entity__ base label }, }, } ``` -------------------------------- ### Query Vector Index Examples Source: https://docs.falkordb.com/cypher/indexing/vector-index Examples of querying for similar nodes across different language drivers. ```python result = graph.query("CALL db.idx.vector.queryNodes('Product', 'description', 10, vecf32()) YIELD node") ``` ```javascript const result = await graph.query("CALL db.idx.vector.queryNodes('Product', 'description', 10, vecf32()) YIELD node"); ``` ```rust let result = graph.query("CALL db.idx.vector.queryNodes('Product', 'description', 10, vecf32()) YIELD node").execute().await?; ``` ```java ResultSet result = graph.query("CALL db.idx.vector.queryNodes('Product', 'description', 10, vecf32()) YIELD node"); ``` ```shell CALL db.idx.vector.queryNodes( 'Product', 'description', 10, vecf32() ) YIELD node ``` -------------------------------- ### Create Graph Example Source: https://docs.falkordb.com/algorithms/msf Example of creating a graph with nodes and relationships for use with the MSF algorithm. ```APIDOC ## CREATE Graph ### Description Creates a sample graph with different node labels and relationship types, including a 'cost' property on the relationships, suitable for demonstrating the MSF algorithm. ### Method CREATE ### Endpoint N/A (Cypher statement) ### Request Example ```cypher CREATE (CityHall:GOV), (CourtHouse:GOV), (FireStation:GOV), (Electricity:UTIL), (Water:UTIL), (Building_A:RES), (Building_B:RES), (CityHall)-[rA:ROAD {cost: 2.2}]->(CourtHouse), (CityHall)-[rB:ROAD {cost: 8.0}]->(FireStation), (CourtHouse)-[rC:ROAD {cost: 3.4}]->(Building_A), (FireStation)-[rD:ROAD {cost: 3.0}]->(Building_B), (Building_A)-[rF:ROAD {cost: 5.2}]->(Building_B), (Electricity)-[rG:ROAD {cost: 0.7}]->(Building_A), (Water)-[rH:ROAD {cost: 2.3}]->(Building_B), (CityHall)-[tA:TRAM {cost: 1.5}]->(Building_A), (CourtHouse)-[tB:TRAM {cost: 7.3}]->(Building_B), (FireStation)-[tC:TRAM {cost: 1.2}]->(Electricity) RETURN * ``` ``` -------------------------------- ### Install Graphiti with FalkorDB support Source: https://docs.falkordb.com/agentic-memory/graphiti.html Use this command to install the core library with the necessary FalkorDB dependencies. ```bash pip install graphiti-core[falkordb] ``` -------------------------------- ### Mem0 FalkorDB Cloud Configuration Example Source: https://docs.falkordb.com/agentic-memory/mem0.html Example configuration for Mem0 to use FalkorDB Cloud, including connection details like host, username, and password. ```python config = { "graph_store": { "provider": "falkordb", "config": { "host": "your-instance.falkordb.cloud", "port": 6379, "username": "default", "password": "your-password", "database": "mem0", }, }, # ... rest of config } ``` -------------------------------- ### Install Python Dependencies Source: https://docs.falkordb.com/operations/migration/rdf-to-falkordb.html Install the required Python packages listed in the requirements.txt file. ```bash pip3 install -r requirements.txt ``` -------------------------------- ### Start Services with Docker Compose Source: https://docs.falkordb.com/agentic-memory/graphiti-mcp-server.html Command to start the defined services in detached mode. ```bash docker-compose up -d ``` -------------------------------- ### Install LangChain with FalkorDB Support (Python) Source: https://docs.falkordb.com/genai-tools/langchain.html Install the necessary Python packages for LangChain and FalkorDB integration. This command installs the core LangChain library, the community components, and the FalkorDB package. ```bash pip install langchain langchain-community falkordb ``` -------------------------------- ### Control Plane Server Start Source: https://docs.falkordb.com/operations/migration/sql-to-falkordb.html Instructions for starting the FalkorDB Control Plane server, including optional API key configuration. ```APIDOC ## Control Plane Server Start ### Description Starts the control plane server which provides a web UI and API for managing FalkorDB tools and configurations. ### Start Server ```bash cd control-plane/server # Optional: require API key on /api (except /api/health) export CONTROL_PLANE_API_KEY="..." cargo run --release ``` ### Default Server URL `http://localhost:3003` ### Configuration (Environment Variables) - `CONTROL_PLANE_BIND` (default `0.0.0.0:3003`) - `CONTROL_PLANE_REPO_ROOT` (optional; repository root for manifest scan) - `CONTROL_PLANE_DATA_DIR` (default `control-plane/data/`) - `CONTROL_PLANE_UI_DIST` (default `control-plane/ui/dist/`) - `CONTROL_PLANE_API_KEY` (optional bearer token requirement) ``` -------------------------------- ### Install LangGraph and Dependencies Source: https://docs.falkordb.com/genai-tools/langgraph.html Install the necessary packages to enable LangGraph, LangChain, and FalkorDB integration. ```bash pip install langgraph langchain langchain-community falkordb langchain-openai ``` -------------------------------- ### Start FalkorDB Control Plane Server Source: https://docs.falkordb.com/operations/migration/sql-to-falkordb.html Navigate to the control plane server directory and run the release build to start the server. Optionally, set an environment variable to require an API key for most API endpoints. ```bash cd control-plane/server # Optional: require API key on /api (except /api/health) export CONTROL_PLANE_API_KEY="..." cargo run --release ``` -------------------------------- ### Start FalkorDB with Docker Source: https://docs.falkordb.com/genai-tools/ag2.html Run a local instance of FalkorDB using Docker for development. ```bash docker run -p 6379:6379 -p 3000:3000 -it --rm falkordb/falkordb:latest ``` -------------------------------- ### Install Mem0 and FalkorDB Plugin Source: https://docs.falkordb.com/agentic-memory/mem0.html Install the necessary Python packages for Mem0 and the FalkorDB plugin using pip. ```bash pip install mem0ai pip install mem0-falkordb ``` -------------------------------- ### Install FalkorDB Rust Loader Source: https://docs.falkordb.com/operations/migration/kuzu-to-falkordb.html Clone and build the Rust loader binary from source. ```bash git clone https://github.com/FalkorDB/FalkorDB-Loader-RS cd FalkorDB-Loader-RS cargo build --release ``` -------------------------------- ### Install FalkorDB and OpenTelemetry Packages with Poetry Source: https://docs.falkordb.com/operations/opentelemetry Install the necessary Python packages for FalkorDB and OpenTelemetry using Poetry. ```bash poetry add falkordb poetry add opentelemetry-distro poetry add opentelemetry-instrumentation-redis poetry add opentelemetry-exporter-otlp poetry add opentelemetry-sdk ``` -------------------------------- ### Install Cognee and FalkorDB Adapter Source: https://docs.falkordb.com/agentic-memory/cognee.html Use pip to install the core Cognee library and the community hybrid adapter for FalkorDB. ```bash pip install cognee pip install cognee-community-hybrid-adapter-falkor ``` -------------------------------- ### Clone and Setup Repository Source: https://docs.falkordb.com/operations/migration/sql-to-falkordb.html Initial steps to download the migration tools and prepare the environment. ```bash git clone https://github.com/FalkorDB/DM-SQL-to-FalkorDB.git cd DM-SQL-to-FalkorDB ``` -------------------------------- ### Quick Start with Sample Data Source: https://docs.falkordb.com/integration/snowflake.html Initializes the service and loads a built-in social network dataset for testing purposes. ```SQL -- 1. Make sure the service is running CALL .app_public.get_service_status(); -- 2. Load built-in sample social network (5 people with relationships) CALL .app_public.load_sample_social_network(); -- 3. Query the sample data CALL .app_public.graph_query('demo_social_network', 'MATCH (p:Person) RETURN p.name, p.age, p.city' ); -- 4. Find relationships in the sample network CALL .app_public.graph_query('demo_social_network', 'MATCH (a:Person)-[r:KNOWS]->(b:Person) RETURN a.name, b.name, r.since' ); ``` -------------------------------- ### Install OpenMP Runtime on macOS Source: https://docs.falkordb.com/operations/falkordblite/falkordblite-py On macOS, if you encounter a 'Library not loaded: /opt/homebrew/opt/libomp/lib/libomp.dylib' error, install the OpenMP runtime library using Homebrew. ```bash brew install libomp ``` -------------------------------- ### Get Node Information Example Source: https://docs.falkordb.com/integration/rest.html Retrieve detailed information for a specific node, including its ID, labels, and properties. ```json { "result": { "data": [ { "node": { "id": 1, "labels": ["Person"], "properties": { "name": "John Doe", "age": 30 } }, "relationships": [] } ] } } ``` -------------------------------- ### Run FalkorDB Server Only Source: https://docs.falkordb.com/operations/docker Starts the lightweight server-only image for production environments. ```bash docker run -p 6379:6379 -it --rm falkordb/falkordb-server:latest ``` -------------------------------- ### Loader Output Example Source: https://docs.falkordb.com/operations/migration/neo4j-to-falkordb.html Sample console output showing the connection, schema creation, and data loading process. ```text Connecting to FalkorDB at localhost:6379... ✅ Connected to FalkorDB graph 'MOVIES' Found 2 node files and 6 edge files 🗼️ Setting up database schema... 🔧 Creating ID indexes for all node labels... Creating ID index: CREATE INDEX ON :Movie(id) Creating ID index: CREATE INDEX ON :Person(id) ✅ Created 2 ID indexes 🔧 Creating indexes from CSV... ... ✅ Created 2 indexes from CSV 🔒 Creating constraints... ... ✅ Created 2 constraints 📥 Loading nodes... Loading nodes from csv_output/nodes_movie.csv... ✅ Loaded 38 Movie nodes 🔗 Loading edges... Loading edges from csv_output/edges_acted_in.csv... ✅ Loaded 172 ACTED_IN relationships ✅ Successfully loaded data into graph 'MOVIES' 📊 Graph Statistics: Nodes: ['Movie']: 38 ['Person']: 133 Relationships: ACTED_IN: 172 DIRECTED: 44 ... ``` -------------------------------- ### Get Graph Information Example Source: https://docs.falkordb.com/integration/rest.html Retrieve information about graph elements like labels. Ensure the 'type' parameter is correctly specified. ```json { "result": { "data": [ {" (label)": "Person"}, {" (label)": "Company"} ] } } ``` -------------------------------- ### Initialize Directory and Configuration Source: https://docs.falkordb.com/agentic-memory/graphiti-mcp-server.html Commands to create a project directory and download the necessary Docker Compose configuration. ```bash mkdir graphiti-mcp && cd graphiti-mcp ``` ```bash curl -O https://raw.githubusercontent.com/getzep/graphiti/main/mcp_server/docker/docker-compose.yml ``` -------------------------------- ### Get Token Metadata Responses Source: https://docs.falkordb.com/integration/rest.html Example JSON responses for retrieving specific token metadata, including success and error scenarios. ```json { "token": { "user_id": "e5d09e7d2141f77f80008ff73f04104b9484f59baa8e19a4ea758495d289fd0f", "token_id": "1761053108078-554350d7-c965-4ed7-8d32-679b7f705e81", "created_at": "2025-10-21T13:25:08.085Z", "expires_at": "2026-10-21T13:25:08.085Z", "last_used": null, "name": "API Token", "permissions": ["Read-Only"], "username": "readonlyuser" } } ``` ```json { "message": "Forbidden: You can only view your own tokens" } ``` ```json { "message": "Token not found" } ``` -------------------------------- ### Reduce Function Example Source: https://docs.falkordb.com/cypher/functions Calculates the sum of elements in a list starting from an initial value. The `reduce` function iteratively updates an accumulator. ```cypher RETURN reduce(sum = 0, n IN [1,2,3] | sum + n) ``` -------------------------------- ### Initialize and use Graphiti with FalkorDB Source: https://docs.falkordb.com/agentic-memory/graphiti.html A complete example demonstrating how to connect to FalkorDB, build indices, add an episode, and perform a search. ```python import asyncio from datetime import datetime from graphiti_core import Graphiti from graphiti_core.nodes import EpisodeType async def main(): # Initialize Graphiti with FalkorDB graphiti = Graphiti( uri="falkor://localhost:6379", # Your FalkorDB connection string # For FalkorDB Cloud: # uri="falkor://your-instance.falkordb.cloud:6379", # username="default", # password="your-password" ) # Build indices (run once during setup) await graphiti.build_indices_and_constraints() # Add an episode (information to be stored in the graph) episode_body = """ Alice met Bob at the AI conference in San Francisco on March 15, 2024. They discussed the latest developments in graph databases and decided to collaborate on a new project using FalkorDB. """ await graphiti.add_episode( name="Conference Meeting", episode_body=episode_body, episode_type=EpisodeType.text, reference_time=datetime(2024, 3, 15), source_description="Conference notes" ) # Search the knowledge graph search_results = await graphiti.search( query="What did Alice and Bob discuss?", num_results=5 ) print("Search Results:") for result in search_results: print(f"- {result}") # Close the connection await graphiti.close() # Run the example asyncio.run(main()) ``` -------------------------------- ### Run FalkorDB Docker Container Source: https://docs.falkordb.com/integration/bolt-support.html Starts a FalkorDB Docker container with BOLT protocol enabled on port 7687. Ensure you have Docker installed. ```bash docker run -p 6379:6379 -p 7687:7687 -p 3000:3000 -it -e REDIS_ARGS="--requirepass falkordb" -e FALKORDB_ARGS="BOLT_PORT 7687" --rm falkordb/falkordb:latest ``` -------------------------------- ### Troubleshoot Service Not Starting Source: https://docs.falkordb.com/integration/snowflake.html Steps to troubleshoot service startup issues, including checking logs and restarting the service. Ensure the correct application instance name is used. ```sql -- Check logs CALL .app_public.get_service_logs('0', 'falkordb', 200); ``` ```sql -- Restart service CALL .app_public.stop_app(); CALL .app_public.start_app('FALKORDB_POOL', 'FALKORDB_WH'); ``` -------------------------------- ### Initialize Cognee with FalkorDB Source: https://docs.falkordb.com/agentic-memory/cognee.html A complete example demonstrating configuration of local directories, database providers, and performing a graph completion search. ```python import asyncio import os import pathlib from os import path from cognee import config, prune, add, cognify, search, SearchType # Import the register module to enable FalkorDB support import cognee_community_hybrid_adapter_falkor.register async def main(): # Set up local directories system_path = pathlib.Path(__file__).parent config.system_root_directory(path.join(system_path, ".cognee_system")) config.data_root_directory(path.join(system_path, ".cognee_data")) # Configure relational database config.set_relational_db_config({ "db_provider": "sqlite", }) # Configure FalkorDB as both vector and graph database config.set_vector_db_config({ "vector_db_provider": "falkordb", "vector_db_url": os.getenv("GRAPH_DB_URL", "localhost"), "vector_db_port": int(os.getenv("GRAPH_DB_PORT", "6379")), }) config.set_graph_db_config({ "graph_database_provider": "falkordb", "graph_database_url": os.getenv("GRAPH_DB_URL", "localhost"), "graph_database_port": int(os.getenv("GRAPH_DB_PORT", "6379")), }) # Optional: Clean previous data await prune.prune_data() await prune.prune_system() # Add and process your content text_data = """ Sarah is a software engineer at TechCorp. She specializes in machine learning and has been working on implementing graph-based recommendation systems. Sarah recently collaborated with Mike on a new project using FalkorDB. Mike is the lead data scientist at TechCorp. """ await add(text_data) await cognify() # Search using graph completion search_results = await search( query_type=SearchType.GRAPH_COMPLETION, query_text="What does Sarah work on?" ) print("Search Results:") for result in search_results: print("\n" + result) # Run the example asyncio.run(main()) ``` -------------------------------- ### Installation Source: https://docs.falkordb.com/integration/pyg.html Install the falkordb-pyg package. Ensure PyTorch and PyTorch Geometric are installed first. You can install with PyTorch and PyG included (CPU-only defaults). ```bash pip install falkordb-pyg pip install 'falkordb-pyg[torch]' ``` -------------------------------- ### Initialize FalkorDB and Run QA Chain (JS/TS) Source: https://docs.falkordb.com/genai-tools/langchain.html Demonstrates initializing a FalkorDB connection, setting up a language model, creating and populating a graph, and running a GraphCypherQAChain to answer questions. ```javascript import { FalkorDBGraph } from "@falkordb/langchain-ts"; import { ChatOpenAI } from "@langchain/openai"; import { GraphCypherQAChain } from "@langchain/community/chains/graph_qa/cypher"; // Initialize FalkorDB connection const graph = await FalkorDBGraph.initialize({ host: "localhost", port: 6379, graph: "movies" }); // Set up the language model const model = new ChatOpenAI({ temperature: 0 }); // Create and populate the graph await graph.query( "CREATE (a:Actor {name:'Bruce Willis'})" + "-[:ACTED_IN]->(:Movie {title: 'Pulp Fiction'})" ); // Refresh the graph schema await graph.refreshSchema(); // Create a graph QA chain const chain = GraphCypherQAChain.fromLLM({ llm: model, graph: graph as any, }); // Ask questions about your graph const response = await chain.run("Who played in Pulp Fiction?"); console.log(response); // Output: Bruce Willis played in Pulp Fiction. await graph.close(); ``` -------------------------------- ### GET /api/graph Source: https://docs.falkordb.com/integration/rest.html Get a list of all graphs in the FalkorDB instance. ```APIDOC ## GET /api/graph ### Description Get a list of all graphs in the FalkorDB instance. ### Method GET ### Endpoint /api/graph ### Response #### Success Response (200) - **opts** (array) - List of graphs retrieved successfully #### Response Example { "opts": [ "social_network", "product_catalog", "user_interactions" ] } ``` -------------------------------- ### Production Setup with Persistence Source: https://docs.falkordb.com/operations/docker Configures a production-ready server with data volumes, health checks, and append-only persistence. ```yaml version: '3.8' services: falkordb: image: falkordb/falkordb-server:latest container_name: falkordb-server ports: - "6379:6379" environment: - REDIS_ARGS=--requirepass ${FALKORDB_PASSWORD:-falkordb} --appendonly yes - FALKORDB_ARGS=THREAD_COUNT 8 TIMEOUT_MAX 30000 volumes: - falkordb_data:/data restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 3 volumes: falkordb_data: driver: local ``` -------------------------------- ### Install FalkorDB Addon with Helm Source: https://docs.falkordb.com/operations/kubeblocks Add the KubeBlocks addons Helm repository, update it, and install the FalkorDB addon using Helm. Verify the addon installation by listing Helm releases. ```bash # Add the KubeBlocks addons Helm repository helm repo add kubeblocks-addons https://apecloud.github.io/helm-charts helm repo update # Install the FalkorDB addon helm install falkordb-addon kubeblocks-addons/falkordb # Verify the addon is installed helm list -A | grep falkordb ``` -------------------------------- ### Manage Project Knowledge Base Source: https://docs.falkordb.com/agentic-memory/graphiti-mcp-server.html Demonstrates storing project-specific technology stacks and querying them later. ```text You: "Store this: MyApp is a web application built with React and FastAPI" AI: "I've stored that MyApp is a web application built with React and FastAPI." You: "What technologies does MyApp use?" AI: "MyApp uses React and FastAPI." ``` -------------------------------- ### Set up FalkorDB and MCP Server with Docker Compose Source: https://docs.falkordb.com/genai-tools/mcpserver/quickstart.html Clone the repository, configure your environment variables in `.env`, and run the services using Docker Compose. This starts both FalkorDB and the MCP server with health checks. ```bash git clone https://github.com/FalkorDB/FalkorDB-MCPServer.git cd FalkorDB-MCPServer cp .env.example .env # Edit to set MCP_API_KEY, FALKORDB_PASSWORD, etc. docker compose up -d ``` -------------------------------- ### Start FalkorDB Instance Source: https://docs.falkordb.com/integration/pyg.html Run a FalkorDB Docker container to set up a local instance for testing or development. ```bash docker run -p 6379:6379 falkordb/falkordb:latest ``` -------------------------------- ### Install Kuzu Python Package Source: https://docs.falkordb.com/operations/migration/kuzu-to-falkordb.html Install the required Kuzu dependency via pip. ```bash pip3 install kuzu ``` -------------------------------- ### Install falkordb-pyg Source: https://docs.falkordb.com/integration/pyg.html Install the falkordb-pyg package. Optionally, include PyTorch and PyG dependencies. ```bash pip install falkordb-pyg ``` ```bash pip install 'falkordb-pyg[torch]' ``` -------------------------------- ### Basic Docker Compose Setup Source: https://docs.falkordb.com/operations/docker Defines a standard FalkorDB service with authentication and thread configuration. ```yaml version: '3.8' services: falkordb: image: falkordb/falkordb:latest container_name: falkordb ports: - "6379:6379" - "3000:3000" environment: - REDIS_ARGS=--requirepass falkordb - FALKORDB_ARGS=THREAD_COUNT 4 restart: unless-stopped ``` -------------------------------- ### Java Example Source: https://docs.falkordb.com/commands/graph.copy.html Example of using the `copyGraph` method in the Java client to copy a graph. ```APIDOC ## Java Example ### Description Demonstrates how to copy a graph from 'A' to 'Z' using the FalkorDB Java client. ### Method `client.copyGraph("A", "Z")` ### Endpoint N/A (Client-side method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```java import io.falkordb.FalkorDB; import io.falkordb.Graph; import io.falkordb.ResultSet; FalkorDB client = new FalkorDB(); // Create Graph 'A' Graph graphA = client.selectGraph("A"); graphA.query("CREATE (:Account {number: 516637})"); // Copy Graph 'A' to 'Z' client.copyGraph("A", "Z"); Graph graphZ = client.selectGraph("Z"); // Query Graph 'Z' ResultSet result = graphZ.query("MATCH (a:Account) RETURN a.number"); System.out.println(result); ``` ### Response #### Success Response (200) - **result** (ResultSet) - The result of the query on graph 'Z'. #### Response Example ```json [ ["a.number"], [1, [516637]] ] ``` ``` -------------------------------- ### Rust Example Source: https://docs.falkordb.com/commands/graph.copy.html Example of using the `copy_graph` method in the Rust client to copy a graph. ```APIDOC ## Rust Example ### Description Demonstrates how to copy a graph from 'A' to 'Z' using the FalkorDB Rust client. ### Method `client.copy_graph("A", "Z")` ### Endpoint N/A (Client-side method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```rust use falkordb::{FalkorDB, Graph}; let client = FalkorDB::connect_default(); let graph_a = client.select_graph("A"); graph_a.query("CREATE (:Account {number: 516637})")?; client.copy_graph("A", "Z")?; let graph_z = client.select_graph("Z"); let result = graph_z.query("MATCH (a:Account) RETURN a.number")?; println!("{:?}", result); ``` ### Response #### Success Response (200) - **result** (string) - The result of the query on graph 'Z', typically a JSON string representation. #### Response Example ```json [ ["a.number"], [1, [516637]] ] ``` ``` -------------------------------- ### JavaScript Example Source: https://docs.falkordb.com/commands/graph.copy.html Example of using the `copyGraph` method in the JavaScript client to copy a graph. ```APIDOC ## JavaScript Example ### Description Demonstrates how to copy a graph from 'A' to 'Z' using the FalkorDB JavaScript client. ### Method `client.copyGraph('A', 'Z')` ### Endpoint N/A (Client-side method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript import { FalkorDB } from 'falkordb'; const client = await FalkorDB.connect(); // Create Graph 'A' const graphA = client.selectGraph('A'); await graphA.query("CREATE (:Account {number: 516637})"); // Copy Graph 'A' to 'Z' await client.copyGraph('A', 'Z'); // Query Graph 'Z' const graphZ = client.selectGraph('Z'); const result = await graphZ.query("MATCH (a:Account) RETURN a.number"); console.log(result); ``` ### Response #### Success Response (200) - **result** (object) - The result of the query on graph 'Z'. #### Response Example ```json { "data": [ ["a.number"], [1, [516637]] ] } ``` ```