Skip to content

feat: topk adapter - #150

Open
petertoth wants to merge 5 commits into
topoteretes:mainfrom
topk-io:feat/topk-adapter
Open

feat: topk adapter#150
petertoth wants to merge 5 commits into
topoteretes:mainfrom
topk-io:feat/topk-adapter

Conversation

@petertoth

@petertoth petertoth commented Aug 10, 2026

Copy link
Copy Markdown

Description

Adds TopK as a community vector database adapter.

  • adapter scopes everything to a per-database collection prefix ({database_name}__)
  • create_data_points stores the LSN returned by each upsert in self._lsns in a dict, keyed by a collection name to keep read-your-own-writes consistency.

What's included:

  • TopKAdapter implementing VectorDBInterface (search, batch search, belongs_to_set
    node filtering with AND/OR, batched upserts under the API size limits, prefix-gated prune)
  • TopKDatasetDatabaseHandler for per-dataset isolation
  • Registration via from cognee_community_vector_adapter_topk import register
  • Tests, example and README: example.py, tests/test_topk.py, README.md

CI (TODO)

I haven't wired the test into CI (test_topk.yml + vector_db_community_tests.yml)
because the test runs against the live TopK API. The repo needs to add the TOPK_API_KEY secret.
TopK account as well as test project + API key needs to be provisioned at console.topk.io.

DCO Affirmation

I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin.

@petertoth
petertoth marked this pull request as ready for review August 19, 2026 13:46
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.

1 participant