Skip to content

chore(ai): purge the devops-cli-kb project from Qdrant #6578

Open

Description

@devops-cli-service

Split from #3917.

Problem The knowledge base is in Qdrant two times: the tree ingest and the devops-cli-kb project. The tree copy is the one source after #3917. The devops-cli-kb project keeps a second copy that no reader updates. ## Why this part is deferred The purge is a live change on the cluster. It needs a reachable Qdrant and a person who runs it. #3917 changes the repository only. ## Acceptance criteria - The AI ingest status shows no project named devops-cli-kb. - The knowledge base is in Qdrant once, from the tree ingest. - A live search of the knowledge base returns no result from the devops-cli-kb project. - The purge is recorded in the comment of this issue.

Proposed design

Problem statement

Run the live purge after #3917 merges, with the Qdrant URL and API key. The live devops_docs collection still holds points for the project devops-cli-kb. No reader updates these points. This issue deletes them and records the result in a comment.

Acceptance criteria

Requirement: Purge the stale project points

After #3917 merges, a person SHALL delete every point whose payload project_name is devops-cli-kb from the live devops_docs collection.

Scenario: The filtered count is zero after the purge

  • WHEN A person sends POST $QDRANT_URL/collections/devops_docs/points/delete with the body {"filter":{"must":[{"key":"project_name","match":{"value":"devops-cli-kb"}}]}} and the api-key header, and then sends the same filter to POST $QDRANT_URL/collections/devops_docs/points/count.
  • THEN The count endpoint returns {"count":0}.

Requirement: The retrieval does not recreate the stale project

After the purge, the retrieval path MUST NOT write a point whose payload project_name is devops-cli-kb.

Scenario: A live retrieval leaves the filtered count at zero

  • WHEN A person runs one live knowledge-base retrieval through the devops ai rag command group, and then sends the devops-cli-kb filter to POST $QDRANT_URL/collections/devops_docs/points/count.
  • THEN The count endpoint returns {"count":0}.

Requirement: Pending a person after the merge

A person SHALL record the purge in a comment on this issue after the filtered count shows 0.

Scenario: The issue holds the purge record

  • WHEN A person reads the comments of this issue after the purge.
  • THEN One comment gives the date of the purge and the filtered count of 0.

Existing Tool Considered

No alternatives check has run. The open, maintained qdrant-client library covers the need. src/devops_cli/ai/rag/qdrant.py wraps it, and QdrantClient.delete_points_by_project sends a points delete with a project_name filter. It lacks a devops CLI subcommand for a one-off live delete. A person sends the documented POST /collections/devops_docs/points/delete request with the cluster URL and API key, or calls the existing wrapper once. The change builds no code, so it has no build cost in tokens or time.

Key questions

  • Does the devops-cli-kb project live in its own collection or in a payload field?: It is a payload value in the devops_docs collection. CONST_RAG_KB_PROJECT holds the string devops-cli-kb, and the indexer writes it to payload["project_name"]. The purge filters points by project_name, not by a collection. [sources: src/devops_cli/config/constants.py:3146, src/devops_cli/ai/rag/indexer.py, src/devops_cli/ai/rag/qdrant.py]
  • Which command shows the projects of the knowledge base?: The cited modules do not show a command that lists the projects of the knowledge base. A project-level read is a points count with a project_name filter. This proposal uses that count. [sources: src/devops_cli/commands/rag.py, src/devops_cli/commands/ai.py, src/devops_cli/ai/rag/qdrant.py]
  • Does the purge alone remove the duplicate for good?: No. The retrieval path calls ensure_knowledge_base_ready before the search, and that function can write the knowledge base project again. refactor(ai): drop the knowledge base copies of project docs #3917 must remove that write path first. This issue then waits for refactor(ai): drop the knowledge base copies of project docs #3917 and purges the stale points. [sources: src/devops_cli/ai/rag/kb_sync.py:155, src/devops_cli/commands/rag.py, src/devops_cli/commands/ai.py, src/devops_cli/ai/tools/builtin_tools.py]
  • Which tool performs the purge?: The qdrant-client library through the wrapper at src/devops_cli/ai/rag/qdrant.py covers the delete with a project_name filter. A person runs one live call with the cluster URL and the API key. The change adds no dependency and no code. (best practice) [sources: src/devops_cli/ai/rag/qdrant.py, AGENTS.md]
    • Chosen: Qdrant points delete with a project_name filter. qdrant-client is already a dependency, and QdrantClient.delete_points_by_project sends the documented delete. It is one live call.
    • Rejected: A new devops ai rag purge command. It adds a command and tests for a one-time live delete. AGENTS.md rule 3 puts an open tool before code that the project builds and keeps.
    • Rejected: Drop and rebuild the devops_docs collection. It deletes the tree-ingest points too and needs a full re-embed, which costs time and tokens for no gain.
    • Rejected: Keep the devops-cli-kb points and stop the readers. The duplicate stays, and a reader can return a stale result.
  • What is the scope of this issue?: Only the live purge and its record in a comment. refactor(ai): drop the knowledge base copies of project docs #3917 changes the repository so the tree ingest is the only writer. This issue then deletes the stale points and records the date and the count. This issue changes no repository code. (best practice) [sources: src/devops_cli/ai/rag/kb_sync.py:155, src/devops_cli/ai/rag/indexer.py]

Fit

Fits in one pull request.

Suspected block

A person must run the live purge with the Qdrant URL and API key after #3917 merges.

Dependencies

#3917

Activity

  1. added
    type/chore
    scope/ai
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 21, 2026
  2. devops-cli-service commented on Nov 21, 2026

    @devops-cli-service
    ContributorAuthor
  3. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    ContributorAuthor

    Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.

  4. devops-cli-service commented on Nov 25, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  5. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  6. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  7. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  8. devops-cli-service commented on Dec 1, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/aisource/agentstatus/newtype/chorevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions