This document tells you how to run the full system on your computer:
- Pinecone Local
- the two gRPC services
- the GraphQL gateway
- the React UI
Each step has a check, so that you can make sure that the step worked before you continue.
-
JDK 26, Maven, Docker with the Docker Compose plugin, Node.js, and Python 3.
-
Apple Silicon (M-series) Macs: The Maven build generates gRPC code with
protoc-gen-grpc-java. Its macOS binaries are x86_64, also for the "aarch_64" classifier. This is an upstream packaging problem, not a problem in this repository. Install Rosetta 2 before you build:softwareupdate --install-rosetta --agree-to-license
You do not need Rosetta 2 for the
pinecone-localimage. That image is also x86_64 only, but Docker runs it in emulation.docker-compose.ymlalready setsplatform: linux/amd64.
./scripts/download-data.shThis script puts four files into data/:
product.csv,query.csv, andlabel.csvfromwayfair/WANDSclickstream.csv, the synthetic clickstream fromavantiwhenever/WANDS
Check: Run wc -l data/*.csv. Each file has one header line. The expected line counts are:
| File | Lines |
|---|---|
product.csv |
42,995 |
query.csv |
481 |
label.csv |
233,449 |
clickstream.csv |
170,991 |
./scripts/download-models.shThis script puts the ONNX weights and the tokenizer of bge-small-en-v1.5 into models/bge-small-en-v1.5/.
Check: The directory contains model.onnx (approximately 128 MB), tokenizer.json, and config.json.
recommender-service loads this model when it starts. Thus, train the model before you start the services.
cd training
pip install -r requirements.txt
python train_neural_ranker.py
cd ..This step trains a pairwise XGBoost ranking model on the clickstream in data/clickstream.csv. It exports the model to models/neural-ranker/model.onnx. For the method and the results, see training/TRAINING.md.
Check: The file models/neural-ranker/model.onnx exists.
If you train the model again while the services operate, restart recommender-service:
docker compose restart recommender-service./scripts/start-services.shThis script builds and starts five containers. Then it waits until graphql-gateway responds.
If another application already uses port 8080 or 5173, set different ports before you start:
export GATEWAY_HOST_PORT=18080 WEB_HOST_PORT=15173Check: Run docker compose ps. These five containers must show the status "running", not "restarting" or "exited":
pinecone-localsearch-servicerecommender-servicegraphql-gatewayweb
./scripts/ingest-catalog.shThis script rebuilds search-service, so that it uses your latest local changes. Then it runs the ingestion tool in the Docker Compose network.
- The tool must run in the network, not on the host. Pinecone Local always returns its internal container hostname as the data-plane host. See docs/PROJECT_STATE.md.
- The tool calculates an embedding for each of the approximately 43,000 products and writes them to the
wands-productsindex. - This step uses much CPU time and takes a long time. The tool shows its progress at intervals.
Check: Run curl -s http://localhost:5080/indexes/wands-products. When the ingestion is complete, the vector count is more than zero.
Open http://localhost:8080/graphiql and run this query:
query {
search(query: "platform bed frame", strategy: COLLABORATIVE, topK: 5) {
products { name score source averageRating }
}
}Check:
- The response contains real WANDS products, not an error.
- Change
strategyto each ofNONE,POPULARITY,COLLABORATIVE,BANDIT,NEURAL, andDIVERSE_POPULARITY. The order of the results or thesourcefield changes.
Open http://localhost:5173.
Check:
- The search box returns results.
- A different strategy in the list changes the results.
- Each result shows a badge that tells why the system shows it.
./scripts/run-recommender-eval.shThis script scores all six strategies against the held-out clickstream sessions. It writes RESULTS.md in the repository root. For the method, see docs/EVALUATION.md.
Check: RESULTS.md has three tables. Each table has one row for each of the six strategies. If the code and the data did not change, only the latency column is different from the previous file.
python3 scripts/capture_demo_snapshots.py http://localhost:8080/graphqlThis script runs a set of queries with all six strategies. It writes the results into docs/data/*.json. The static demo page docs/index.html reads these files.
The first argument is the gateway URL. If you do not give it, the script uses http://localhost:18080/graphql.
Check:
docs/data/manifest.jsonlists the captured files.- Start a local web server in
docs/, for examplepython3 -m http.server. Open the page and make sure that it shows the new data.
./scripts/stop-services.sh| Script | What it does |
|---|---|
scripts/download-data.sh |
Downloads the WANDS and clickstream files into data/ |
scripts/download-models.sh |
Downloads the embedding model into models/ |
scripts/start-services.sh |
Runs docker compose up --build, then waits for the gateway |
scripts/wait-for-gateway.sh |
Waits until a host responds. start-services.sh uses it. |
scripts/stop-services.sh |
Runs docker compose down |
scripts/ingest-catalog.sh |
Runs the ingestion tool in the Docker Compose network |
scripts/run-recommender-eval.sh |
Runs the offline evaluation and writes RESULTS.md |
scripts/capture_demo_snapshots.py |
Captures live query results into docs/data/ for the GitHub Pages demo |
scripts/scan-cves.sh |
Runs the CI cve-scan job on your computer with Trivy |
Use this method when you develop one part of the system.
-
Java services. First, install
rec-support:mvn -pl rec-support install
Then start a service with
mvn -pl <module> spring-boot:run. Set the environment variables, for examplePINECONE_HOSTandGRPC_PORT, tolocalhostaddresses instead of the Docker Compose service names. -
Web UI. In
web/, runnpm run dev. SetVITE_GRAPHQL_URL=http://localhost:8080/graphql. -
Tests for one module. Run
mvn -pl <module> test. Do not use-am. The dependencies come from your local Maven repository. If you run builds in more than one terminal,-amcan make two builds write to the same shared module at the same time.