🔴 This capability has been delisted, and this Skill can no longer be called.
What happened(historical fact, you may verify it yourself):
- 2026-08-10 Doubaoya's production environment was migrated to a new machine,Mera was not migrated along with it—it stayed on the old machine and entered the retirement process, and this service simply does not exist on the production machine.
- Domain
mera.doubaoya.com's DNS record has been removed (dig mera.doubaoya.comreturns NXDOMAIN)。So what happens when it is called: all six
POST /api/apis/mera/<slug>/callcannot get results, and which failure path is taken depends on whether that deployment still has the old address—
- No backend address configured → before deducting pointsit is stopped by the availability gate and returns 503
CAPABILITY_UNAVAILABLE,no billing at all;- An address pointing to the old machine is still present → cannot connect, returns 502
PROVIDER_FAILED,points already deducted are automatically refunded。Neither path will wrongly deduct the user's points, but neither can get data either.Retrying is pointless, and changing the key, parameters, or network will not help.
⚠️ There is no substitute, do not downgrade: the Second Brain containsthe user's ownprivate notes.
doubaoya's public platform search cannot see it—using public search to answer "what did I say before" is equivalent to passing off a stranger's content as the user's own memory, which is far worse than plainly saying "this capability has been delisted". When the user raises a Second Brain-type need,truthfully tell them the capability has been delisted, then ask whether they want to do something else.♻️ When this banner becomes invalid:
dig mera.doubaoya.comno longer returns NXDOMAIN, andPOST /api/apis/mera/self/callcan actually return the kernel (rather than 503/502), this notice expires— at that point delete the⛔ 已下架marker from the frontmatter, and the publishing gate will automatically allow it through, with no need to change any script.
Mera · Second Brain
Quack! This is the user'sownSecond Brain. Other skills look outward (what the whole internet is buzzing about), but this duck looks inward: A casual sentence from the user can go in, and days later a question can still retrieve it with its source.
One DOUBAOYA_API_KEY connects to the user's own Mera account (https://mera.doubaoya.com)。
it is allthe user's private content—you only read it and use it only to answer the user themself, and never disclose it externally.
0. What you can do for the user (one-sentence version)
| The user says | You should do | Subcommand |
|---|---|---|
| "Help me note down…" "Note this down" "Make a memo" "I just thought of…" | Write it into the Second Brain,and wait for the receipt | remember |
| "Save this link" "Collect this article" | Same as above, pass url |
remember |
| "Search my notes" "Have I said X before" "What material do I have about X" | retrieval hit locations,then read the original text | search → read |
| "What do I think about X" "How did I decide before" | Same as above:read the real original text and synthesize it yourself(don't buy secondhand conclusions) | search → read |
| "How much basis does this conclusion have" "Record this Q&A into Mera" | only then use server-side Q&A (already downgraded, criteria see §5.3) | ask |
| "Do you know me" "What kind of person am I" "Write in my style" | take the personality core and set the tone for subsequent answers | self |
1. Hard rules (red lines, read this section first)
- Never silently swallow it. Any write / retrieval failure must clearly tell the user that it failed and at which step it failed.
It is forbidden, without having obtained
status=doneto say "saved" or "got it recorded". This is the easiest mistake for this Skill to make, and also the mistake it must never make. - Writes always go through
remember, and only speak after the receipt is complete. Writes are asynchronous (writeonly returnsingestion_id), reporting "recorded" upon getting 202 = lying.rememberalready wraps the polling; don't takewriteand hand-roll polling yourself. - Do not fabricate sources.
askconclusions must be given together with thecitationsinraw_source.title. The only criterion for no support isevidence_level === "none"(equivalent tohas_evidence === false, equivalent tocitationsbeing empty), if hit, say plainly "your notes contain nothing that can support this question", then decide whether to supplement with a sentence from your own common sense (if supplemented, you must indicate that it is your judgment). ❌ Don't takeevidence.grade === "待核实"as the no-support criterion——referencelevel is also this grade; that genuinely retrieved the user's original text, so it must not be wrongly accused. - Do not dump that English placeholder on the user.
evidence_level === "none"Whenanswerreturned by Mera is a hardcoded English sentence (I could not find any supported evidence…), that is a placeholder, not an answer. The script has already replaced it with Chinese in this case and tagged it withno_evidence: true, youfollowanswer_noticeand speak plainly. That English sentencewill not appear in the script's stdout at all(not even a copy is kept), so it is impossible for you to "accidentally paraphrase" it; to confirm that this branch was taken, look atno_evidence: trueand stderr's[warn] NO_EVIDENCE。 - Never echo / print / record the entire
DOUBAOYA_API_KEY—when confirmation is needed, only reveal the prefix (e.g.dyh_xxxx…)。 - Privacy is not to be shared externally. The content in the second brain is the user's private material: do not send retrieved content to other services / other APIs / public channels, do not use it to search in search engines, and do not write it into any output that will be sent externally, unless the user explicitly requests it in this turn.
- Only go through
https://doubaoya.com's public/api/...interface, and do not guess or expose upstream internal services.
2. First get the key (secret key)
Before calling the interface, you need a key (API Key), in the form dyh_…. Four steps to get the key:
- Open doubaoya.com
- Log in(if you don't have an account, register first)
- Go to Key Center
- Click Generate Key, copy a string in the form
dyh_…string
Once you have it, write it into an environment variable (run once in the terminal):
export DOUBAOYA_API_KEY="dyh_你的密钥"
🔒 The full key is only fully revealed at the moment it is generated. If it's not in the environment,ask the user once, and once you have it, store it in an environment variable and don't ask again. Never print the full key, write it to logs, or put it in chat.
No extra "bind Mera account" step is needed: first use automatically activates it, and everything saved afterward lands under the same account, the user can go to https://mera.doubaoya.com to see them under the same identity. Don't tell the user "you might not be bound yet"—there is no such state.
| Environment Variable | Description | Required |
|---|---|---|
DOUBAOYA_API_KEY |
Doubao Key (dyh_…), and also determines whichperson'ssecond brain |
Yes |
DOUBAOYA_BASE_URL |
override default https://doubaoya.com(self-hosted / for testing) |
No |
MERA_POLL_BACKOFF_MS |
Override remember 's polling backoff (milliseconds, comma-separated; default 1000,2000,3000,4000). Fetching long web pages / uploading long texts often exceeds 10 seconds; you can lengthen it |
No |
Dependency: Node 18+, zero third-party dependencies.
3. Script Usage
Script location:scripts/mera.mjs. It uniformly POSTs to https://doubaoya.com/api/apis/mera/<slug>/call,
unwraps the unified envelope, and dumps data 's JSON to stdout.
node scripts/mera.mjs remember '<json>' # ⭐ 写入 + 轮询到终态(写入首选)
node scripts/mera.mjs write '<json>' # 只写入(异步,返回 ingestion_id,你得自己轮询)
node scripts/mera.mjs status <ingestion_id> # 查一次处理状态
node scripts/mera.mjs search "<关键词>" # 检索,拿命中片段与位置(char_start/char_end)
node scripts/mera.mjs read '<json>' # ⭐ 按窗口读原文(读取主路径的第二步)
node scripts/mera.mjs ask '<json>' # 服务端问答(已降级,见 §5.3)
node scripts/mera.mjs self # 人格内核 + 关键记忆
Output Contract: success → data 's JSON to stdout, exit code 0; failure → [error] <code>: <message> to stderr, exit code 1.
So after every call,check the exit code / stderr first, don't just blindly parse stdout.
| Subcommand | Input Parameters | Example |
|---|---|---|
remember / write |
{content?, url?, title?},choose one of content / url;title only takes effect in content mode |
node scripts/mera.mjs remember '{"content":"和老王聊完,决定先做单机版再联网"}' |
| save link (don't pass title, in url mode the server hard-codes the fetched page title, and it will be ignored if passed) | node scripts/mera.mjs remember '{"url":"https://example.com/post"}' |
|
status |
<ingestion_id> |
node scripts/mera.mjs status ing_abc123 |
search |
keyword string | node scripts/mera.mjs search "远程办公" |
read |
{source_id, from?, to?};directly feed the char_start / char_endfrom the search hit, and the script calculates the window for you |
node scripts/mera.mjs read '{"source_id":"…","char_start":120,"char_end":400}' |
ask |
{query_text, top_k?, conversation_id?}(has been degraded, see §5.3) |
node scripts/mera.mjs ask '{"query_text":"我对远程办公是什么态度"}' |
self |
None | node scripts/mera.mjs self |
4. Write Script: You Must Complete the Receipt
⚠️ This section is the core of this Skill. Writes areasynchronous:
writereturns 202{ingestion_id, status:"queued"}, at that time the thinghasn't entered the brain yet。rememberwill back off and poll for you (1s → 2s → 3s → 4s, about 10 seconds) until the final state.
4.1 Three Final States, Three Ways to Say It
remember 's output contains remember_result, branch accordingly:
remember_result |
Exit Code | What You Should Say to the User |
|---|---|---|
done |
0 | "Noted" + translate disposition into plain language (see 4.2) |
failed |
1 | must explicitly state failure: "This item wasn't saved, the reason is <error>, and asks whether to retry |
pending |
0 | "It has already been queued, but completion has not been confirmed within 10 seconds"—Never say "saved". Provide ingestion_id, and note that it can be checked again later |
pending check-again action for this case (just come back after a while):
node scripts/mera.mjs status <ingestion_id>
4.2 Translate disposition into plain language
status=done include disposition, do not dump JSON on the user; translate it:
| Field | Meaning | What to say |
|---|---|---|
outcome |
graph / record / archived / failed |
graph= entered the knowledge graph;record= the entire entry is retained as a record;archived= archived for the record |
entities[] |
Entities recognized | "Recognized 3 people/concepts: X, Y, Z" |
fact_count |
Number of facts extracted | "Extracted 5 facts" |
todo_count |
Number of to-dos extracted | "Picked up 1 to-do along the way"—If there is a to-do, it must be reported, users often rely on this to keep notes |
edge_count |
Newly created relationship edges | "Connected to the X you recorded earlier" (only say this when >0) |
tier / page / reason |
Classification / which page it lands on / reason for handling | Expand only when the user asks for details |
Example:
记下了 ✅
识别到 3 个实体(远程办公、老王、单机版方案),抽出 5 条事实、1 条待办(「先做单机版」),
还和你之前记的「产品排期」连上了 2 条关系。
4.3 Deduplication
Only deduplicated === true can you say "you have recorded this one before":
这条你之前记过了,本鸭没重复存,给你指回原来那条。
⚠️ Missing field ≠ first record. Older versions of Mera do not return this field; when it is missing, just say "Noted",
do not go the other way and assert "this is a new entry". (The script will not synthesize one for you either, deduplicated: false。)
When it cannot be determined, there are two moreweak signalsyou can reference (use only as reference, do not state them as a firm conclusion):
stages Only [{stage:"ingest", status:"succeeded"}] one line (the chain is broken at ingest),
and raw_source_id points to the old one.
4.4 Will duplicate submissions store two copies (users care a lot; do not get this wrong)
| Mode | Idempotent? | How to tell the user |
|---|---|---|
content(paste body text) |
Yes. The deduplication key is a hash of the body content (leading and trailing whitespace normalized); submitting the same text again will not store two copies; the second time it resolves directly to the same raw_source_id、status immediately done |
"Recording the same content again will not store two entries" |
url(store link) |
Not guaranteed. Deduplication is calculated bybody text fetched back, not by URL—if any dynamic content on the page (view count, "3 minutes ago", A/B copy) changes by one character, the hash changes, and an extra entry will be stored | "Storing the same link twice may result in two entries, because web page content changes." If you need idempotency, paste the body text yourself and use content mode |
Do not get these two edge cases backwards either:
- If the previous submission is stillnot finishedand you retry → it will not short-circuit; it will run the chain on the same raw_sourceagain(does not store extra rows, but costs one more processing run).
- The same content was previouslyarchived→ it willIntentionalInserting a new row to make it visible again is the intended design, not duplicate storage.
4.5 Two pitfalls of titles
titleOnly in content modedoes it take effect (written intoraw_source.title);in url mode thetitlepassed by the client is completely ignored (source_type、origin_uriis likewise ignored), and the title is based on the fetched page title. The script will report to stderr[warn] IGNORED_FIELDS— if you see it, don't tell the user "saved it under the title you gave."titledoes not participate in the deduplication hash. So resubmitting with "the same content, just a changed title" will be blocked by deduplication, and thenew title is silently lost (raw_source is immutable, conflicts directly DO NOTHING, never UPDATE). If the user wants to change the title,they can't rely on resubmitting, tell them honestly to go to https://mera.doubaoya.com to change it.
4.6 Boundaries of what gets written
- Record whatever the user says,don't polish / structure / abbreviate it for them. The second brain wants the original words; extraction is done by the Mera backend.
- If the user gives a link → pass
url, don't fetch the webpage yourself first and then pass the body text (unless the user just wants idempotency, see 4.4). - If they say several things at once → you can record it as one whole item (Mera will split out the facts); only when it is clearlyseveral unrelated thingsshould you split it into multiple
remember。
5. Reading playbook: the main path is "retrieve → read the original text → synthesize it yourself"
Take this path by default, whether the user wants material or a conclusion:
search "<关键词>" → 从 results 里挑 1–3 条最相关的 → 对每条 read {source_id: r.id, char_start: r.char_start, char_end: r.char_end} → 拿真实原文自己综合,引用真实 title
5.0 Why not use ask
ask by default:it runs another LLM on the server. And you, the one reading this text, are already an LLM, so using it by default means:
- Paying twice:
askcosts 1 point each time,search/readare both 0 points。 - One extra round trip: you have to wait for it to finish before you get a piece of text you could have written yourself.
- It's blinder than you: that Mera LLM only gets one sentence
query_text,it can't see the conversation context between you and the user— the constraints the user mentioned earlier, the framing, what exactly is being agonized over this round, it knows none of it, so it's actually more likely to go off track.
ask previously seemed necessary, half of that was forced by search 's incompleteness:snippet only has 240 characters, while a chunk can be up to 2000 characters,
the answer often falls outside the snippet. Now that there is read, this reason is gone.If you can read the original text yourself, don't buy a secondhand conclusion.
5.1 search
Return results[], each item contains title、source_type、media_type、created_at、snippet、score、
chunk_id、char_start、char_end。
- Sorted by
score, and when displaying, includetitle+created_at(users recognize "when I recorded this"). - ⚠️
snippetis only 240 characters, don't treat it as everything. It's a signpost for "the hit is here," not the answer. As long as what the user wants is more than one sentence (a conclusion, the full story, quoting the original words), thencontinue withread. Only questions like "just asking whether I ever recorded it / roughly when I recorded it" can be finished by looking only at the snippet. - When quoting
snippet,quote it as is, don't rewrite it in your own words and then present it as something the user said. - 0 results → honestly say "I couldn't find that in your notes," and you may suggest searching with a different term.Never make up content to fill the gap.
- There's no pagination. The endpoint only accepts
q, and the number of results is fixed by the server (at most 20 sources at a time), and the response has no cursor / total / next. Don't trypage/limit/top_kparameters like that—they don't exist. If you want more,search again with a different keyword, and when the user asks for "all," also honestly explain that "at most 20 sources are given at a time." - The number of results may be fewer than 20(archived / unauthorized sources are dropped during the second query),don't assume it's always 20, and don't say "the search missed some" just because there are fewer.
results[].idisthe id of the source (raw_source),readthat's the one it wants;chunk_idis an id from another table,don't use it assource_id。searchAnything searchable is definitely readable (archived sources have already been excluded on the retrieval side).
5.2 read: read out the original text around the hit point
node scripts/mera.mjs read '{"source_id":"<search 结果的 id>","char_start":120,"char_end":400}'
search returned by char_start / char_end is relative tothe absolute character offset of the entire original text, in the same coordinate system as read 's window,
so the hit position can be used directly to open a window.Just feed char_start / char_end as-is to read , and the script will calculate the window:
from = max(0, char_start - 500)、to = char_end + 1500。- 500 before and 1500 after is intentionally asymmetric: the little bit of context before the hit point is used to explain "what this passage is about," while conclusions, decisions, and follow-up developments are almost always at the hit pointafter, so you should open wider toward the end.
- If you want to control it yourself, explicitly pass
from/to(it always takes priority over the calculated value).Giving onlyfromwithouttois valid— the script fills it in according toto = from + 20000(one full window), so when continuing to read, just pass the[warn] TRUNCATEDgiven byfromdirectly, you don't need to calculatetoyourself. If neither is given and there is also nochar_start, it is equivalent tofrom=0 / to=20000—— but that's a last resort when there are no clues, so don't use it if you have a hit position。 char_start - 500When it is negative, the script clamps it to 0, so you don't need to guard against it yourself.- The entire window falls after the end of the full text(for example,
fromis larger thancontent_length) → the server honestly returnscontent: ""+ 200, and the script prints[warn] EMPTY_WINDOW. That'sthe window was opened in the wrong place, not that this note is empty—don't tell the user that; adjustfromback into range and read again.
Returns {id, title, origin_uri, source_type, content, media_type, created_at, archived_at, from, to, content_length, truncated}:
contentisthe original text slice within the window(not the full text);content_lengthisthe total character count of the full text, don't treat it as the window length.- The window is
[from, to)left-closed right-open(String.slicesemantics).toExceeding the full text isa safe normal case—the server automatically truncates to the end, returns 200 as usual, andtruncated=false. Sochar_end + 1500out-of-bounds doesn't need handling; don't compare it againstcontent_lengthyourself first. - There are two kinds of starting points for continuing to read onward—don't remember only one:
- Not truncated (
truncated=false) → next windowfrom = 上一窗的 to。 - Truncated (
truncated=true) → next windowfrom = 本次 from + 实际读到的 content 长度。 ⚠️ Thetoin the response isthe request echoed back verbatim, not the actual window endpoint: on truncation, onlyfrom+20000was actually read, and continuing from the echoedtowouldskip a large chunk in the middle. The script has already calculated it based on the actual length and written it in[warn] TRUNCATED; follow thefromit gives. - Don't treat this window as the full text. To judge "whether there's more content after this", look at
from + content.length < content_length, not attruncated。
- Not truncated (
- Both ends of the window may be partial fragments:
contentcuts by character, so the context margin at both ends may cut in the middle of a sentence, or even split a markdown table or a heading in half. The segment at the hit center is definitely complete(chunks are split by semantic paragraphs), soreading is fine, but don't parse the window content as a complete structure (don't expect the tables at both ends to be complete tables). For image / PDF sources,contentis structured markdown (no base64), same reasoning. archived_atnon-empty → this sourcehas been archived; the user may have already deleted it. The script will print[warn] ARCHIVED. The data will still be provided and you won't be blocked, butbefore citing it you must first tell the user"you have already archived/deleted this one"; don't treat it as a note still in use. (The normal pipeline won't hit this:searchand the list both exclude archived sources; only direct reading by id can reach it—so once you see this warning, it's most likely you're reusing an id from an old session or the user manually pasted an id, and you need to explain it even more clearly.)- In a single Q&A, reading 1–3 itemsis enough. Reading them all is both slow and will blow up the context—pick the ones with the highest
scoreand the best-matchingtitle/created_at. - Billing 0 points, so read freely; but don't open overlapping windows on the same item repeatedly.Rate limit is 240 times/minute(total across all slugs), 1–3 items is far from this ceiling, whereas a play like "open 3 windows for each of 20 sources" starts to skirt it—don't do that.
When citing, use the read obtained fromreal original textand the real title; don't use snippet to piece together something that looks like an original quote.
5.3 ask(deprecated: not used by default)
Only use askin these two cases; everything else is always search + read:
- The user needs that evidence tier as a trust signal——
确证/部分未核验/待核实is calculated deterministicallyby citation count; your self-assessment of "how confident am I" can't produce this thing. Use it when the user explicitly wants a judgment like "is this reliable / is there evidence". - The user wants this Q&A round to appear in the session list of mera.doubaoya.com——
askwill write one conversation + message,search/readNo. Use it when the user says "write down this Q&A / I want to review it later in Mera."
Otherwise (wanting conclusions, wanting synthesis, wanting the full context, wanting writing material)all go through search + read: more accurate, more economical, and it can carry the conversation context.
Return answer + has_evidence + evidence_level + evidence{grade, grounded_count, reference_count, note} + citations[]
conversation_id+message_id。
evidence_level has only three values; judge by this table, don't improvise:
grounded_count / reference_count |
evidence_level |
evidence.grade |
How it's phrased |
|---|---|---|---|
| 0 / 0 | none |
To be verified | No support: state plainly "there is nothing in your notes that supports this question" |
| 0 / >0 | reference |
To be verified | Has source-text reference, no fact-level anchoring: you may answer, but say "this is an impression read from several of your notes, with no hard conclusion" |
| >0 / 0 | grounded |
Confirmed | Has factual anchoring; answer normally + sources |
| >0 / >0 | grounded |
Partially unverified | Answer normally + sources; you may mention "part of this is only reference material and hasn't been verified" |
evidence_level === "none"⟺has_evidence === false⟺citationsis empty — these three are always equivalent, and are theonlycorrect criterion for "didn't touch your notes at all."- ❌ Don't use
evidence.grade === "待核实"as a no-support criterion:reference-level is also this grade; that genuinely retrieved the user's source text. - To express "no fact-level anchoring," use
evidence.grounded_count === 0。
Presentation rules (hard):
- First check whether the script provided
no_evidence: true(evidence_level === "none", the script will add it and replace that English placeholder with Chinese — that English sentence will not remain in any field of stdout). If yes → followanswer_noticeand say it in plain language,never relay the original English sentence to the user, then decide whether to add a sentence from your own common sense (if you add one, you must mark it "this is my judgment, not content from your notes"), or you may suggest they rephrase the question, or record a note first and then ask. - If no → give
answer, andyou must give the sources along with it: take fromcitations[]theraw_source.title(if there's no title, useorigin_uri), and list them as "Basis: 《…》《…》".kindThose withgroundedare hard evidence;referenceare weak references — when both appear, distinguish between them. - Fabricating citations is forbidden: for
titlethat don't exist, don't add them;citationsif it's empty, say there are no sources. - When following up on the same topic over multiple turns, carry the
conversation_idreturned in the previous turn into the nextask, to preserve context. - For broader recall you can increase
top_k(upper limit 50; if not passed, the server default is used), don't blindly crank it up. - Billing:
askeach 1 point;note-write/note-status/note-search/source-read/selfare not charged. This is also one of the reasons it's downgraded — if search + read can solve it, don't forceask, and even less should you ask the same question twice "just to be safe." - The no-evidence red linesare not relaxed because of the downgrade:
evidence_level === "none"still must be stated plainly, and the English placeholder sentence still must not be relayed.
6. self: sets the tone for the answer; don't adjust it every turn
self The actual shape returned (don't fetch it based on a structure you imagined):
{
"core": {
"persona_core": { // ⚠️ 可能是 null
"compiled_self": "……" // ⚠️ 一整段中文 markdown 字符串,不是结构化对象
},
"current_version_no": 3, // number | null
"versions": [ { "id": "…", "version_no": 3, "change_reason": "…", "recorded_at": "…" } ]
},
"memories": [
{ "id": "…", "statement": "…", "kind": "…", "memory_type": "…", "recorded_at": "…", "source": { } }
]
}
persona_core is null is the normal state(the user has never run an organize, so in this case it's 200, not 404). The script will report on stderr
[warn] NO_PERSONA_CORE. In this caseyou must never imagine what kind of person the user is—truthfully say "you don't have a kernel in Mera yet,
go run an organize at https://mera.doubaoya.com and come back", and for this round just use the key memories in memories .
compiled_self Read the whole thing as context; do not split by fixed sections. It's agreed to contain 6 H2s
(identity anchors / decision-making and thinking style / principles and preferences / relationships and roles / current focus and what's in progress / expression style),
but that's just a prompt constraint for the model,zero code validation, and if generation fails it falls back to a deterministic fallback, so these 6 sections aren't guaranteed to all be present.
Splitting by section will grab an empty chunk on the day the fallback kicks in.
memories[] 's value domain is normalized,never null, never out of range:
kind∈factual/style/relationalmemory_type∈fact/preference/relation/project/material
When to call:
- The user asks "do you know me", "what kind of person am I", "what's my style".
- The user asks to "write in my style", "use my tone", "judge like the decision I would make".
- A long task that needs to fit the personat the startfetch it once, to set the tone.
When not to call:
- ❌ Calling it every round. Fetching once is enough,reuse it within the same conversation, don't hit the interface repeatedly.
- ❌ The user just wants to save something / just wants to search for some material—that doesn't need the persona kernel.
How to use it:core.persona_core.compiled_self Read the whole thing in to set the tone and judgment preferences,memories[].statement are the user's own key facts—
when citing you can include recorded_at("you said in month X..."), butdon't dump the kernel's original text in full for the user to see, that's for you to set the tone with.
7. Typical turn (end-to-end)
User: "Help me note this down: after talking with Old Wang, decided to do the standalone version first and then go online, send him the plan before next Wednesday."
- Judge intent = write → directly
remember(original words in, no polishing):node scripts/mera.mjs remember '{"content":"跟老王聊完,决定先做单机版再联网,下周三前把方案发他。"}' - Check exit code +
remember_result. Gotdoneanddisposition。 - Deliver:
记下了 ✅ 识别到「老王 / 单机版方案」两个实体,抽出 2 条事实、1 条待办(下周三前把方案发老王)。
User(a few days later): "What exactly did I decide with Old Wang before?"
- Retrieve(get the hit locations, not the answer):
3 come back, the most relevant onenode scripts/mera.mjs search "老王 方案"id=src_1、char_start=3000、char_end=3400、title"a conversation with Old Wang". - Read the original text(feed
char_start/char_endin as-is, the script computes the windowfrom=2500, to=4900):
read 1–2 more with similar relevance, at most 3.node scripts/mera.mjs read '{"source_id":"src_1","char_start":3000,"char_end":3400}' - Synthesize it yourself, answer using the real original text, and cite the real
title:
User says "show me the original words" → directly paste the你们定的是「先做单机版再联网」,理由是联网那版要等对方接口。 (出自《和老王的一次对话》,2026-07-20)readobtainedcontentas-is, no need to call the interface again. - Throughout, 0 points:
searchandreadare both free. Usingaskinstead costs 1 point, and you can't see the context of your current turn.
8. Error Code Reference Table
The script prints errors to stderr as [error] code: message and exits with code 1. Common code:
| code | Meaning | Action |
|---|---|---|
MISSING_API_KEY(script-local) |
Environment variable not set | Walk the user through §2's four steps to get the key.Do not echo the key。 |
UNAUTHORIZED(401) |
Key invalid / revoked | Remind the user to go to doubaoya.com → Key Center to regenerate and export。Do not echo the key。 |
VALIDATION_ERROR(400) |
Invalid input parameters | Check message to fix:content/url whether they are all empty,query_text whether any is missing,top_k whether any exceeds 50,ingestion_id whether it is correct. |
INSUFFICIENT_CREDITS / NO_CREDIT_ACCOUNT(402) |
Insufficient quota / no quota account | Remind the user to check / top up quota at doubaoya.com. |
FORBIDDEN(403) |
No permission for this capability | Report it truthfully, do not retry. |
ENDPOINT_NOT_FOUND / NOT_FOUND(404) |
Wrong API path / object does not exist | Usually the script has been modified or ingestion_id is written wrong; verify and retry. |
RATE_LIMITED(429) |
Calling too fast (limit 240 times/minute, total across all slugs) | Wait a while and come back,do not frantically retry in place. Normal usage will not hit this; if you hit it, you are reading too scattered (see §9). |
PROVIDER_FAILED(502) |
Upstream temporary failure | Quota is automatically refunded, safe to retry. For whether retrying stores two copies, see §4.4 (content mode does not, url mode is not guaranteed). If it still fails after one or two retries, then tell the user. |
CAPABILITY_UNAVAILABLE(503) |
This deployment does not have Mera configured | Truthfully tell the user "the current service has not enabled the second brain,"do not retry。 |
NETWORK_ERROR(script-local) |
Cannot connect to doubaoya.com | Check the network and retry. |
BAD_RESPONSE(script-local) |
Response is not valid JSON | Retry later; if it persists, tell the user the server is abnormal. |
INGESTION_FAILED(script-local) |
Write entered the queue but processing failed (status=failed) |
must state explicitly:status in error is a string starting with the stage name (e.g., chunk: produced no chunks for raw_source 0a9b… (empty content?)), which can be directly relayed to the user, then ask whether to retry / switch to pasting the body text. |
| Other unseen code | Not in this table | Relay message truthfully to the user,do not make up your own explanation, do not retry to death。 |
9. Boundaries and Fault Tolerance
- If the write is not confirmed, it is not confirmed.
pendingis not success, nor failure—just say truthfully "queued, not yet confirmed." - Search returns 0 results: truthfully say nothing was found, suggest trying another word.Never make up content, and do not expect that switching to
askwill help—it searches the same set of notes. - Do not use a 240-character snippet as the answer: if you want a conclusion,
readNothing that is not in the snippet,must not be filled in by guessing。 readis just one window:truncated === truethere is still content after it, so don't call this one window the whole text; for the continuation read start point use "this timefrom+ the length actually read",don't trust the echoed-backtoin the response (see §5.2).- Rate limit 240 times/minute(all slugs combined). Normal usage stays far away from it: one round of recall is 1
search+ 1–3read. What hugs the limit is playstyles like "open 3 windows for each of 20 sources"—don't do that; if you hit it, that'sRATE_LIMITED。 - Missing fields: Mera's return fields may be missing (e.g. no
disposition, nocitations), always "if it can't be obtained, skip that sentence"; don't let missing fields crash the whole report, and don't showundefinedto the user. - Don't overstep your authority to change the user's brain: this Skill only has write and read,no delete / modifycapability (intentionally so in the first version). If the user says "delete that one" or "change the title" → truthfully tell them to go to https://mera.doubaoya.com and do it themselves, don't think of using "resubmit it once" to change the title(see §4.5; that will only be blocked by deduplication and the new title silently lost).
- Oversized content: one
rememberpassing a very long body / scraping a large web page, 10 seconds is often not enough, it will fall intopending. At this time you can adjustMERA_POLL_BACKOFF_MSlonger (e.g.2000,4000,8000,15000) and do anotherstatusrecheck; don't treat it as a failure.
10. Directory structure
mera/
├── SKILL.md # 本文件:触发词 / 写入收条剧本 / 检索→读原文主路径 / 红线
├── README.md # 给人看的介绍与安装
├── LICENSE
└── scripts/
├── mera.mjs # 零依赖客户端(Node 18+)
└── selfcheck.mjs # 自检:起本地假网关 + spawn 真脚本,断言 stdout/stderr/退出码
Self-check can be run at any time (no key needed, no network):
node scripts/selfcheck.mjs
11. FAQ
Q: How do I get a key?
A:doubaoya.com Log in → Key Center → Generate key, copy dyh_…,
export DOUBAOYA_API_KEY="dyh_…". This key also determines whichperson'ssecond brain you connect to—it is the user's own.
Q:write and remember —which one should be used after all?
A:Use remember。write only when you have already clearly decided you want to control the polling rhythm yourself (e.g. batch-writing a bunch, wanting to submit them all first and then check status uniformly).
Q: Why can't it be searched immediately after writing?
A: Writing is asynchronous and has to go through several steps of parsing / extraction. Only after getting status=done does it count as really in.pending after a dozen or so seconds, status recheck once.
Q: The user asks "What do I think about X"—should I use ask ?
A:You should not. go search → read → synthesize yourself.ask is used only in two cases: the user wants that evidence grading as a trust signal,
or wants this round of Q&A to appear in the mera.doubaoya.com conversation list (criteria see §5.3).
Q:read 's from / to do I have to calculate it myself?
A: No need. Take search from the result of char_start / char_end and pass it as-is to read; the script opens windows by "first 500 and last 1500",
and also clamps negative numbers to 0 for you. If you want to control it yourself, explicitly pass from / to。
Q:ask says there is no evidence, how should I reply?
A: First state plainly "your notes contain nothing that can support this question," then decide whether to add a sentence using your own common sense—butyou must make clear that this is your judgment.
Never disguise your own reasoning as content from the user's notes. The criterion only recognizes evidence_level === "none", do not use grade。
Q:ask why did it reply with an English sentence?
A: That is evidence_level === "none" the hardcoded placeholder from Mera at the time, not an answer. The script has already replaced it with Chinese and tagged it
no_evidence: true——speak in Chinese, do not pass on the original English sentence。
Q: If the same item is recorded twice, will two copies be stored? A: Pasting the main text (content) will not; storing a link (url)is not guaranteed—deduplication is based on the main text that was retrieved; if the webpage has dynamic content, an extra copy will be stored. See §4.4.
Q:self returned by persona_core is null?
A: This means the user has never run organizing in Mera.Do not speculate about what kind of person he is, truthfully ask him to go to https://mera.doubaoya.com and run it once,
for this round first only use memories。
Q: Can notes be deleted? A: No. This Skill only writes and reads; for deletion or modification, please have the user go to https://mera.doubaoya.com to operate.
Q: Reports 502 PROVIDER_FAILED?
A: The upstream had a temporary hiccup; the quota has been automatically refunded, so just retry directly.
(⚠️ After being taken down, this FAQ no longer applies: the current 502 is not a hiccup, retrying will not improve it, see the banner at the top.)