npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentproto/adapter-knowledge-qdrant

v0.3.3

Published

Knowledge adapter: implements @agentproto/knowledge-engine's IKnowledgeProvider over a Qdrant collection via pure fetch (upsert/search/scroll) with OpenAI-compatible embeddings (text-embedding-3-small, 1536d). Optional tenant-scoped payload filtering isol

Readme

@agentproto/adapter-knowledge-qdrant

The vector-search backing for the @agentproto/knowledge-engine IKnowledgeProvider contract.

Implements the ingest/query contract over a Qdrant collection, reached via pure fetch (no vendor SDK), with OpenAI-compatible embeddings (text-embedding-3-small, 1536d, by default — routable to Azure / Ollama / vLLM via OPENAI_BASE_URL). An optional tenantId payload scope isolates many tenants inside one shared collection.

The vector-search sibling of @agentproto/adapter-knowledge-files (BM25) and @agentproto/adapter-knowledge-corpus (AIP-10 composition).

Tenant scope, not guild scope. This adapter was lifted from a studio provider whose tenant partition key was named guildId. That field was renamed to a generic tenantId on the re-home — nothing here imports @agstudio/* or knows what a guild is; it is a plain multi-tenant partition key on the point payload.

What's in the box

| Export | Role | | --- | --- | | QdrantKnowledgeAdapter | The IKnowledgeProvider implementation. Config-driven — consumes a plain QdrantAdapterConfig; knows nothing about process.env. | | QdrantAdapterConfigSchema / parseQdrantAdapterConfig | The zod config contract (endpoint, collection, embeddings, optional tenantId). | | translateFilter | The CorpusFilter → Qdrant payload-filter translation (exported for testing). | | loadQdrantKnowledgeEnv / qdrantEnvToConfig | The typed env module — the ONE place QDRANT_* / OPENAI_* are read. | | createStandaloneQdrantAdapter() | Wires the typed env into a ready-to-use adapter. | | provider-kit family (KNOWLEDGE_QDRANT_CATALOG, makeKnowledgeQdrantResolver, resolveKnowledgeBackend) | Registers the qdrant backend under the @agentproto/adapter-knowledge-* discovery convention. |

Environment

| Var | Required | Default | Meaning | | --- | --- | --- | --- | | QDRANT_URL | ✅ | — | Base URL of the Qdrant instance. | | QDRANT_API_KEY | | — | Sent as the api-key header (unsecured local deployments need none). | | QDRANT_COLLECTION | | knowledge | Collection to read/write (must exist with the right vector size). | | OPENAI_API_KEY | ✅ | — | Key for the OpenAI-compatible /embeddings call. | | OPENAI_EMBEDDING_MODEL | | text-embedding-3-small | Embedding model id (1536d). | | OPENAI_BASE_URL | | https://api.openai.com/v1 | Embeddings base URL (Azure / Ollama / vLLM). | | KNOWLEDGE_QDRANT_TENANT_ID | | — | Tenant scope. When set, ingest tags every point and query/get/delete force a must tenantId clause. |

Usage

import {
  QdrantKnowledgeAdapter,
  createStandaloneQdrantAdapter,
} from "@agentproto/adapter-knowledge-qdrant"

// From the ambient QDRANT_* / OPENAI_* env:
const kb = createStandaloneQdrantAdapter()

// Or construct directly (e.g. a host resolving a per-KB config + vault secret):
const direct = new QdrantKnowledgeAdapter({
  endpoint: "http://127.0.0.1:6333",
  collection: "knowledge",
  embeddingApiKey: process.env.OPENAI_API_KEY!,
  tenantId: "tenant-42", // optional — isolates this tenant in a shared collection
})

await kb.ingest({ kind: "text", uri: "doc://intro", content: "…" })
const { hits } = await kb.query({ query: "how do I ship", topK: 5 })

Scope

Supported: ingest({ kind: "text" | "url" }), query (vector), listSources, getSource, deleteSource, healthCheck. Out of scope (throws a clean error): supersede() and explain() (a KnowledgeNotSupportedError — a vector collection has no lifecycle status or provenance chain; use the corpus adapter for those); kind: "file" | "connector" ingestion (needs a host-side resolver); graph / hybrid query modes (Qdrant is vector-only here — the adapter falls back to vector and stamps modeUsed: "vector").

Testing

Unit tests run against a mocked globalThis.fetch + a canned embeddings response — no live Qdrant and no real embeddings API (CI-safe). They assert the request shapes (upsert / search / scroll / delete), the result mapping, and the tenantId payload filter.

pnpm --filter @agentproto/adapter-knowledge-qdrant test

License

Apache-2.0