#How to add custom md file

1 messages · Page 1 of 1 (latest)

left venture
#

How to add custom md files and let them be read automatically by the bot without manual intervention.

long condorBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

neon hornetBOT
#

OpenClaw won’t “auto-read” arbitrary .md files just because they exist in the workspace. To keep token usage + data leakage under control, the system prompt only injects a fixed set of bootstrap files (and optionally memory), e.g. AGENTS.md, SOUL.md, TOOLS.md, USER.md, etc. Docs: https://docs.openclaw.ai/concepts/system-prompt and https://docs.openclaw.ai/concepts/context

What you can do:

  1. If you want it available every turn: put the content into one of the injected files (most people use TOOLS.md for “reference notes” and memory.md / MEMORY.md for memory). Keep it short; big files get truncated and burn context.

  2. If you want multiple files injected automatically: enable the bundled internal hook bootstrap-extra-files (it adds extra bootstrap files via globs). Docs: https://docs.openclaw.ai/automation/hooks
    Config example:

{
  hooks: {
    internal: {
      enabled: true,
      entries: {
        "bootstrap-extra-files": {
          enabled: true,
#
          paths: ["packages/*/AGENTS.md", "packages/*/TOOLS.md"]
        }
      }
    }
  }
}

Note: this hook only loads recognized bootstrap basenames (so it’s great for “extra AGENTS/TOOLS in a monorepo”, not for injecting my-notes.md).

  1. For lots of docs (recommended): keep them out of the injected prompt and have the agent read/search them on-demand (via a skill that tells it when to read, or by putting notes into memory/*.md and relying on memory_search). This avoids ballooning your context window.

If you paste your openclaw --version and say whether this is for DMs vs a public Discord channel, I can suggest the cleanest approach (DMs can use MEMORY.md; group contexts are stricter for privacy).

left venture
#

Can you go into detail regarding point 1

neon hornetBOT
#

Point 1 is basically: you don’t “add arbitrary MD files” — instead you put your custom info into the small set of workspace files that OpenClaw auto-injects into the system prompt (so the model “reads” them every turn as part of context).

What “auto-read” means in OpenClaw

On every message, OpenClaw rebuilds the system prompt and appends certain workspace files under Project Context (so the model sees them without needing a read tool call). By default this set includes (if present):

  • AGENTS.md (operating rules / guardrails)
  • SOUL.md (persona/tone)
  • TOOLS.md (your reference notes for tools + conventions)
  • IDENTITY.md, USER.md, HEARTBEAT.md
  • plus memory.md / MEMORY.md when present (with privacy rules; see below)

Docs: https://docs.openclaw.ai/concepts/system-prompt

Practical “how do I do it?”

  1. Find your workspace folder
#
openclaw config get agents.defaults.workspace

Default is usually ~/.openclaw/workspace.

  1. Pick the right injected file for your content
  • Put “how I want you to behave / always do X” in AGENTS.md
  • Put “reference info, commands, how my setup is laid out, links to other files” in TOOLS.md
  • Put “about me / preferences” in USER.md
  • Put “durable memory” in memory.md / MEMORY.md (see note below)
  1. Edit that file (no restart needed; it’ll apply on the next message because the prompt is rebuilt each run).

  2. Verify it’s injected
    In chat, run:

  • /context list (shows which workspace files are injected + sizes)
  • /context detail (bigger breakdown)
#

Recommended pattern if you really want “custom docs”

Use TOOLS.md as an index + rules for when to read your real docs, like:

## Knowledge base (read on demand)
- Pricing/policies live in `docs/policies.md`
- API notes live in `docs/api.md`

When a user asks about pricing/policies, **read `docs/policies.md` first** before answering.
When a user asks about the API, **read `docs/api.md` first** before answering.

That way:

  • the agent gets the “automatic” instruction (because TOOLS.md is injected),
  • but your large docs don’t bloat context every single turn.

Important constraints / gotchas

#
  • Everything injected costs tokens every turn. Keep injected files tight.
  • Group privacy: MEMORY.md is intended to be private-session only (not loaded in group contexts). In Discord channels/threads, assume anything you put in injected files could influence replies in public.

If you tell me what kind of content you’re trying to add (small “rules” vs big docs/manual), I can suggest exactly which file to use and a clean layout.

left venture
#

I want to give my agent instructions that he will get back to me on his own automatically once i ask him something or if he finished a task or step of a task if there multiple. I want to prevent him from going silent so I don't have to manually ask for an update or what he is currently doing. He also should give me time estimates on how long approximately he will take to finish the task

neon hornetBOT
#

You can get most of what you want with (A) agent instructions + (B) enabling streaming, and for truly long work (C) sub-agents / background exec notifications.

The key limitation to understand up front: during a single long tool call (e.g. a slow web_fetch, a big browser sequence, etc.) the agent can’t “talk in the middle” unless it has structured the work into multiple runs (sub-agent / background job). So we aim for: ack immediately + ETA, then milestone updates between steps, and a guaranteed final “done/failed” message.

A) Put a “progress + ETA contract” into AGENTS.md

Add something like this to your injected AGENTS.md (or TOOLS.md):

## Progress + ETA policy (do not go silent)
- Never end a user-initiated run without sending a message.
- At the start of any task that is more than a quick answer:
  1) restate goal in 1 line
  2) give a short plan (3–7 steps)
  3) give an ETA as a *range* (e.g. 2–5 min) and say what could change it
- After each completed step, post a short progress update:
  - ✅ what’s done
#
  - ▶️ what’s next
  - ⏱️ updated ETA (range)
- If blocked (missing info / auth / tool failure), say so immediately and ask the minimum question to unblock.
- Do not use `NO_REPLY` for user-initiated tasks.
- If you expect the work to take >60–90 seconds, prefer spawning a sub-agent and tell me you did.

This doesn’t require config changes; it just forces the model to “behave chatty” and always provide an ETA + updates.

B) Enable Discord “streaming” so you see it typing

This helps a lot with the “it’s silent” feeling during generation.

Config (JSON5):

#
{
  channels: {
    discord: {
      streaming: "partial" // or "progress" (maps to partial on Discord)
    }
  }
}

CLI equivalent:

openclaw config set channels.discord.streaming "partial"
openclaw gateway restart
#

Docs: https://docs.openclaw.ai/channels/discord (Live stream preview section)

C) For long tasks: use sub-agents (auto-announce on completion) + milestone pings

For anything that might take minutes, you want the agent to spawn a sub-agent. Sub-agents announce results back into the chat automatically when finished, so you don’t have to ask “status?”. Docs: https://docs.openclaw.ai/tools/subagents

In your AGENTS.md, explicitly tell it: “If ETA > 2 minutes, spawn a sub-agent and report milestones.”
That’s the most reliable way to get “I’ll get back to you on my own” behavior.

Bonus: long shell commands

If the work is exec-heavy, have it run commands in the background; OpenClaw can enqueue an event on exit (tools.exec.notifyOnExit is true by default), which triggers a follow-up heartbeat so it can notify you when the command completes.


If you tell me what channel you’re using most (Discord only, or Telegram/WhatsApp too) and what kind of “tasks” you mean (coding? web research? automations?), I can suggest a tighter AGENTS.md snippet (and whether sub-agents vs streaming will help more).

left venture
#

I added the eta policy and its not working the bot still does not reply with a result

neon hornetBOT
#

If you’re getting no reply at all, that’s almost never “ETA policy didn’t work” — it means the agent run didn’t happen or it ran but delivery failed (allowlist/mention gating, gateway/model error, etc.). Let’s narrow it down quickly.

1) First confirm your new AGENTS.md is actually being injected

In the same Discord thread where you expect replies, run:

  • /context list

You should see AGENTS.md listed, and the injected snippet should reflect your new policy.

If it doesn’t:

  • you edited the wrong workspace (common if your Gateway runs on a VPS but you edited a local file)
  • or you edited the wrong filename (must be exactly AGENTS.md)
  • or you put it in MEMORY.md (which is intentionally not loaded in group contexts)

On the Gateway host, check:

#
openclaw config get agents.defaults.workspace

…and edit AGENTS.md in that folder.

2) Most common Discord reason for “bot is silent”: channel/mention allowlist rules

In guild channels, Discord is usually configured with groupPolicy: "allowlist" and often requireMention: true.

Two quick questions:

  1. Are you mentioning the bot in the message (or replying to one of its messages)?
  2. Is this thread/channel actually allowlisted under your channels.discord.guilds.<guildId>.channels map?

Docs (this is the exact behavior): https://docs.openclaw.ai/channels/discord#access-control-and-routing

3) Check whether the Gateway is even processing your message

Please paste the output of these two (redact tokens):

#
openclaw --version
openclaw gateway status

And then tail the log right after you send a message that the bot ignores:

tail -n 200 ~/.openclaw/gateway.log

What we’re looking for in the log:

  • “dropped due to allowlist / requireMention”
  • “All models failed”
  • credential/auth errors
  • message send failures / rate limits

One clarification

#

When you say “still does not reply with a result” — do you mean:

  • A) it sends nothing (totally silent), or
  • B) it replies, but doesn’t include ETA/progress formatting?

If it’s (A), it’s routing/health/logs (steps above).
If it’s (B), we tweak the AGENTS policy wording.

Send (A) or (B) + the outputs above and we’ll get you unblocked fast.

left venture
#

Thats off im on telegram and my agent is responding but only after the second message.

neon hornetBOT
#

That symptom on Telegram usually isn’t “the ETA policy failed” — it’s queueing/activation behavior: your first message gets collected/debounced (or ignored in a group), and you only notice a reply once you send a second message.

1) Are you in a Telegram DM or a Telegram group?

  • DM: the bot should reply to every message (unless something is failing).
  • Group: OpenClaw can be in “mention-only” mode. If you don’t mention it, it may ignore the first message.
    • In that group, try: /activation always

2) Check your queue mode (this one matches your “only replies after 2nd msg” exactly)

In Telegram, send this as a standalone message:

  • /queue

It will print the current mode + options. If you see collect with a debounce, what happens is:

  • it waits briefly for “more messages” so it can answer them together,
  • so if you send a 2nd message quickly, it replies once to the batch.

To force “reply immediately per message”, set one of these:

#
  • /queue followup
    • (one reply per message, no coalescing)
  • or keep collect but remove the wait:
    • /queue collect debounce:0

Then test: send one message and wait ~5–10s without sending a second.

3) If it still only replies after a second message

Then we’re likely looking at a delivery/run issue (first run errors, second run succeeds). In that case, paste:

  • openclaw --version
  • the relevant log lines around the first “ignored” message:
    • tail -n 200 ~/.openclaw/gateway.log

But first, try /queue + /activation always (if it’s a group) — those fix this pattern most of the time.

left venture
#

Queue collect debounce:0
Returned
Invalid debounce "0". Use ms/s/m (e.g. debounce:1500ms, debounce:2s).