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! |
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.