Skip to main content

Agent Integration Guide

This guide is for AI agents and developers building agents that need long-term memory. Bossa gives your agents a persistent filesystem to store and retrieve context across sessions—as simple as files, as powerful as Postgres. Use the managed service so your agents get persistent, searchable storage without running infrastructure. Base URL: https://bossamemory.com
MCP endpoint: https://bossamemory.com/mcp

Quick Start for Agents

  1. Get an API key — Install the CLI (pip install bossa-memory), sign up, create a workspace, create a key. See Getting Started.
  2. Add Bossa to your agent config — Run bossa init to add Bossa usage instructions to AGENTS.md or CLAUDE.md. Your agent will know the commands, flags, and exit codes. Use bossa init --path ./AGENTS.md --yes for non-interactive setup.
  3. Choose your interface:
    • CLI — If your agent runs tools as subprocesses (CLI-based harnesses, beads), use bossa files ls, read, write, grep, glob, edit, delete. Set BOSSA_CLI_JSON=1 for JSON output.
    • MCP — If your harness supports MCP (LangChain, Claude, Cursor), connect to https://bossamemory.com/mcp with headers Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY.
  4. Use the tools — Both interfaces expose the same operations: ls, read/read_file, write/write_file, grep, glob/glob_search, edit/edit_file, delete/delete_file.

CLI Example (agent subprocess)

When your agent executes tools as subprocesses:

LangChain Example (MCP)


Tool Usage Patterns

These patterns apply to both MCP tools and CLI commands. MCP uses read_file; CLI uses bossa files read. They are examples of dynamic context discovery—pulling only the context you need, when you need it.

Explore Before Reading

Use ls to discover structure, then read/read_file only for relevant files:

Search Without Reading Everything

Use grep with output_mode="files_with_matches" to find files, then read only matches:

Batch Operations (CLI)

For agents doing many ops, use bossa files batch to reduce round-trips:

Save Agent Output

Use write_file (MCP) or bossa files write (CLI) to persist summaries, analyses, or memory:

Edit In Place

Use edit_file (MCP) or bossa files edit (CLI) for targeted changes instead of read → modify → write:

Environment Variables for Examples

—safe Flag for Harnesses

Read-only commands (ls, read, grep, glob, stat, tree, du) support --safe. Use it when your agent harness gates tool execution: --safe signals that the operation is read-only and can be auto-approved.

Workspace Isolation

Each API key maps to one workspace. Agents using key A cannot see or modify files in workspace B. See MCP Integration for details.
Last modified on March 13, 2026