How They Use AI  |  Newest

<< Home  |  Work

Shared memory between two AI agents for projects

AreaWork
AI usedClaude Code and Codex
Sourcer/BuildWithClaude
Posted2026-08-28

The move

Create a shared SQLite database with a simple Node.js CLI to act as a persistent memory layer for multiple AI agents.

Steps

  1. Create four SQLite databases for tasks, sales, project status, and file indexing.
  2. Write a simple Node.js CLI for each database using the built-in node:sqlite module.
  3. Define a standard command reference for adding, updating, and querying data.
  4. Add the command reference to the configuration files of both AI agents.
  5. Tag every entry with the actor's name to maintain an audit trail.

Prompt for your AI

You have access to a shared SQLite database via CLI commands. Use the [database name] tool to [action, e.g., update project status] by running the command: [command syntax]. Always tag your entries with your agent name and check the existing logs before starting a new task.

What happened

The user struggled with Claude Code and Codex having separate, non-persistent memories for shared projects. They built four small SQLite databases to track tasks, sales, project status, and file locations. Both agents were configured to read and write to these databases, allowing them to hand off tasks and maintain context across sessions.

Watch out

Ensure the SQLite database is set to WAL mode to prevent file locking issues during concurrent writes. Keep the CLI scripts simple to avoid dependency conflicts.

Give it to your agent

Read https://howtheyuse.ai/p/shared-memory-between-two-ai-agents-for-projects.md and help me do this.

Sources



Last updated November 26, 2026.