Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.

matrixorigin/day1

Repository files navigation

Day1

Git-like memory layer for agents with branch/snapshot/merge/search primitives, backed by Go and MatrixOne-compatible SQL.

Runtime

  • 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.

Quick Start (Docker)

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 -d

DAY1_DATABASE_URL precedence:

  1. System environment value
  2. .env value
  3. Compose fallback (127.0.0.1:6001 for api-dev, host.docker.internal:6001 for api)

Endpoints:

  • API: http://localhost:9821
  • API docs: http://localhost:9821/docs
  • MCP: http://localhost:9821/mcp
  • Health: http://localhost:9821/health

Quick Start (Local)

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-api

Validation

go test ./...
go build ./...
go run ./cmd/day1-api

BYOK (Embedding + LLM)

Embedding provider:

  • DAY1_EMBEDDING_PROVIDER=mock|openai|openrouter|custom|doubao
  • openai: requires DAY1_OPENAI_API_KEY
  • openrouter: requires DAY1_OPENROUTER_API_KEY
  • custom: requires DAY1_EMBEDDING_API_KEY + DAY1_EMBEDDING_BASE_URL
  • doubao: requires DAY1_DOUBAO_API_KEY

LLM provider:

  • DAY1_LLM_PROVIDER=mock|openai|anthropic|custom
  • openai: requires DAY1_OPENAI_API_KEY
  • anthropic: requires DAY1_ANTHROPIC_API_KEY
  • custom: requires DAY1_LLM_API_KEY + DAY1_LLM_BASE_URL

API Key Auth (per-user)

Optional auth mode (requires SQL persistence):

  • DAY1_AUTH_ENABLED=true
  • DAY1_AUTH_ADMIN_KEY=<bootstrap-admin-key>
  • DAY1_BOOTSTRAP_ADMIN_USER_ID=admin
  • DAY1_DATABASE_URL=... (required when auth is enabled)

When enabled, call API endpoints with:

  • X-Day1-API-Key: <key> or Authorization: Bearer <key>

Bootstrap flow:

  1. Call POST /api/v1/auth/keys using DAY1_AUTH_ADMIN_KEY as request key.
  2. Use the returned api_key for normal user-scoped requests.

Docs

License

Private.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors