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. Pin the Aerospike Python client at 19 or newer. Client 18.x lacks index_single_value_create, which AerospikeSessionService uses when it creates secondary indexes on first connect.

  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. On the next pages you learn how sessions map to Aerospike records, then run the demo script.

Feedback

Was this page helpful?

What type of feedback are you giving?

What would you like us to know?

+Capture screenshot

Can we reach out to you?