DEV Community

Ana Julia Bittencourt
Ana Julia Bittencourt

Posted on • Originally published at blog.memoclaw.com

Using namespaces to manage multiple projects from a single OpenClaw agent

If your OpenClaw agent works on more than one project, you have a problem. Memories from project A leak into recalls for project B. You ask about deploying the frontend and get back memories about a completely different repo's CI pipeline. Everything is in one pile.

MemoClaw namespaces fix this. A namespace is just a label that isolates a group of memories. Memories in namespace project-a won't show up when you recall from project-b. Simple concept, but the strategy around how you use them matters.

How namespaces work

Every MemoClaw operation accepts a --namespace flag. If you don't specify one, memories go into the default namespace (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
Enter fullscreen mode Exit fullscreen mode

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

Strategy 1: one namespace per project

The simplest approach. Each project or repo gets 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"
Enter fullscreen mode Exit fullscreen mode

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

Naming convention: use the repo name or project slug. Lowercase, hyphens. memoclaw-api, website-v2, client-acme.

Strategy 2: shared + project namespaces

Some knowledge applies everywhere. Your coding preferences, communication style, infrastructure details.

Use the default namespace for shared knowledge:

# Shared — applies everywhere
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"
Enter fullscreen mode Exit fullscreen mode

Then project-specific stuff goes into named namespaces:

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

The catch: MemoClaw doesn't automatically search both in one call. You need two recalls:

memoclaw recall "what ORM to use" --namespace client-acme
memoclaw recall "what ORM to use"
Enter fullscreen mode Exit fullscreen mode

With the OpenClaw skill, instruct your agent to always check both:

## Memory recall pattern

When recalling context for a task:
1. First recall from the current project namespace
2. Then recall from default namespace for general preferences
3. Merge results, project-specific takes priority
Enter fullscreen mode Exit fullscreen mode

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"
Enter fullscreen mode Exit fullscreen mode

Completely isolated. A recall in client-a will never return Client B's details.

For freelancers and agencies, adopt this pattern from day one. It's much 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"
Enter fullscreen mode Exit fullscreen mode

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 namespace target:

memoclaw migrate ~/projects/acme/docs/ --namespace client-acme
memoclaw migrate ~/notes/general/
Enter fullscreen mode Exit fullscreen mode

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

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

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:

  • Multiple projects from day one
  • Client work where isolation matters
  • Your memory pool will grow fast

Namespace naming conventions

Pattern Example When to use
Repo name memoclaw-api Open source, internal projects
Client slug client-acme Client work
Environment prod, staging Ops and infra context
Domain frontend, backend Large monorepo teams

Avoid spaces, uppercase, and special characters. Hyphens only. Treat namespace names like branch names.

Putting it together

Here's 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
Enter fullscreen mode Exit fullscreen mode

Then in AGENTS.md:

## 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)

When working on a project, use memoclaw_recall with the matching namespace.
Also recall from default namespace for general preferences.
Enter fullscreen mode Exit fullscreen mode

Namespaces are one of those features where the setup takes 10 minutes but the cleanup they prevent saves hours over the lifetime of the agent.


MemoClaw — Memory-as-a-Service for AI agents. 100 free API calls, no registration required.

Top comments (0)