Skip to content

fix: make aiana installable and compatible with qdrant-client >= 1.12#17

Open
ry-ops wants to merge 2 commits into
mainfrom
fix/installable-and-qdrant-client-compat
Open

fix: make aiana installable and compatible with qdrant-client >= 1.12#17
ry-ops wants to merge 2 commits into
mainfrom
fix/installable-and-qdrant-client-compat

Conversation

@ry-ops

@ry-ops ry-ops commented Jun 13, 2026

Copy link
Copy Markdown
Owner

Summary

Three fixes so aiana's full (Qdrant-backed semantic) setup installs and actually returns results. Verified end-to-end on a fully local stack (local Qdrant + local sentence-transformers embedder + a local MLX model via OpenCode).

Bug 1 — pyproject.toml is unparseable (pip install fails)

Two optional-dependency entries had malformed version specifiers (doubled operator + stray quote):

"pytest>=">=9.0.3"          # -> "pytest>=9.0.3"
"cryptography>=">=46.0.6"   # -> "cryptography>=46.0.6"

Invalid TOML (tomllib.TOMLDecodeError: Unclosed array (at line 59)), so the package cannot be installed at all.

Bug 2 — QdrantStorage.search() calls a removed client method

qdrant-client >= 1.12 removed QdrantClient.search() in favor of QdrantClient.query_points(). The old call raised AttributeError, which _memory_search()'s try/except silently swallowed — so semantic search just returned nothing.

results = self.client.query_points(
    collection_name=COLLECTION_NAME, query=query_vector, limit=limit,
    query_filter=search_filter, score_threshold=min_score, with_payload=True,
).points

Bug 3 — default min_score too strict (empty results for relevant queries)

With all-MiniLM-L6-v2, clearly-relevant memories score ~0.40–0.48 for natural-language queries, while irrelevant content scores < 0.1. Measured example:

query top match score
"what model does the MLX lab use" "The MLX lab runs Qwen3.5-4B-4bit…" 0.475
"MLX lab model" (same) 0.404

The old min_score=0.5 floor dropped these relevant top hits, so memory_search returned nothing for reasonable queries. Lowered the default to 0.3, which surfaces the correct top result while still filtering noise.

Verification

Python 3.13, qdrant-client 1.18.0, local Qdrant + all-MiniLM-L6-v2:

  • pip install -e . succeeds.
  • memory_add stores a 384-dim vector in aiana_memories.
  • memory_search retrieves it via query_points and returns relevant hits at the new threshold.
  • Driven live: a local MLX model (Qwen3.5-4B) via OpenCode calls aiana_memory_add then aiana_memory_search; both requests are visible in the Qdrant access log (PUT .../points, POST .../points/query).
  • Backends init: SQLite + Redis + Qdrant + embedder (mem0 cleanly falls back with no LLM key configured).

🤖 Generated with Claude Code

ryandahlberg and others added 2 commits June 13, 2026 11:20
Two bugs prevented the full (Qdrant-backed semantic) setup from working.

1. Unparseable pyproject.toml. Two optional-dependency entries had malformed
   version specifiers with a doubled operator and stray quote:
     "pytest>=">=9.0.3"          ->  "pytest>=9.0.3"
     "cryptography>=">=46.0.6"   ->  "cryptography>=46.0.6"
   This is invalid TOML ("Unclosed array"), so `pip install` failed before any
   build step -- the package could not be installed at all.

2. QdrantStorage.search() used a removed client method. qdrant-client >= 1.12
   removed Client.search() in favor of Client.query_points(). Because
   _memory_search() wraps the Qdrant call in try/except, the resulting
   AttributeError was swallowed and semantic search silently returned nothing.
   Switched to query_points(query=..., ...).points (with_payload=True),
   preserving the existing result mapping.

Verified end-to-end against a local Qdrant + local sentence-transformers
embedder: memory_add stores a 384-dim vector and memory_search retrieves it
(e.g. score ~0.6 for a paraphrased query).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
With all-MiniLM-L6-v2, clearly-relevant memories score ~0.40-0.48 for
natural-language queries (e.g. 'what model does the MLX lab use' matched its
target memory at 0.475), while irrelevant content scores < 0.1. The previous
0.5 floor silently dropped the relevant top hit, so memory_search returned
nothing for reasonable queries. 0.3 surfaces the correct top result while still
filtering noise.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants