Cartly is an open-source iOS app that demonstrates how to build a real AI product on Mnexium. It is not a toy chatbot. It is a working reference for chat, history, OCR ingestion, and schema-backed records in one app.
Cartly exists to show developers what Mnexium enables when you combine:
- conversational AI
- persistent memory context
- structured application data
- deterministic records writes
- real multi-thread chat history
Mnexium gives you a single runtime model for AI apps:
- One
mnxcontext object to control behavior (history,learn,recall,records, and more). - Stable identity model with
subject_idandchat_idfor durable conversations. - Native Records layer for typed entities, schema validation, and CRUD/query workflows.
- Chat + data workflows in the same request pipeline (for example, receipt extraction -> records sync).
- Production-friendly controls like retries, request tracing, and explicit sync semantics.
In short: Mnexium helps you ship AI apps that are useful after the first prompt, not just impressive in a demo.
Cartly was built as a Mnexium-first app. The implementation directly uses Mnexium APIs and request patterns rather than treating Mnexium as a black box.
This project was also developed using the mnexium-app-builder Codex skill to keep implementation aligned with Mnexium best practices for:
- stable
subject_id/chat_idusage - chat + history endpoint mapping
- records schema and CRUD correctness
mnx.records.syncpersistence behavior- retry/error handling and integration hardening
You can learn more about Mnexium skills and tooling in the official docs:
How Mnexium is used in this codebase:
- Mnexium chat runtime via
POST /api/v1/chat/completions - Mnexium chat history toolchain via:
GET /api/v1/chat/history/listGET /api/v1/chat/history/read
- Mnexium Records schema management via
POST /api/v1/records/schemas - Mnexium Records CRUD/query for
receiptsandreceipt_items - Mnexium records sync orchestration using
mnx.records.sync=truefor OCR persistence
Where to see the integration:
Cartly/Mnexium/MnexiumClient+Chat.swiftCartly/Mnexium/MnexiumClient+Records.swiftCartly/Mnexium/MnexiumClient+Transport.swiftCartly/Mnexium/MnexiumClient+Parsing.swift
Cartly calls POST /api/v1/chat/completions with an mnx object including:
subject_idchat_idhistory=truelearn=truerecall=true- records context for
receiptsandreceipt_items
Cartly loads real thread history with:
GET /api/v1/chat/history/listGET /api/v1/chat/history/read
Users can switch across previous chats, not just keep one ephemeral session.
The receipt capture flow:
- Capture photo from camera.
- Compress and send image for OCR parsing.
- Send parsed JSON in a non-stream persistence request.
- Sync to Mnexium Records using
mnx.records.sync=true.
This pattern is a strong template for AI extraction workflows in production apps.
The Data tab demonstrates:
- list receipts
- create manual receipts
- delete receipts
- query receipt items by
receipt_id - create and delete receipt items
This repo includes a reusable schema definition file:
Defined tables:
receiptsreceipt_items(receipt_idisref:receipts)
POST /api/v1/chat/completionsGET /api/v1/chat/history/listGET /api/v1/chat/history/readPOST /api/v1/records/schemasGET /api/v1/records/receiptsPOST /api/v1/records/receiptsDELETE /api/v1/records/receipts/:idPOST /api/v1/records/receipt_itemsPOST /api/v1/records/receipt_items/queryDELETE /api/v1/records/receipt_items/:id
Cartly/ContentView.swift: Data, Chat, and More tabsCartly/ReceiptCaptureViewModel.swift: app orchestrationCartly/ReceiptParsingSupport.swift: identity and local key settingsCartly/Mnexium/: Mnexium client modulesmnexium-records-schema.json: canonical records schema for this app
- Xcode
- iOS Simulator or iOS device supported by the project
- Open
Cartly.xcodeproj. - Build and run the
Cartlyscheme. - Open More tab.
- Enter Mnexium API Key and OpenAI API Key (optional).
- Save.
- Leave Mnexium key empty to fall back to the app-provided key path.
For demo speed, user-entered keys are stored locally in UserDefaults.
For production, use Keychain for device secrets and keep provider keys server-side.
Cartly covers only part of Mnexium. You can extend this app with:
- profile-aware personalization
- claim/truth graph flows
- stateful agent workflows
- memory policy tuning
- semantic search over business records
If you are evaluating Mnexium, this repo is designed to be cloned, modified, and used as a launchpad for your own AI product.