Problem
The main client Dynavec provides batch search via db.search_many(queries: list[str], ...) to run several queries concurrently using a thread pool.
However, NamespaceView (returned by db.namespace(...)) exposes search() and search_stream(), but does not expose search_many(). Callers working with a namespace handle currently have to revert back to the root Dynavec instance and manually restate the namespace:
kb = db.namespace("knowledge-base")
# Currently not available:
# kb.search_many(["query 1", "query 2"])
# Workaround requires dropping back to root client:
db.search_many(["query 1", "query 2"], namespace=kb.namespace)
Proposed Solution
- Add
search_many() to NamespaceView in src/dynavec/namespace.py:
def search_many(
self, queries: list[str], *, top_k: int = 10, **kw
) -> list[list[SearchResult]]:
"""Run several queries concurrently pinned to this namespace."""
return self._db.search_many(queries, top_k=top_k, namespace=self._ns, **kw)
- Keep it as a thin delegation to the existing client batch search executor without introducing a second thread pool.
- Preserve all query options, keyword arguments, result types, and ordering.
Acceptance Criteria
Problem
The main client
Dynavecprovides batch search viadb.search_many(queries: list[str], ...)to run several queries concurrently using a thread pool.However,
NamespaceView(returned bydb.namespace(...)) exposessearch()andsearch_stream(), but does not exposesearch_many(). Callers working with a namespace handle currently have to revert back to the rootDynavecinstance and manually restate the namespace:Proposed Solution
search_many()toNamespaceViewinsrc/dynavec/namespace.py:Acceptance Criteria
tests/test_namespace.py(ortests/test_client.py):top_k, filters, etc.).queries=[].Dynavec.search_many().