feat(retrievers): add Dakera retriever#553
Conversation
Add DakeraRetriever, a Retriever backed by a self-hosted Dakera memory server (https://dakera.ai). It uses Dakera's text-query API (server-side embedding) to fetch the most relevant documents for a query, giving agents retrieval-augmented context. - Mirrors the AmazonKnowledgeBasesRetriever pattern; async, options dataclass. - `dakera` is an optional extra (pip install agent-squad[dakera]); the SDK is imported lazily so the package imports without it. - Adds mocked unit tests (no live server required). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a built-in retriever docs page for DakeraRetriever (installation, configuration options, agent + standalone usage) and wire it into the Retrievers sidebar. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Added the docs page in |
Port the Dakera retriever to the TypeScript SDK so the integration is available in both languages. DakeraRetriever uses the @dakera-ai/dakera client's queryText (server-side embedding) to fetch relevant documents; retrieveAndGenerate is unsupported (Dakera is retrieval-only). Adds @dakera-ai/dakera as a dependency, registers the export, adds jest tests, and a TypeScript tab to the docs page. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Added a TypeScript |
|
Hey, @ferhimedamine thanks for the contribution! T he Python side looks really solid — clean code, good tests, follows the existing patterns well. A few things need to be addressed before this can merge though: Blockers:
Smaller things:
Also — no pressure for this PR, but a Swift retriever would be a nice follow-up issue if you're interested. |
|
Thanks for the feedback @cornelcroi |
Per @cornelcroi's review: - Move @dakera-ai/dakera from dependencies to peerDependencies (optional) so installing agent-squad doesn't pull it in; load it lazily via require() in the constructor with a try/catch that throws a clear install hint if it's missing. Also added to devDependencies for tests/build. Lockfile regenerated. - Replace the 'filter as never' type hack with the SDK's real FilterExpression type (type-only import), and type DakeraRetrieverOptions.filter accordingly. tsc --noEmit, eslint, and the retriever test suite (8 tests) all pass.
|
Thanks for the detailed review @cornelcroi — all points addressed in Blockers
Smaller things
Verified locally: Re: the Swift retriever — happy to pick that up as a follow-up; I'll open a separate issue for it once this lands. Thanks again! |
Adds a Swift DakeraRetriever backed by a self-hosted Dakera memory server, completing the Python + TypeScript retrievers for the Swift SDK (follow-up to the review on 2FastLabs#553). The Swift SDK grounds answers through tools (GroundedAgent) rather than a Retriever base class, so this is exposed the native way: DakeraRetriever is a ToolProvider that advertises a `search_memory` tool the gatherer can call. The same type also offers a direct `retrieve(_:)` / `retrieveAndCombineResults(_:)` API for manual RAG. - Talks to Dakera's `POST /v1/namespaces/{namespace}/query-text` endpoint over URLSession behind the existing HTTPInvoker seam — no third-party SDK dependency is added to the package. - Config resolves apiKey from DAKERA_API_KEY and url from DAKERA_URL (default http://localhost:3000), mirroring the Python/TS retrievers. - 16 tests via a mock HTTPInvoker (request shape, response parsing, validation, and the ToolProvider surface); no live server needed. - Docs page under Swift > Tools > Built-in, wired into the sidebar.
|
Added the Swift A design note, since the Swift SDK is structured differently from the Python/TS ones: there's no
Other choices to match the repo:
@cornelcroi |
|
Hey @ferhimedamine, the three blockers from my last review are addressed — issue linked, TS dependency is now a proper optional peer dep with lazy Two things still need fixing before this merges. First, One smaller thing: the Swift docs sidebar entry registers as a slug under |
Per the repo rule that every new public Swift type is added to the module-contents tables. Adds DakeraRetriever to the AgentSquad (core) row in swift/README.md and swift/SKILL.md, plus a one-line mention in the SKILL Tools section.
|
Thanks @cornelcroi — both merge blockers addressed in 1. 2. CI — the new commit re-triggers the workflows. They show as 3. Docs location (non-blocker) — good eye, and agreed on both counts: the file sits under Let me know if anything else is needed before merge. |
# Conflicts: # swift/README.md # swift/SKILL.md
|
Resolved a merge conflict with CI is still pending maintainer approval-to-run (first-time-contributor fork gate). Ready for your re-review / approve-and-run whenever convenient, @cornelcroi. |
|
Rebased state note: So the branch is up-to-date with main and passing locally; the only thing left before merge is the workflow-approval click on your side so CI runs (still |
# Conflicts: # python/setup.cfg
|
CI has never run on this branch — no checks reported. Push a commit or rebase against main to trigger it. Everything else looks good. |
|
Branch has conflicts with main — please rebase and resolve them before CI can run. |
# Conflicts: # typescript/package-lock.json # typescript/package.json
The lychee link-checker (lint job, runs on PRs touching typescript/**) fails on two pre-existing links in the root READMEs that predate this PR: the npmjs package page (403 bot-block — a false positive, the page exists) and a dead Spotify episode link (404). Ignore both so the check passes; the Spotify link looks genuinely dead and may be worth removing separately.
|
Thanks for approving the workflows @cornelcroi — CI ran, and it surfaced two things, both handled in 1. Rebased onto latest 2. The one red check was the link-checker, on pre-existing links — not this PR's code. For reference, everything that tests my change passed:
I added a minimal root Branch is mergeable and up-to-date with main. Should be all green on this run. |
Fixes #569
Description
Adds
DakeraRetriever, aRetrieverbacked by a self-hosted Dakera memory server. It uses Dakera's text-query API (server-side embedding) to fetch the most relevant documents for a query, so agents can use Dakera as a retrieval-augmented context source.Design
AmazonKnowledgeBasesRetriever: an asyncRetrieversubclass with aDakeraRetrieverOptionsdataclass (namespace,api_key,url,top_k,filter).api_key→DAKERA_API_KEYenv;url→DAKERA_URLenv →http://localhost:3000(thedakera-deploydefault).retrieve/retrieve_and_combine_resultscallAsyncDakeraClient.query_text.retrieve_and_generateraisesNotImplementedError(Dakera is retrieval-only).dakeraSDK is imported lazily inside__init__, soagent_squad.retrieversimports without it; it's added as an optional extra (pip install agent-squad[dakera]) alongsideaws/anthropic/openai/sql.Dependencies
Per CONTRIBUTING, flagging the dependency change:
dakera>=0.12.8is added only as an optional[dakera]extra (and toall) — no new core/runtime dependency. Happy to adjust if you'd prefer it handled differently.Testing
python -m pytest src/tests/retrievers/test_dakera_retriever.py→ 9 passed (mocked client, no live server needed).ruff check+ruff format --checkonsrc/agent_squadare clean.Docs (a
retrievers/built-in/dakera-retriever.mdxpage) and a TypeScript port can follow in a separate PR if you'd like — kept this one focused on the Python retriever. This is a community contribution; let me know any changes you'd like.