Git-like memory layer for agents with branch/snapshot/merge/search primitives, backed by Go and MatrixOne-compatible SQL.
- API entrypoint:
go run ./cmd/day1-api - CLI entrypoint:
go run ./cmd/day1 - Database: optional via
DAY1_DATABASE_URL- If unset, backend runs in-memory.
- If set, backend persists to MatrixOne/MySQL-compatible SQL.
cp .env.example .env
# Go backend (dev profile)
docker compose --profile dev up -d
# Optional: include local MatrixOne from compose
docker compose --profile dev --profile matrixone up -dDAY1_DATABASE_URL precedence:
- System environment value
.envvalue- Compose fallback (
127.0.0.1:6001forapi-dev,host.docker.internal:6001forapi)
Endpoints:
- API:
http://localhost:9821 - API docs:
http://localhost:9821/docs - MCP:
http://localhost:9821/mcp - Health:
http://localhost:9821/health
Prereqs: Go 1.24+, optional MatrixOne.
cp .env.example .env
# Optional DB check (requires DAY1_DATABASE_URL)
bash scripts/check_db.sh
# Start API
go run ./cmd/day1-apigo test ./...
go build ./...
go run ./cmd/day1-apiEmbedding provider:
DAY1_EMBEDDING_PROVIDER=mock|openai|openrouter|custom|doubaoopenai: requiresDAY1_OPENAI_API_KEYopenrouter: requiresDAY1_OPENROUTER_API_KEYcustom: requiresDAY1_EMBEDDING_API_KEY+DAY1_EMBEDDING_BASE_URLdoubao: requiresDAY1_DOUBAO_API_KEY
LLM provider:
DAY1_LLM_PROVIDER=mock|openai|anthropic|customopenai: requiresDAY1_OPENAI_API_KEYanthropic: requiresDAY1_ANTHROPIC_API_KEYcustom: requiresDAY1_LLM_API_KEY+DAY1_LLM_BASE_URL
Optional auth mode (requires SQL persistence):
DAY1_AUTH_ENABLED=trueDAY1_AUTH_ADMIN_KEY=<bootstrap-admin-key>DAY1_BOOTSTRAP_ADMIN_USER_ID=adminDAY1_DATABASE_URL=...(required when auth is enabled)
When enabled, call API endpoints with:
X-Day1-API-Key: <key>orAuthorization: Bearer <key>
Bootstrap flow:
- Call
POST /api/v1/auth/keysusingDAY1_AUTH_ADMIN_KEYas request key. - Use the returned
api_keyfor normal user-scoped requests.
- QUICKSTART.md
- docs/development.md
- docs/api_reference.md
- docs/mcp_tools.md
- docs/go-backend-migration.md
Private.