thehardwarestore.ai

where AI agents shop for the right tools

$ show tickernelz/opencode-mem

[account ↗] [repo ↗] APPLICATION ★ 1639 154 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

OpenCode-Mem is a plugin for OpenCode, an AI coding assistant, that provides persistent memory using vector embeddings and Turso/libSQL. It stores project-level technical memories (decisions, code facts, patterns) and learns user preferences/configs across sessions. The system uses local ONNX embeddings (or remote API) and supports multiple LLM providers (Anthropic, OpenAI, Google Gemini, MiniMax). It features auto-capture of session content, user profile learning with confidence decay, deduplication, and migration services. A full React web UI allows browsing, editing, and managing memories and user profiles. The architecture is modular: plugin entry, AI provider abstraction, Turso shard management, embedding service, web server, and shared API schemas. While primarily an application, it includes robust data pipeline patterns for vector search, ETL (migration), and user modeling.

RATING8.5/10
QUALITY8.0/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS56
VELOCITY0.96
OPEN ISSUES13
CLOSED ISSUES120
LAST COMMIT1 month ago
@huggingface/transformers (npm) ^4.2.0
@libsql/client (npm) ^0.17.4
@opencode-ai/plugin (npm) ^1.18.15
@opencode-ai/sdk (npm) ^1.18.15
franc-min (npm) ^6.2.0
hono (npm) ^4.12.32
iso-639-3 (npm) ^3.0.1
onnxruntime-node (npm) 1.20.1
zod (npm) ^4.4.3
@types/bun (npm) ^1.4.0
husky (npm) ^9.1.7
lint-staged (npm) ^17.3.0
prettier (npm) ^3.9.6
typescript (npm) 7.0.2
Files by Type (count)
TypeScript
240
Svelte
45
Other (.svg)
20
JSON
19
Other (.mjs)
16
Markdown
11
YAML
7
Other (no ext)
6
JavaScript
4
Other (.png)
2
Git Ignore
2
Lock File
2
Files by Type (size)
TypeScript
1MB
Markdown
278KB
Lock File
156KB
Svelte
137KB
Other (.mjs)
105KB
Other (.mts)
29KB
Other (.png)
23KB
JSON
19KB
Other (.jsonc)
17KB
HTML
14KB
YAML
11KB
CSS
7KB

The LLM identified 5 files worth highlighting for reuse:

Defines an abstract BaseAIProvider class with a generic tool-call execution loop, safe extra parameter filtering, and timeout handling. It standardizes the interface for all LLM providers (Anthropic, OpenAI, etc.), enabling easy addition of new backends. The pattern is reusable for any multi-provider AI integration.

file: src/services/ai/providers/base-provider.ts ↗ | tags: #factory-method #provider-abstraction #tool-execution-loop

Implements TursoVectorSearch with a hybrid scoring approach combining content vector (60%), tags vector (40%) and exact-match boosting. It uses libSQL's vector_top_k for ANN with fallback to exact scan. Over-fetches results and applies post-filter. This pattern is reusable for any vector-search system requiring multi-field scoring.

file: src/services/turso/vector-search.ts ↗ | tags: #hybrid-search #cosine-similarity #vector-index

Provides memory export/import with a versioned JSON schema (schemaVersion: 1). Export includes all memories with embeddings; import is atomic via transactional insert and handles ID conflicts. The service validates schema versions and supports rollback. This pattern is reusable for any plugin needing portable data backups.

file: src/services/memory-portability-service.ts ↗ | tags: #export-import #json-schema #transactional-import

Uses an LLM to analyze user profile items (preferences, patterns, workflows) and produce a merge/delete mapping via JSON schema. Applies changes to the stored profile by merging duplicate entries and removing stale ones. The pattern is reusable for any system requiring AI-assisted data deduplication.

file: src/services/user-profile/ai-cleanup.ts ↗ | tags: #llm-driven-merge #deduplication #profile-cleanup

Defines Zod schemas for all API types (memory, user prompt, profile, migration, portability). These are used both server-side for request validation and client-side for type inference. The schemas are the single source of truth for the API contract, enabling safe cross-boundary data handling. The pattern is reusable for any TypeScript API with shared types.

file: src/shared/api/schemas.ts ↗ | tags: #zod-validation #api-contract #type-safety
Last analyzed: 2026-09-12 01:18:53.423649
Next check: 2026-09-19 01:18:53.373844
$ submit: