Skip to main content

Plataforma agéntica avanzada para terminal

Project description

fork_agent

Persistent memory, MCP server, and orchestration tools for AI coding agents.

SQLite-backed observation store with FTS5 search, 16-tool MCP server, interactive TUI, Obsidian export/import, and git-based sync. Python 3.11+ | MIT License


Features

  • Memory Store -- SQLite with FTS5 full-text search, short-ID prefix matching
  • MCP Server -- 16 tools over stdio, SSE, and streamable-http
  • CLI -- save, search, retrieve, list, get, update, delete, compact, sync, export, import, sessions, workflow, scheduling
  • TUI -- Textual-based browser with list, search, detail, save, and stats screens
  • Obsidian -- export/import with YAML frontmatter, dedup, path traversal protection
  • Git Sync -- chunk-based export/import to git remote for cross-machine persistence
  • Compact -- session summary save and context recovery after context-window resets
  • Hooks -- event-driven shell hooks (session, subagent lifecycle, git branch guard)

Quick Start

uv tool install .                                    # Install
memory save "Refactored auth middleware" --type decision  # Save
memory search "auth middleware"                       # Search
memory health                                         # Verify

Installation

uv tool (recommended)

uv tool install .

Installs memory, memory-mcp, fork, and fork-api globally.

pip

pip install fork_agent

From source

git clone https://github.com/felipe-gonzalez/tmux_fork.git
cd tmux_fork
uv sync --all-extras
uv run memory --help

CLI Reference

Core Memory

Command Description
memory save "content" Save an observation
memory search "query" FTS5 full-text search
memory retrieve "query" Enhanced multi-signal retrieval
memory list List recent observations
memory get <id> Get by full or short ID prefix
memory delete <id> Delete observation
memory update <id> "new content" Update observation
memory context Recent session summaries
memory stats Database statistics
memory health Health check

Save options

memory save "Fixed race condition in session handler" \
  --type bugfix --project my-api \
  --topic-key "auth/session-race" --title "Fix session race condition"

Search and Query

memory search "database migration" --type bugfix --limit 10
memory retrieve "how to handle concurrent writes" --project my-api
memory query --type decision --project my-api --after 2026-01-01

Sessions

memory session start --project my-api --goal "Refactor auth flow"
memory session end
memory session list

Compact (context-window recovery)

memory compact save-summary --session-id abc123
memory compact recover

Export and Import

memory export obsidian -o ./my-vault --project my-api     # Obsidian export
memory import obsidian -i ./my-vault --skip-duplicates   # Obsidian import
memory sync export --project my-api                        # Git sync export
memory sync import                                         # Git sync import
memory sync status                                        # Sync status

Project Management

memory project merge --from old-project --to canonical-project --dry-run

Workflow (gated phases)

memory workflow outline "Implement user authentication"
memory workflow execute
memory workflow verify
memory workflow ship
memory workflow status

Scheduling

memory schedule add "run tests" 3600
memory schedule list
memory schedule show <id>
memory schedule cancel <id>

Messaging (inter-agent IPC)

memory message send agent1:1 "Task complete"
memory message broadcast "All systems operational"
memory message history agent1:1

MCP Server

Expose memory as 16 MCP tools to any compatible client.

Configuration

Add to your client config:

{
  "mcpServers": {
    "memory": {
      "command": "memory-mcp"
    }
  }
}

Client-specific paths

Client Config path
Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json
Cursor .cursor/mcp.json (project root)
n8n MCP bridge config

Transports

memory-mcp                                    # stdio (default)
memory-mcp --transport sse --port 8080        # SSE
memory-mcp --transport streamable-http --port 8080  # Streamable HTTP

Custom database path

{
  "mcpServers": {
    "memory": {
      "command": "memory-mcp",
      "args": ["--db", "/path/to/memory.db"]
    }
  }
}

Available tools

memory_save, memory_search, memory_get, memory_list, memory_update, memory_delete, memory_context, memory_stats, memory_timeline, memory_session_start, memory_session_end, memory_session_summary, memory_suggest_topic_key, memory_save_prompt, memory_capture_passive, memory_merge_projects. See docs/mcp-setup.md.


TUI

memory tui
memory tui --db /path/to/custom.db
Key Action Key Action
s / Search a Save
S Stats d Detail
q Quit

5 screens: List, Search, Detail, Save, Stats.


Architecture

DDD / Ports and Adapters with dependency injection.

src/
  domain/           Entities (frozen dataclasses), Protocol ports
  application/      Services, use cases, orchestration, workflow
  infrastructure/   SQLite repositories, migrations, DI container
  interfaces/
    cli/commands/   Typer CLI
    tui/screens/    Textual TUI (5 screens)
    api/            FastAPI REST
    mcp/            MCP server (16 tools, 3 transports)
CLI / TUI / MCP / API --> application/services --> domain/ports --> infrastructure/persistence

Configuration

Setting Default Override
Database path ~/.local/share/fork/memory.db --db flag or FORK_MEMORY_DB env
API key None API_KEY env var

Default path follows XDG Base Directory specification (XDG_DATA_HOME).


Development

# Install dependencies
uv sync --all-extras

# Run tests
uv run pytest tests/ -v

# Run tests with coverage
uv run pytest tests/ --cov=src --cov-report=term-missing

# Lint
uv run ruff check src/ tests/

# Format
uv run ruff format src/ tests/

# Type-check
uv run mypy src/

# Run all checks
uv run pre-commit run --all-files

Documentation

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fork_agent-0.1.0.tar.gz (522.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fork_agent-0.1.0-py3-none-any.whl (317.0 kB view details)

Uploaded Python 3

File details

Details for the file fork_agent-0.1.0.tar.gz.

File metadata

  • Download URL: fork_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 522.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fork_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ca1263e452dae3fa8253f4073fbb72eb330846ad67042661cdd911cf992c8bf4
MD5 dba2b31df1af8439c367a346f513549c
BLAKE2b-256 0f4753d9f21ecee51430e72218af7863d0d59d5462faa189a21de4caa9389f28

See more details on using hashes here.

File details

Details for the file fork_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fork_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 317.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for fork_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e319fad6bfff9d1a6d5ac49fed9d561956e215408f31d96d4abc8f8851b38e7
MD5 fd7cdf0feb4321ec623f48c3de31757a
BLAKE2b-256 052e86b9a0ec1229797643b1cf8136a47a879cdd83c9a7708f3c40d3823146d6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page