@aliyunrds/ctxdb-qoder
v0.0.1
Published
Qoder access layer for RDS ContextDatabase: hooks (UserPromptSubmit autoRecall + Stop autoCapture), `ctxdb-qoder` CLI (memory + KB ops), one-shot `setup` installer, and SKILL.md.
Maintainers
Readme
@aliyunrds/ctxdb-qoder
Qoder access layer for RDS ContextDatabase: hooks (UserPromptSubmit autoRecall + Stop autoCapture), ctxdb-qoder CLI (memory + KB ops), one-shot setup installer, and a Qoder-agent SKILL.md.
Install
npm install -g @aliyunrds/ctxdb-qoder
# One-shot install: writes ~/.qoder/ctxdb.json + idempotent settings.json
# hooks + chmod +x + skill copy + ping validation
ctxdb-qoder setup \
--base-url https://context-database.aliyuncs.com \
--api-key ctxdb-... \
--user-id qoder-tester
# Verify
ctxdb-qoder status --jsonRestart Qoder (CLI: just exit + restart; app: Cmd+R or quit/relaunch) so it picks up the new hooks.
What it does
| Trigger | Hook | What runs |
|---|---|---|
| User submits a prompt | UserPromptSubmit | Search /v3/memories/search/, format a <recalled-memories> block, inject as additionalContext. By default only memory is recalled. Set recall_knowledge: true in the config to also pull KB chunks into a <external-knowledge> block; otherwise the recommended path for KB is the agent calling ctxdb-qoder kb search explicitly when the user asks (see SKILL.md) |
| Agent finishes its turn | Stop | Read transcript, detect KB-upload turns and skip capture (so uploaded content doesn't bleed into long-term memory), slice the current turn, sanitize the input, POST to memory store |
CLI
ctxdb-qoder ships 18 subcommands:
- Top-level:
init/status/ping/setup - Memory:
memory add|search|list|get|update|delete - KB:
kb upload-text|upload-file|list|documents-list|document-get|search
See ctxdb-qoder --help.
memory add … --no-infer stores the text verbatim (skips server-side LLM
fact-extraction). Use it when the user explicitly asks for a verbatim
memory ("记住 / 请记忆 / 原文记下"); without --no-infer the server may
rewrite, merge, or skip details.
kb search <query> [--kb=name1,name2] [--top-k=N] [--threshold=F] is the
agent-driven KB recall path — calls POST /v1/knowledge/query directly
(distinct from memory search --knowledge, which is a memory + KB hybrid
search). The SKILL points the agent here when the user explicitly asks for
KB lookup ("结合知识库查询" / "从知识库召回"). --kb is comma-separated;
omit it to search across all KBs.
Configuration
Lives at ~/.qoder/ctxdb.json. Schema:
{
"api_key": "ctxdb-...",
"base_url": "https://context-database.aliyuncs.com",
"user_id": "qoder-tester",
"auto_capture": true,
"auto_recall": true,
"recall_knowledge": false,
"top_k": 10,
"threshold": 0.4,
"knowledge_top_k": 6,
"debug": false
}Field reference:
| Key | Type | Default | Meaning |
|---|---|---|---|
| auto_capture | bool | true | Stop hook captures each turn into long-term memory |
| auto_recall | bool | true | UserPromptSubmit hook recalls memory on each user prompt |
| recall_knowledge | bool | false | When auto_recall is on, also pull KB chunks alongside memory. Default is off — the recommended KB-recall path is the agent calling kb search explicitly when the user asks |
| top_k / threshold | int / float | 10 / 0.4 | Memory recall pagination + similarity floor |
| knowledge_top_k | int | 6 | KB chunks pulled per recall (only effective when recall_knowledge: true) |
| debug | bool | false | Verbose hook logging |
Env-var overrides (env wins): CTXDB_API_KEY / CTXDB_BASE_URL / CTXDB_USER_ID.
Architecture
@aliyunrds/ctxdb-qoder ← this package (hooks + CLI + setup)
│
└─ depends on @aliyunrds/ctxdb-shared ← input sanitation,
prompt-injection defenses,
memory/KB types, recall pipeline
(also consumed by openclaw_memory_rds_ctxdb)Uninstall
ctxdb-qoder setup --remove # unwires hooks from ~/.qoder/settings.json
npm uninstall -g @aliyunrds/ctxdb-qoderRemote SSH (Qoder IDE)
When you connect to a remote host via Qoder IDE's SSH session, ctxdb-qoder does not travel with the Qoder server. Qoder syncs its own server bits to the remote machine, but ~/.qoder/{settings.json, ctxdb.json, skills/} are per-host — your local hooks, config, and skill are not propagated.
To enable autoCapture / autoRecall in the remote session, run the same install on the remote machine:
# on the remote host
npm install -g @aliyunrds/ctxdb-qoder
ctxdb-qoder setup \
--base-url <your-ctxdb-server-url> \
--api-key ctxdb-... \
--user-id <id>Each remote host needs its own one-time setup. If you want memories to be shared across machines, reuse the same user-id; if you want per-host bucketing, give each remote a distinct one.
Developer docs
Maintainer-facing docs (source layout, dev/test workflows, server-config archives) live in the project's internal notebooks and are not packaged with this release. npm consumers can ignore this section.
License
Apache-2.0
