Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Python Agent Example
A simple Python script demonstrating how an AI agent can use bd to manage tasks.
Features
- Finds ready work using
bd ready --json - Claims tasks by updating status
- Simulates discovering new issues during work
- Links discovered issues with
discovered-fromdependency - Completes tasks and moves to the next one
Prerequisites
- Python 3.7+
- bd installed:
curl -fsSL https://raw.githubusercontent.com/gastownhall/beads/main/scripts/install.sh | bash - A beads database initialized:
bd init
Usage
# Make the script executable
chmod +x agent.py
# Run the agent
./agent.py
What It Does
- Queries for ready work (no blocking dependencies)
- Claims the highest priority task
- "Works" on the task (simulated)
- If the task involves implementation, discovers a testing task
- Creates the new testing task and links it with
discovered-from - Completes the original task
- Repeats until no ready work remains
Example Output
๐ Beads Agent starting...
============================================================
Iteration 1/10
============================================================
๐ Claiming task: bd-1
๐ค Working on: Implement user authentication (bd-1)
Priority: 1, Type: feature
๐ก Discovered: Missing test coverage for this feature
โจ Creating issue: Add tests for Implement user authentication
๐ Linking bd-2 โ discovered-from โ bd-1
โ
Completing task: bd-1 - Implemented successfully
๐ New work discovered and linked. Running another cycle...
Integration with Real Agents
To integrate with a real LLM-based agent:
- Replace
simulate_work()with actual LLM calls - Parse the LLM's response for discovered issues/bugs
- Use the issue ID to track context across conversations
- Export/import JSONL to share state across agent sessions
Advanced Usage
# Create an agent with custom behavior
agent = BeadsAgent()
# Find specific types of work
ready = agent.run_bd("ready", "--priority", "1", "--assignee", "bot")
# Create issues with labels
agent.run_bd("create", "New task", "-l", "urgent,backend")
# Query dependency tree
tree = agent.run_bd("dep", "tree", "bd-1")
See Also
- ../bash-agent/ - Bash version of this example
- ../claude-desktop-mcp/ - MCP server for Claude Desktop