Skip to content

Install and connect

For the complete documentation index see: llms.txt

All documentation pages available in markdown.

Start Aerospike, install Python packages, and confirm AerospikeSessionService connects.

Start Aerospike Database

  1. Start Aerospike in Docker:

    Terminal window
    docker run -d --name aerospike -p 3000-3002:3000-3002 container.aerospike.com/aerospike/aerospike-server
  2. Verify the database is listening on port 3000:

    Terminal window
    nc -z localhost 3000 && echo 'Aerospike database is running.'
    Expected result
    Connection to localhost port 3000 [tcp/hbci] succeeded!
    Aerospike database is running.

Install Python packages

  1. Create and activate a virtual environment:

    Terminal window
    python3.11 -m venv .venv
    source .venv/bin/activate

    On Windows, use .venv\Scripts\activate.

  2. Upgrade pip and install packages:

    Terminal window
    python -m pip install --upgrade pip
    python -m pip install "adk-aerospike>=0.1.0" "aerospike>=19"

    adk-aerospike pulls in google-adk. This demo requires the Aerospike Python client version 19 or later.

  3. Verify imports:

    Terminal window
    python -c "from adk_aerospike import AerospikeSessionService; print('ok')"
    Expected result
    ok

Connect to Aerospike

  1. Run a connectivity check:

    Terminal window
    python -c "
    from adk_aerospike import AerospikeSessionService
    s = AerospikeSessionService.from_uri('aerospike://localhost:3000/test')
    s.close()
    print('Connected to Aerospike.')
    "
    Expected result
    Connected to Aerospike.

    Compare your terminal output to the expected result.

The service is ready for the demo script on the next page.