[PR #482] [CLOSED] QdrantSkillsMiddleware — vector-retrieved skills #504

Closed
opened 2026-06-05 17:23:29 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/482
Author: @inamdarmihir
Created: 4/22/2026
Status: Closed

Base: mainHead: main


📝 Commits (2)

  • 386018e chore: push changes from agent
  • 455ce4f chore: remove temporary diff.txt

📊 Changes

3 files changed (+11 additions, -1 deletions)

View changed files

📝 libs/deepagents/src/index.ts (+5 -0)
📝 libs/deepagents/src/middleware/index.ts (+5 -0)
📝 libs/deepagents/src/middleware/skills.ts (+1 -1)

📄 Description

Closes #481

What changed

Added QdrantSkillsMiddleware as a drop-in extension of the existing
createSkillsMiddleware() contract.

Area Before After
Skill injection All skills on every turn Top-k semantically relevant skills
Storage Flat files only Flat files + Qdrant vector index
Context cost O(n) skills O(k), k ≪ n
Fallback N/A Full-list injection if Qdrant unreachable

How it works

  1. beforeAgent — loads skill metadata via listSkillsFromBackend() (unchanged),
    then upserts vectors into a Qdrant collection keyed by {skill.name}.
  2. wrapModelCall — embeds the latest user turn, queries Qdrant for top-k,
    and injects only those skill entries into the system prompt.
  3. Progressive disclosure behaviour is identical to the existing middleware;
    only the selection mechanism changes.

Testing

  • Unit tests: index build, top-k retrieval, fallback path
  • Existing evals/skills/ suite passes unchanged
  • Tested locally with examples/skills-memory/ example

Notes for reviewers

  • No breaking changes to createSkillsMiddleware() or BackendProtocolV2
  • Qdrant client + embeddings provider are peer dependencies (not bundled)
  • Collection name and top-k are configurable via QdrantSkillsOptions

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/482 **Author:** [@inamdarmihir](https://github.com/inamdarmihir) **Created:** 4/22/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (2) - [`386018e`](https://github.com/langchain-ai/deepagentsjs/commit/386018e8a7f82e878d63beb7034096f35fe8f027) chore: push changes from agent - [`455ce4f`](https://github.com/langchain-ai/deepagentsjs/commit/455ce4f33f5154293b10622ac1c4c8d41dfe5388) chore: remove temporary diff.txt ### 📊 Changes **3 files changed** (+11 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/index.ts` (+5 -0) 📝 `libs/deepagents/src/middleware/index.ts` (+5 -0) 📝 `libs/deepagents/src/middleware/skills.ts` (+1 -1) </details> ### 📄 Description Closes #481 ## What changed Added `QdrantSkillsMiddleware` as a drop-in extension of the existing `createSkillsMiddleware()` contract. | Area | Before | After | |---|---|---| | Skill injection | All skills on every turn | Top-k semantically relevant skills | | Storage | Flat files only | Flat files + Qdrant vector index | | Context cost | O(n) skills | O(k), k ≪ n | | Fallback | N/A | Full-list injection if Qdrant unreachable | ## How it works 1. `beforeAgent` — loads skill metadata via `listSkillsFromBackend()` (unchanged), then upserts vectors into a Qdrant collection keyed by `{skill.name}`. 2. `wrapModelCall` — embeds the latest user turn, queries Qdrant for top-k, and injects only those skill entries into the system prompt. 3. Progressive disclosure behaviour is **identical** to the existing middleware; only the selection mechanism changes. ## Testing - [ ] Unit tests: index build, top-k retrieval, fallback path - [ ] Existing `evals/skills/` suite passes unchanged - [ ] Tested locally with `examples/skills-memory/` example ## Notes for reviewers - No breaking changes to `createSkillsMiddleware()` or `BackendProtocolV2` - Qdrant client + embeddings provider are peer dependencies (not bundled) - Collection name and top-k are configurable via `QdrantSkillsOptions` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:29 -04:00
yindo closed this issue 2026-06-05 17:23:29 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#504