Core Docs

core.ai Roadmap

core.ai Roadmap



Living task list for core.ai — LLM abstraction layer and conversation platform.

Current State (audit 2026-07-17)



Skeleton repo — zero code. README + empty composer.json only. Greenfield implementation of the finalized L2 design (AI Protocol: provider model, conversation flow, cost & billing, 5-table schema).

→ L4 code reference will be initialized once the Phase 0 scaffold lands.

Dependencies



Depends OnFor







core.authUser identity, session validation, AI-credit quota enforcement
core.consoleAPI gateway routing, project API keys, usage logging
core.storageMedia original + derived file storage
core.hypermediaMedia compression/conversion before LLM ingestion
LLM providersOpenAI/Anthropic/Google platform keys (env config, no BYOK)
MySQLconversations, messages, trace_events, api_calls, cost_ledger + supporting tables

Current Sprint — Phase 0: Foundation



  • [ ] Repo scaffold — structure per L4 conventions (public/, src/, bootstrap/, env/), composer.json (PSR-4)

  • [ ] DB schema — 5 core tables (conversations, messages, trace_events, api_calls, cost_ledger) + supporting tables (presets, skills, system_prompts, media attachments)

  • [ ] Internal message format — the 5 message types (user, assistant text, assistant tool-call, tool result, system) as PHP value objects

  • [ ] Provider adapter interface — translate in/out of internal format; first adapter (one provider), non-streaming only

  • [ ] api_calls + cost_ledger recording — every LLM request logged with tokens/latency/status; cost as integer cents ×10000

Backlog



Phase 1: Conversation Core


  • [ ] conversations/messages CRUD + standard turn lifecycle

  • [ ] Pre-prompt folding into system prompt at creation

  • [ ] Quota pre-check flow via core.auth (abort if exceeded)

  • [ ] Provider pricing static JSON config + credit rate calculation

Phase 2: Streaming


  • [ ] SSE normalized protocol (event types, client behavior, visibility modes)

  • [ ] Provider raw-chunk → normalized-chunk translation

  • [ ] Model capability registry

Phase 3: Tool Use


  • [ ] Tool-call loop with limits (assistant tool_calls → tool results → re-call)

  • [ ] trace_events full lifecycle (thinking, tool_call_request/result, llm_request, error, retry, model_switch, context_truncation, guardrail_block)

  • [ ] Tool execution layer + expandable-trace UI contract

Phase 4: Cost & Billing Polish


  • [ ] Ledger queries (daily per user, monthly per project, per model, cumulative per conversation via window functions)

  • [ ] Retention jobs (api_calls 90d, cost_ledger 12mo, monthly aggregate summaries)

Phase 5: Context Management


  • [ ] Sliding window + summary truncation strategy

  • [ ] Summary generation (itself a billed LLM call)

Phase 6: Media Pipeline


  • [ ] Media upload via core.storage, processing gate via core.hypermedia (message can't send until processed)

  • [ ] Originals preserved after compression

  • [ ] Multi-modal message support in internal format

Phase 7: Presets & Skills


  • [ ] Presets CRUD + preset flow (avatar, description, pre-prompt, prompt template)

  • [ ] Skills (dev-facing: system prompt + model settings)

  • [ ] System prompt templates (filesystem + DB index)

Phase 8: Multi-Provider Polish


  • [ ] Model-per-message switching + cache-break warning

  • [ ] Additional provider adapters

  • [ ] Streaming across all adapters

Completed



  • [x] L2 architecture finalized (5 articles + 5-table schema, 2026-07-09)