Brifing

Building a Shared Knowledge Base for AI Agents

Sajal Sharma's method to sync context across multiple AI tools

O'Reilly Radar3 min

1The agent isolation problem

Current AI agents operate in silos, forcing users to repeatedly explain context when switching between tools like Claude Code and Codex. Home-server agents like OpenClaw compound this issue, creating workflow inefficiencies. Sajal Sharma encountered this while working with multiple AI tools, leading him to develop a centralized solution. The problem particularly affects developers who use different agents for specialized tasks throughout their workday.

2Workspace mapping solution

Sharma's system begins with an AGENTS.md file that serves as a directory for all knowledge base components. This includes current tasks, project notes, and decision logs - essentially creating a shared memory system. The structured approach prevents agents from guessing about workspace organization. This method mirrors how human teams use documentation, but adapted for machine readability and inter-agent communication.

3Hierarchical note management

The system maintains detailed daily notes that roll up into weekly summaries, which then consolidate into monthly overviews. This tiered structure allows agents to operate from appropriate detail levels without parsing excessive raw data. It also optimizes token usage as the knowledge base scales - a critical consideration given most language models' context window limitations. Agents can access the right abstraction level for their current task.

4File synchronization strategy

The solution implements cross-file linking between agent-specific documents (like CLAUDE.md) and the master AGENTS.md file. Sharma avoids duplication by using pointer systems that maintain single sources of truth. This prevents version drift between files that might contain overlapping information. The approach resembles software engineering's DRY principle, applied to AI agent knowledge management.

5Skill packaging for reuse

Frequent routines get abstracted into reusable skill files stored in the shared workspace. Examples include daily briefing generation or article-to-note conversion. Any workspace-aware agent can execute these packaged skills identically, eliminating redundant learning. This creates consistency across different agents' outputs for the same tasks and reduces computational overhead from repetitive processing.

6Cross-device synchronization

The system uses version control (Git) or file-sync tools to maintain consistency across local machines and servers. This ensures agents running on different platforms (like laptops and home servers via OpenClaw) access identical knowledge states. The synchronization mechanism prevents context fragmentation that could occur when agents operate on stale or divergent data copies.

7Write collision prevention

AGENTS.md includes instructions for agents to verify the current knowledge base state before writing. This concurrency control prevents update conflicts when multiple agents modify shared files. The protocol resembles database transaction management, addressing a key challenge in multi-agent systems where actions might otherwise overwrite each other's changes.

8Industry validation

The approach gains traction beyond Sharma's implementation. LangChain's OpenWiki applies similar principles for repository documentation usable by both humans and coding agents. Y Combinator's Garry Tan open-sourced GBrain, another shared memory layer for agents. These developments suggest the 'shared brain' pattern is becoming an emerging standard for complex AI agent ecosystems.

Original article: O'Reilly Radar — Building a Shared Knowledge Base for AI Agents