Find Anything misses fresh detections on UNVR G2 while Keystone captions work

Open
#96 9 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
ollama, postgresql, python

Research direction

Start by reproducing the issue with keystone announce --port <Protect discovery port> and the clean unifi-protect PostgreSQL setup. Trace the fresh event from Keystone's indexed callback through the ramDetections table and the semantic search index, using the DEBUG and eventTagging logs. Done means the newly saved detection has a database row, is indexed, and is returned by the person walking across driveway Find Anything query.

Written by the indexing model from the issue text.

Description

accepted
What happened?
Environment
  • Keystone: 0.1.5, installed via Homebrew on a Mac Studio (M2 Ultra, 64 GB)
  • UniFi Protect: 7.3.74 on a UNVR G2
  • Database: PostgreSQL 18 with pgvector on the Mac Studio
  • Network: Mac Studio on VLAN 20, UNVR G2 on a separate VLAN
  • Test camera: G6 Pro Turret
Steps to reproduce
  1. Start with a clean Keystone install, a new virtual AI Key identity, and a fresh unifi-protect PostgreSQL database.
  2. Use keystone announce --port <Protect discovery port> to discover and adopt the virtual AI Key directly across VLANs. Confirm it shows Online in Protect.
  3. Walk a dog through the G6 Pro Turret’s view to create a fresh detection. Wait for Keystone to describe the event.
  4. In Find Anything, search for person walking across driveway and sort by Most Recent.
Expected behavior

Find Anything can retrieve the fresh detection that Keystone processed and Protect saved.

Actual behavior

Keystone generated the caption “Person walks dog across driveway at night.” Protect logged that it saved the recognition results. Find Anything returned two other detections and missed the test clip. A read-only count of "ramDetections" in the Mac Studio’s unifi-protect database returned 0 rows.

Relevant log timeline

All times below are UTC on December 4, 2026, as recorded in the Protect support logs.

Time | Observation -- | -- 06:28:27 | Protect successfully adopted the new virtual AI Key across VLANs. 06:28:30 | Protect connected to Keystone’s PostgreSQL and completed the search schema migrations. 06:30:05 | aiprocessors.db.log still identified the Built-in AI Controller as searchHost. I found no later switch to the virtual AI Key in the bundle. 06:35:57 | Protect logged Saved recognition results ... saved:[ram] for event 6df174f0-9d16-4fed-9c47-0e3ef7c2a55c. 06:39:05 | eventTagging.log recorded two embedding search results for person walking across driveway. Neither was the test clip.

Keystone logged indexed=2 for the test event. I checked the worker code and understand that this counts thumbnail tags and images in the callback. The database row count was a separate check.

Keystone version / commit

v0.1.5

UniFi Protect, UniFi OS, and console

Protect 7.3.74, UniFi OS 6.0.19, UNVR G2

Installation method

Other

Relevant config (sanitized)
controller:
  host: "<UNVR_IP>"

device:
  sync_postgres_password: true
  postgres_admin_url: "postgresql://keystone@/postgres?host=/tmp&port=5432"
  psql_path: /opt/homebrew/opt/postgresql@18/bin/psql

vision:
  provider: ollama
  base_url: "http://127.0.0.1:11434"

state_dir: /opt/homebrew/var/lib/keystone

acceleration:
  ffmpeg_hwaccel: none

log_level: DEBUG
Keystone DEBUG logs
DEBUG logging was enabled for this capture. Timestamps are AKST on December 3, 2026.


2026-12-03 22:08:34 INFO [keystone.embedder] Loaded CLIP text encoder text_model.onnx in 0.33s (provider=CPUExecutionProvider, load #1)
2026-12-03 22:08:35 INFO [keystone.semantic_search] Semantic Find Anything index ready: 5375 RAM tags (cache hit in 0.54s)
2026-12-03 22:08:35 INFO [keystone.search] Find Anything NL_PARSE query='person walking across driveway' -> visual='person walking across driveway' objectTypes=['person'] keyTags=2 semantic=True (569ms)


Keystone parsed the query in 569 ms. This excerpt does not show which database Protect used to retrieve results.
Additional context

Mac Studio M2 Ultra with 64 GB RAM, PostgreSQL 18 with pgvector, and a clean AI Key adoption across VLANs. Protect saved the recognition result, but the external ramDetections table contained 0 rows.

Dominant language
Python
Stars
1k
Forks
114
Avg merge
1h
Merged PRs (30d)
115

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seeARMS/keystone

All issues in seeARMS/keystone

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.