Skip to content

kayoslab/cr0ss-agent

Repository files navigation

cr0ss agent

A private, single-user networking-recall assistant. Ask "who did I meet at the AI summit in Berlin?" and it recalls the person from your enriched contact memory. Built with Next.js + Eve, deployed on Vercel's services model (a Next.js web service and an eve service behind one domain).

Architecture

  • web (Next.js) — the chat UI and auth. Better Auth email + password (single owner). The signed-in browser fetches a bearer from the session-gated /api/agent-token route and forwards it to the agent.
  • eve (Eve agent) — the durable agent. Its one tool, search_contacts, is served over MCP by the cr0ss.org site. The eve channel accepts a request only when its bearer equals INTERNAL_API_SECRET, so "signed in via Better Auth" ⇒ "can reach the agent".
  • vercel.json wires the two services and rewrites /eve/* + /.well-known/workflow/* to eve, everything else to web.

Local development

pnpm install
cp .env.example .env.local   # then fill in the values
pnpm db:migrate              # push the Better Auth schema to the (local) libSQL db
pnpm dev                     # Next.js app  (http://localhost:3000)
pnpm dev:eve                 # Eve agent    (in a second terminal)

To create the owner account on a fresh database, set ALLOW_SIGNUP=true, sign up once via /login, then unset it and restart to re-lock registration.

Environment

See .env.example. Required:

Var Purpose
BETTER_AUTH_SECRET Better Auth session encryption (openssl rand -base64 32).
BETTER_AUTH_URL Public origin of the app.
INTERNAL_API_SECRET Shared bearer between the web and eve services.
CONTACTS_MCP_URL The cr0ss.org search_contacts MCP endpoint.
CONTACTS_MCP_TOKEN Must equal MCP_BEARER_TOKEN on the cr0ss.org site.
ALLOW_SIGNUP true only while bootstrapping the owner account.
TURSO_DATABASE_URL / TURSO_AUTH_TOKEN Hosted libSQL (Turso) in production.

In production, model access is handled by the Vercel platform via OIDC. Locally, set AI_GATEWAY_API_KEY.

Scripts

  • pnpm dev / pnpm build / pnpm start — Next.js app.
  • pnpm dev:eve / pnpm build:eve / pnpm start:eve — Eve agent.
  • pnpm typechecktsc --noEmit.
  • pnpm db:migrate — push the Better Auth schema (drizzle-kit push).