Skip to content

add support for Qdrant cloud & fix path to run project from inside folder #2

Open
Goodnight77 wants to merge 2 commits into
Str0nkz:mainfrom
Goodnight77:feat/qdrant-cloud-support
Open

add support for Qdrant cloud & fix path to run project from inside folder #2
Goodnight77 wants to merge 2 commits into
Str0nkz:mainfrom
Goodnight77:feat/qdrant-cloud-support

Conversation

@Goodnight77

@Goodnight77 Goodnight77 commented Apr 10, 2026

Copy link
Copy Markdown

description

this PR adds Qdrant Cloud support and fixes the module import structure

changes

  • Qdrant Cloud Support: Added QDRANT_API_KEY environment variable and HTTPS URL handling
  • Import Fix: Changed relative imports to absolute imports, allowing the tool to run from within the project directory with
    python __main__.py
  • Documentation: Updated README with local and cloud configuration examples

usage

Local Qdrant:

export QDRANT_URL=http://localhost:6333
python __main__.py

Qdrant cloud:

export QDRANT_URL=https://<cluster-id>.<region>.cloud.qdrant.io
export QDRANT_API_KEY=<your-api-key>
python __main__.py

close issue #1

Copilot AI review requested due to automatic review settings April 10, 2026 23:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to add Qdrant Cloud connectivity (via QDRANT_API_KEY + HTTPS URL handling) and adjust the module/import structure so the CLI can be launched from within the project directory.

Changes:

  • Add QDRANT_API_KEY to configuration and plumb it into Qdrant-client initialization.
  • Update QdrantCleaner construction logic to support HTTPS/Qdrant Cloud via the url + api_key client parameters.
  • Update README and provide a .env.example for local/cloud configuration.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
README.md Documents local vs cloud configuration and updates run instructions.
config.py Adds QDRANT_API_KEY env var support.
cleaner.py Updates QdrantCleaner to initialize QdrantClient with url/api_key for cloud.
cleaner_cli.py Wires API key into CLI client creation; adjusts imports and URL parsing.
.env.example Adds example env vars for URL + API key.
__main__.py Changes CLI entry import to a bare-module import.
__init__.py Changes re-exports to bare-module imports.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cleaner.py
Comment on lines +13 to +14
from config import CANONICAL_TEXT_FIELDS, QDRANT_API_KEY
from dependencies import (

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These top-level imports switched to bare-module imports (from config ..., from dependencies ...). If this directory is used as a package (README advertises qdrant_manager.* and there are still relative imports in this file, e.g. from .dependencies import qdrant_models later), import qdrant_manager / python -m qdrant_manager will fail because config/dependencies won’t resolve as top-level modules. Please standardize the import strategy (e.g., keep explicit relative imports within the package, or use a dual-mode try/except import pattern consistently across the file).

Copilot uses AI. Check for mistakes.
Comment thread cleaner_cli.py
Comment on lines +8 to +9
from cleaner import QdrantCleaner
from config import QDRANT_DIRECT, QDRANT_API_KEY

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from cleaner import ... / from config import ... will break when this code is executed as an installed package/module (the README still references qdrant_manager.cleaner_cli and from qdrant_manager import ...). Prefer package-relative imports (or a consistent dual-mode import fallback) so both python -m qdrant_manager and programmatic imports keep working.

Suggested change
from cleaner import QdrantCleaner
from config import QDRANT_DIRECT, QDRANT_API_KEY
try:
from .cleaner import QdrantCleaner
from .config import QDRANT_DIRECT, QDRANT_API_KEY
except ImportError:
from cleaner import QdrantCleaner
from config import QDRANT_DIRECT, QDRANT_API_KEY

Copilot uses AI. Check for mistakes.
Comment thread cleaner_cli.py
Comment on lines 83 to 84
host = parsed.hostname or "localhost"
port = parsed.port or 6333

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_set_qdrant_url() parses the URL but then passes only parsed.hostname into QdrantCleaner. For https://...cloud.qdrant.io this strips the scheme, so QdrantCleaner won’t take the HTTPS/cloud path and will instead try host=<domain>, port=6333, which is incorrect for Qdrant Cloud. Pass the full URL (including scheme) through to QdrantCleaner, or preserve the scheme when building the endpoint so HTTPS + API key works.

Suggested change
host = parsed.hostname or "localhost"
port = parsed.port or 6333
if parsed.scheme and parsed.hostname:
host = qdrant_url
port = parsed.port or 6333
else:
host = parsed.hostname or "localhost"
port = parsed.port or 6333

Copilot uses AI. Check for mistakes.
Comment thread __main__.py
from __future__ import annotations

from .cleaner_cli import QdrantCleanerCLI
from cleaner_cli import QdrantCleanerCLI

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from cleaner_cli import QdrantCleanerCLI will fail when running as a package entry point (e.g. python -m qdrant_manager), because it imports a top-level cleaner_cli module instead of qdrant_manager.cleaner_cli. Use a package-relative import (or a dual-mode fallback) so both module execution and script execution work reliably.

Suggested change
from cleaner_cli import QdrantCleanerCLI
try:
from .cleaner_cli import QdrantCleanerCLI
except ImportError:
from cleaner_cli import QdrantCleanerCLI

Copilot uses AI. Check for mistakes.
Comment thread __init__.py
Comment on lines +2 to +3
from cleaner import QdrantCleaner
from cleaner_cli import QdrantCleanerCLI

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These imports changed to from cleaner ... / from cleaner_cli .... If this is a package (as implied by __init__.py and the README’s qdrant_manager.* examples), this will raise ModuleNotFoundError because cleaner/cleaner_cli aren’t top-level modules— they’re package modules. Use relative imports (e.g. from .cleaner import ...) or otherwise ensure package-qualified imports so import qdrant_manager works.

Suggested change
from cleaner import QdrantCleaner
from cleaner_cli import QdrantCleanerCLI
from .cleaner import QdrantCleaner
from .cleaner_cli import QdrantCleanerCLI

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines +29 to 42
The tool reads `QDRANT_URL` and `QDRANT_API_KEY` from the environment.

**Local Qdrant (Docker/self-hosted):**
```bash
export QDRANT_URL=http://localhost:6333
python -m qdrant_manager
python __main__.py
```

**Qdrant Cloud:**
```bash
export QDRANT_URL=https://<your-cluster-id>.<region>.cloud.qdrant.io
export QDRANT_API_KEY=<your-api-key>
python __main__.py
```

Copilot AI Apr 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README now instructs running python __main__.py, but the rest of the README still presents this as an importable package (qdrant_manager.* surface and from qdrant_manager import QdrantCleaner). These two modes require different import structures; as written, the docs are internally inconsistent and will likely confuse users. Please align the run instructions with the supported execution mode (e.g. prefer python -m qdrant_manager for package usage, or update the package-surface/programmatic examples if the project is moving to a script-only layout).

Copilot uses AI. Check for mistakes.
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