← Pipeline

arakoodev/EdgeChains: Qdrant Vector DB SDK ($30 Algora)

Drafted
Reward: $30Platform: githubRail: algora (proven)Competition: 50 comments (active interest; check if anyone has an open PR before claiming)AI fit: mediumOpen issue ↗
Log time
Record payment (→ marks Paid)
Decision / notes
Read-only — unlock operator mode (top right) to edit.

Risk

| Risk | Likelihood | Mitigation | |---|---|---| | Someone already opened a PR | Medium (50 comments = active) | Check open PRs before claiming | | Reward is $30 only | Confirmed | Low effort to match; focus on PR quality | | Algora bounty not yet confirmed live | Medium | Operator verifies on algora.io before claiming | | Maintainer review latency | Low-medium | Active repo (updated today) |

Deliverables (0)

None yet — MINT attaches the PR/claim text + code here once it builds.

Timeline

No events yet.

Full proposal (drafted by MINT)

# Proposal Draft — arakoodev/EdgeChains: Qdrant Vector DB SDK ($30 Algora)

> **Status**: DRAFT — requires operator review and approval before submission  
> **DO NOT SUBMIT without operator approval** (per gig-earner guardrails)  
> **Written**: 2026-06-04T10:34:39Z (G5 leaf)

---

## Bounty Details

| Field | Value |
|---|---|
| Issue | https://github.com/arakoodev/EdgeChains/issues/273 |
| Title | Add qdrant vector DB support to the JavaScript SDK |
| Repo | arakoodev/EdgeChains (423 stars, actively maintained) |
| Reward | ~$30 via Algora (confirmed payment rail from G0 analysis) |
| Payment rail | Algora — on-chain escrow, payout on PR merge |
| Competition | 50 comments (active interest; check if anyone has an open PR before claiming) |
| Discover score | 6.0+ (low pay score, high code fit) |

## Issue Summary

The poster wants Qdrant vector DB support added to EdgeChains' JavaScript SDK.
Specific ask: "use the Qdrant REST API directly and wrap them in EdgeChains classes"
(same pattern as existing PostgreSQL/Pinecone integrations in the SDK).

## Pre-Qualification Checks

Before claiming:
1. **Check open PRs**: `https://github.com/arakoodev/EdgeChains/pulls?q=qdrant` — if a PR already exists and is being reviewed, stand down
2. **Verify bounty still live on Algora**: `https://algora.io/arakoodev/bounties` — confirm $30 is still posted and unclaimed
3. **If unclaimed**: operator posts `/claim` comment on issue #273 → MINT opens the PR

## Proposed Implementation

### What will be delivered: `QdrantDB` class for EdgeChains JS SDK

The Qdrant REST API is well-documented. MINT will implement a TypeScript class that wraps the core operations EdgeChains needs for vector storage:

```typescript
// packages/libs/qdrant/src/index.ts
import { EdgeChainVectorDB, VectorRecord, SearchResult } from "@arakoodev/edgechains-base";

export class QdrantDB extends EdgeChainVectorDB {
  private baseUrl: string;
  private apiKey?: string;

  constructor(config: { url: string; apiKey?: string }) {
    super();
    this.baseUrl = config.url.replace(/\/$/, "");
    this.apiKey = config.apiKey;
  }

  private headers(): Record<string, string> {
    const h: Record<string, string> = { "Content-Type": "application/json" };
    if (this.apiKey) h["api-key"] = this.apiKey;
    return h;
  }

  // Ensure collection exists (idempotent)
  async ensureCollection(name: string, vectorSize: number): Promise<void> {
    const res = await fetch(`${this.baseUrl}/collections/${name}`, {
      method: "PUT",
      headers: this.headers(),
      body: JSON.stringify({
        vectors: { size: vectorSize, distance: "Cosine" },
      }),
    });
    if (!res.ok && res.status !== 409) {
      throw new Error(`Qdrant ensureCollection failed: ${res.status}`);
    }
  }

  async upsert(collection: string, records: VectorRecord[]): Promise<void> {
    const points = records.map((r) => ({
      id: r.id,
      vector: r.vector,
      payload: r.metadata ?? {},
    }));
    const res = await fetch(`${this.baseUrl}/collections/${collection}/points`, {
      method: "PUT",
      headers: this.headers(),
      body: JSON.stringify({ points }),
    });
    if (!res.ok) throw new Error(`Qdrant upsert failed: ${res.status}`);
  }

  async search(
    collection: string,
    vector: number[],
    topK = 5,
    filter?: Record<string, unknown>
  ): Promise<SearchResult[]> {
    const body: Record<string, unknown> = { vector, limit: topK, with_payload: true };
    if (filter) body.filter = filter;
    const res = await fetch(`${this.baseUrl}/collections/${collection}/points/search`, {
      method: "POST",
      headers: this.headers(),
      body: JSON.stringify(body),
    });
    if (!res.ok) throw new Error(`Qdrant search failed: ${res.status}`);
    const data = await res.json();
    return (data.result ?? []).map((p: { id: string | number; score: number; payload?: Record<string, unknown> }) => ({
      id: String(p.id),
      score: p.score,
      metadata: p.payload ?? {},
    }));
  }

  async delete(collection: string, ids: (string | number)[]): Promise<void> {
    const res = await fetch(
      `${this.baseUrl}/collections/${collection}/points/delete`,
      {
        method: "POST",
        headers: this.headers(),
        body: JSON.stringify({ points: ids }),
      }
    );
    if (!res.ok) throw new Error(`Qdrant delete failed: ${res.status}`);
  }
}
```

### Deliverable plan (PR: `feat/qdrant-vector-db`)

- `packages/libs/qdrant/src/index.ts` — `QdrantDB` class (above)
- `packages/libs/qdrant/package.json` — `@arakoodev/qdrant` package
- `packages/libs/qdrant/README.md` — usage: local (`http://localhost:6333`) + cloud (`https://xyz.eu-central.aws.cloud.qdrant.io`)
- `packages/libs/qdrant/src/index.test.ts` — unit test with mocked fetch

MINT can produce this PR in 1 tick once claim is confirmed.

## Risk Assessment

| Risk | Likelihood | Mitigation |
|---|---|---|
| Someone already opened a PR | Medium (50 comments = active) | Check open PRs before claiming |
| Reward is $30 only | Confirmed | Low effort to match; focus on PR quality |
| Algora bounty not yet confirmed live | Medium | Operator verifies on algora.io before claiming |
| Maintainer review latency | Low-medium | Active repo (updated today) |

## Verdict

**GATE: verify no open qdrant PR + confirm Algora $30 is live.** If both clear:
→ Operator posts `/claim` on issue #273
→ MINT builds PR in 1 tick  
→ Operator pushes PR → merged → $30 Algora payout

Small dollar amount but: (a) confirms Algora payment rail works end-to-end, and (b) earns MINT first real dollar from a real delivered product.

*Next: operator reviews + confirms, or tells MINT to skip this one.*