TencentDB-Agent-Memory icon indicating copy to clipboard operation
TencentDB-Agent-Memory copied to clipboard

[good first issue]🎯 [Feature] Support ZeroEntropy native embedding API

Open codxt opened this issue 6 months ago • 5 comments

Is this feature related to a problem? | 该功能需求是否与某个问题相关?请描述

Support ZeroEntropy native embedding API in memory-tencentdb

Summary

Please add first-class support for ZeroEntropy as an embedding provider in @tencentdb-agent-memory/memory-tencentdb.

Currently, memory-tencentdb treats non-local embedding providers as OpenAI-compatible and calls:

ts ${this.baseUrl}/embeddings

This works for OpenAI-compatible providers, but ZeroEntropy’s working embedding endpoint is native/non-OpenAI-shaped:

POST https://api.zeroentropy.dev/v1/models/embed

with model: zembed-1

and request body shape:

json { "input": ["text to embed"], "input_type": "query", "model": "zembed-1" }

The response shape is also different from OpenAI:

json { "results": [ { "embedding": [...] } ] }

rather than:

json { "data": [ { "index": 0, "embedding": [...] } ] }

Environment

  • Package: @tencentdb-agent-memory/memory-tencentdb
  • Observed version: 0.3.5
  • Runtime: Hermes sidecar gateway
  • Gateway health reports:
    • vectorStore: true
    • embeddingService: true
  • Embedding config:
    • provider: openai
    • baseUrl: https://api.zeroentropy.dev
    • model: zembed-1
    • dimensions: 2560

Current behavior

With ZeroEntropy configured, memory-tencentdb calls:

POST https://api.zeroentropy.dev/embeddings

That returns:

HTTP 404

If /v1 is included in the base URL, the OpenAI-style endpoint still fails:

POST https://api.zeroentropy.dev/v1/embeddings HTTP 404 {"detail":"Not Found"}

As a result, the embedding service object exists, but no vectors are persisted.

Example local DB state after multiple captured conversations:

l0_conversations: 123 l1_records: 3 l0_vec_rowids: 0 l1_vec_rowids: 0

Memory search falls back to FTS for exact keyword matches, while semantic/vector search returns no results.

Expected behavior

memory-tencentdb should support ZeroEntropy embeddings, either via:

  1. A dedicated provider, e.g.

yaml embedding: enabled: true provider: zeroentropy baseUrl: https://api.zeroentropy.dev model: zembed-1 dimensions: 2560

or

  1. A configurable embedding endpoint/response adapter that can support non-OpenAI-compatible APIs.

For ZeroEntropy, the provider should:

  • call:

POST {baseUrl}/v1/models/embed

  • send:

json { "input": ["..."], "input_type": "query", "model": "zembed-1" }

  • parse:

results[].embedding

  • return normalized Float32Array embeddings as the existing embedding service does.

Validation

Direct ZeroEntropy native call succeeds:

POST https://api.zeroentropy.dev/v1/models/embed model: zembed-1

Result:

HTTP 200 embedding dimensions: 2560

But the current OpenAI-compatible path used by memory-tencentdb fails:

POST https://api.zeroentropy.dev/embeddings HTTP 404

Describe the solution you'd like | 描述你期望的解决方案

Suggested implementation

Add a ZeroEntropyEmbeddingService or branch inside the existing remote embedding service:

ts if (providerName === "zeroentropy") { const fetchUrl = ${baseUrl.replace(//+$/, "")}/v1/models/embed; const body = { input: texts, input_type: "query", model: this.model, };

const json = await resp.json(); if (!json.results || !Array.isArray(json.results)) { throw new Error("ZeroEntropy embedding API returned unexpected format: missing 'results' array"); }

return json.results.map((r) => sanitizeAndNormalize(r.embedding)); }

Optionally allow input_type to be configured (query vs document) if users need both retrieval modes.

Why this matters

ZeroEntropy provides 2560-dimensional embeddings through zembed-1, and works well as a hosted embedding provider. Supporting it directly would let Hermes/TencentDB users use ZeroEntropy for semantic memory search without needing an OpenAI-compatible proxy.

Describe alternatives you've considered | 描述你考虑过的其他方案

No response

Additional context | 补充说明

No response

codxt avatar May 21 '26 02:05 codxt

Thanks for your detailed feedback. Currently our plugin only supports OpenAI-compatible embedding interfaces, so services like ZeroEntropy cannot be used directly. We will internally evaluate this requirement and keep you updated once we reach a conclusion.

Maxwell-Code07 avatar May 21 '26 14:05 Maxwell-Code07

We have selected this Issue as a 🎯 Good First Issue — perfect for new contributors to get started!

Task Details

Field Content
Type Feature
Difficulty Medium
Estimated Effort 4 days
Acceptance Criteria 1. Add provider: "zeroentropy" option for embedding config; 2. Call ZeroEntropy native API for vectorization, no more 404 errors; 3. Provide clear error messages for misconfigurations

Feel free to ask questions if you have any! 🚀

Maxwell-Code07 avatar Jun 03 '26 13:06 Maxwell-Code07

Hello, I'd like to work on this issue. May I be assigned to fix it? Thank you.

kbob3687-hub avatar Jun 04 '26 03:06 kbob3687-hub

@kbob3687-hub Thanks a lot for your interest in contributing to our project! This batch of Good First Issue allocation was arranged via our WeChat group registration form in chronological order, and the current task #68 has been assigned to another registered participant from our waiting list already. We recommend you join our WeChat community to follow the next round of new Good First Issue announcements, we will publish upcoming tasks in the group regularly, and you can sign up for future opportunities there. Looking forward to your future contributions!

Image

Maxwell-Code07 avatar Jun 04 '26 06:06 Maxwell-Code07

I have joined the TencentDB Agent Memory Open Source Co-creation Program and claimed this issue.

YOMXXX avatar Jun 04 '26 08:06 YOMXXX