Overview

Brains are per-user bare Git repositories that act as hosted knowledge remotes for agents. The Brain Git API exposes each brain through standard git smart-HTTP so you can use ordinary git clients to clone, push, and pull knowledge pages. Brain management and git-token lifecycle are covered on the Brains API page; this page covers the git transport.
This namespace is served by the Allternit API data-plane node (http://127.0.0.1:8013 on the same machine, or your paired or provisioned node). The hosted Cloud API at https://api.allternit.com does not route it; it relays only agent sessions, canvases, office and beta research/sessions. See Cloud API.

Base URL

Management and read endpoints:
Git smart-HTTP endpoints:

Authentication

Git smart-HTTP routes require an allternit_git_... token. The token can be passed as a Bearer header or as the password in HTTP Basic auth (the username is ignored). Management routes (/api/v1/brains, /api/v1/tokens/git) require a platform bearer token. See Authentication and Brains API for minting git tokens.

Endpoints

Clone a brain

Use the clone URL returned by POST /api/v1/brains or GET /api/v1/brains.

With Bearer header

With HTTP Basic auth

Push and pull

Once cloned, ordinary git push and git pull work with the same credential. The gateway proxies the git smart-HTTP conversation to git http-backend, so all standard git operations are supported.

Read brain pages over HTTP

To read the markdown pages from the default branch without using git, use:
This route is documented on the Brains API page.

Memory Drive repos

Each user’s Memory Drive is a brain repo served by these same routes. For drive repos:
  • Tokens can be scoped to that one repo with read (clone and fetch only) or write access. Mint them with POST /api/v1/memory/drive/tokens; a read token pushing gets 403.
  • Members of a shared (team) drive reach the owner’s repo with a token scoped to it; removing the member removes access at once.
  • Every push is checked before the branch moves: only main, fast-forward only, at most 200 commits, standard memory format, no possible credentials, no changes to twin/. A refused push prints Memory Drive refused this push: and the reason.
  • After an accepted push the memory index is rebuilt.

Git token lifecycle

Git tokens are minted, listed, and revoked through the management surface:
  • POST /api/v1/tokens/git — mint a token (plaintext shown once).
  • GET /api/v1/tokens/git — list tokens without plaintext.
  • DELETE /api/v1/tokens/git/:id — revoke a token.
See Brains API for examples.

Error codes