Using namespaces to manage multiple projects from a single OpenClaw agent

Published: (March 11, 2026 at 01:52 AM EDT)
6 min read
Source: Dev.to

Source: Dev.to

📦 MemoClaw Namespaces – Keep Your Memories Isolated

Ana Julia Bittencourt

If your OpenClaw agent works on more than one project, memories from Project A can leak into recalls for Project B. You might ask about deploying the frontend and get back details from a completely different repo’s CI pipeline.

MemoClaw namespaces solve this. A namespace is just a label that isolates a group of memories. Memories stored in namespace project-a won’t appear when you recall from project-b. The concept is simple, but the strategy you adopt matters.

How namespaces work

Every MemoClaw operation accepts a --namespace flag. If you don’t specify one, memories go into the default namespace (an empty string).

# Store in a specific namespace
memoclaw store "Frontend uses Next.js 14 with app router" \
  --namespace website-redesign --tags "stack"

# Recall only from that namespace
memoclaw recall "what framework are we using" --namespace website-redesign

# List memories in a namespace
memoclaw list --namespace website-redesign

# See all your namespaces
memoclaw namespace list

# See memory counts per namespace
memoclaw namespace stats

Memories in website-redesign are invisible to recalls that don’t specify that namespace.

Strategy 1 – One namespace per project

The simplest approach: give each project (or repo) its own namespace.

# Working on the API
memoclaw store "Rate limiting set to 100 req/min per user" \
  --namespace memoclaw-api --tags "config"

# Working on the docs site
memoclaw store "Docs use Mintlify, deploy via GitHub integration" \
  --namespace memoclaw-docs --tags "infra"

# Working on a client project
memoclaw store "Client wants Material UI, no Tailwind" \
  --namespace client-acme --tags "preference"

When you switch context, switch namespace. Your agent’s recalls stay relevant.

Naming convention – use the repo name or project slug, all lowercase with hyphens, e.g.:

memoclaw-api
website-v2
client-acme

Strategy 2 – Shared + project namespaces

Some knowledge applies everywhere (coding preferences, communication style, infrastructure details). Store that in the default namespace, and keep project‑specific facts in named namespaces.

Shared knowledge (default namespace)

memoclaw store "Always use pnpm. Never npm or yarn." \
  --importance 0.8 --tags "preference"

memoclaw store "Preferred commit format: conventional commits" \
  --tags "preference"

memoclaw store "Use TypeScript for all new code" \
  --tags "preference"

Project‑specific knowledge

memoclaw store "This project uses Drizzle ORM, not Prisma" \
  --namespace client-acme --tags "stack"

Important: MemoClaw doesn’t automatically search both the default and a named namespace in a single call. You need two recalls:

# Project‑specific recall
memoclaw recall "what ORM to use" --namespace client-acme

# Fallback to shared knowledge
memoclaw recall "what ORM to use"

Making the agent check both automatically

When you use the OpenClaw skill, instruct your agent to run the two recalls sequentially (or to merge the results) so that it always considers both shared and project‑specific memories.

TL;DR

  • Namespaces isolate memories – use --namespace on every command.
  • One‑namespace‑per‑project is clean and easy to reason about.
  • Shared + project namespaces let you keep universal preferences in the default namespace while still isolating project‑specific facts.
  • Remember to query both namespaces (or have the agent do it) when you need combined knowledge.

Memory Recall Pattern

When recalling context for a task:

  1. First recall from the current project namespace.
  2. Then recall from the default namespace for general preferences.
  3. Merge results – project‑specific information takes priority.

Two recalls cost $0.01 total. Worth it for clean context.

Strategy 3 – Client Isolation

If you handle multiple clients, namespaces become a privacy boundary.

memoclaw store "Client A uses AWS, us-east-1" \
  --namespace client-a --tags "infra"

memoclaw store "Client B is on GCP, europe-west1" \
  --namespace client-b --tags "infra"

A recall in client-a will never return Client B’s details.

Tip: For freelancers and agencies, adopt this pattern from day one. It’s far easier to namespace correctly from the start than to untangle a mixed memory pool later.

Strategy 4 – Environment Namespaces

Separate knowledge by environment:

memoclaw store "Prod database: neon-prod-xyz.neon.tech, 64 connections max" \
  --namespace prod --tags "database"

memoclaw store "Staging resets every Sunday night via cron" \
  --namespace staging --tags "ops"

Recalling from --namespace prod when troubleshooting ensures you get production‑specific details, not staging config.

Migrating Existing Memories into Namespaces

Use the migrate command with a target namespace:

memoclaw migrate ~/projects/acme/docs/ --namespace client-acme
memoclaw migrate ~/notes/general/

For already‑stored memories, export, edit the namespace fields, and re‑import:

memoclaw export -O all-memories.json
# Edit the file — add namespace fields
memoclaw import namespaced-memories.json

When NOT to Use Namespaces

Skip namespaces if:

  • You only work on one project.
  • Your agent handles one context at a time.
  • You have fewer than 100 memories total.

Start with namespaces if:

  • You have multiple projects from day one.
  • You do client work where isolation matters.
  • Your memory pool will grow quickly.

Namespace Naming Conventions

PatternExampleWhen to Use
Repo namememoclaw-apiOpen‑source or internal projects
Client slugclient-acmeClient work
Environmentprod, stagingOps and infra context
Domainfrontend, backendLarge monorepo teams
  • Avoid spaces, uppercase letters, and special characters.
  • Use hyphens only.
  • Treat namespace names like branch names.

Putting It All Together

A practical setup for an OpenClaw agent juggling three projects:

memoclaw init

# Shared preferences (default namespace)
memoclaw store "Use TypeScript, pnpm, conventional commits" \
  --importance 0.8 --tags "preference"
memoclaw store "Keep PRs under 400 lines. Split if larger." \
  --importance 0.7 --tags "preference"

# Project namespaces
memoclaw migrate ~/projects/api/docs/    --namespace api-service
memoclaw migrate ~/projects/web/docs/    --namespace web-app
memoclaw migrate ~/projects/mobile/docs/ --namespace mobile-app

clawhub install anajuliabit/memoclaw

In AGENTS.md

# Agents

## OpenClaw Agent

- **Namespaces:** `default`, `api-service`, `web-app`, `mobile-app`
- **Preferences:** TypeScript, pnpm, conventional commits
- **Usage:**  
  1. Retrieve project‑specific context with `memoclaw recall --namespace`.  
  2. Fall back to default preferences when needed.

With this structure, you get clean, isolated recall while keeping shared preferences readily available.

MemoClaw Namespaces

Active Projects and Their Namespaces

  • api‑service – Backend API (Node.js, Hono, Drizzle)
  • web‑app – Marketing site (Next.js, Tailwind)
  • mobile‑app – iOS app (Swift, SwiftUI)

Usage:
When working on a project, call memoclaw_recall with the matching namespace.
For general preferences, use the default namespace.

Full‑Screen Mode (Example UI)

Enter fullscreen mode

Exit fullscreen mode

MemoClaw – Memory‑as‑a‑Service for AI agents.
100 free API calls, no registration required.
https://memoclaw.com/

0 views
Back to Blog

Related posts

Read more »