Skip to content

Edge Memory Protocol (EMP) v1.0, demonstrated in example React Native app. Built for hackathon 🌡 see spec and SDK folder in repo for details (maybe coming soon to NPM? Let us know your feedback)

License

Notifications You must be signed in to change notification settings

theianmay/edge-memory

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

38 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Edge Memory Protocol

An open standard for sharing AI memory across mobile applications.

Built for Arm64 Architecture - Optimized for modern Arm-based mobile devices with on-device AI inference.

Overview

The Edge Memory Protocol (EMP) enables multiple apps from different developers to share a common memory store on mobile devices. All data stays local on the device, giving users complete control over their AI memory.

Project Structure

edge-memory/
β”œβ”€β”€ spec/                    # Protocol specification
β”‚   └── v1.0/
β”‚       β”œβ”€β”€ specification.md # Full protocol documentation
β”‚       β”œβ”€β”€ schema.json      # JSON Schema for validation
β”‚       └── examples.jsonl   # Example memory entries
β”œβ”€β”€ sdk/                     # Reference SDK implementation
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ types.ts         # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ validation.ts    # Entry validation
β”‚   β”‚   β”œβ”€β”€ lock.ts          # File locking
β”‚   β”‚   β”œβ”€β”€ MemoryStore.ts   # Core memory store
β”‚   β”‚   β”œβ”€β”€ platform/
β”‚   β”‚   β”‚   └── expo.ts      # Expo/React Native platform handler
β”‚   β”‚   └── index.ts         # Public API
β”‚   └── package.json
└── app/                     # Example application (coming soon)

Quick Start

1. Install Dependencies

npm install

2. Read the Specification

Start with the protocol specification to understand the standard.

3. Use the SDK

import { createMemoryStore } from './sdk/src';

const memory = createMemoryStore({
  appId: 'com.yourcompany.yourapp',
  debug: true,
});

// Initialize (requests user permission)
await memory.setup();
await memory.initialize();

// Write a memory
await memory.write({
  content: 'User prefers dark mode',
  type: 'preference',
  tags: ['ui', 'theme'],
});

// Read memories
const recent = await memory.read({
  since: Date.now() - 7 * 24 * 60 * 60 * 1000, // Last 7 days
});

console.log(recent);

Key Features

  • Local-First: All data stays on device
  • Cross-App: Multiple apps can share the same memory
  • Privacy-Preserving: User controls all access
  • Simple Format: JSONL (JSON Lines) for easy parsing
  • Platform-Native: Uses iOS Files app and Android storage
  • Open Standard: Any developer can implement

Platform Support

  • Architecture: Arm64 (arm64-v8a) - optimized for modern mobile devices
  • iOS: Via Files app with security-scoped bookmarks
  • Android: Via standard Documents folder or Storage Access Framework
  • React Native: Reference implementation provided (Expo SDK)
  • Native: Implement the spec in Swift/Kotlin
  • AI Framework: Cactus SDK for on-device inference (Qwen 3 - 0.6B)

Documentation

Development

Build Configuration

The project is configured to build for Arm64 architecture (arm64-v8a):

// eas.json
{
  "build": {
    "preview": {
      "android": {
        "buildType": "apk",
        "env": {
          "ANDROID_ABI_FILTERS": "arm64-v8a"
        }
      }
    }
  }
}

This ensures the APK runs on modern Arm-based Android devices and leverages Arm-optimized AI inference via Cactus SDK.

Build SDK

cd sdk
npm install
npm run build

Build Android APK

eas build --profile preview --platform android

Run Example App

npm start

Contributing

This is an open standard. Contributions welcome:

  1. Protocol improvements (submit proposals)
  2. SDK enhancements
  3. Platform implementations (Swift, Kotlin, etc.)
  4. Example applications
  5. Documentation improvements

License

This project uses a dual-license approach:

  • Protocol Specification (spec/): CC0 1.0 Universal (Public Domain)

    • The protocol specification is freely usable by anyone without restrictions
    • Encourages maximum adoption and implementation across the ecosystem
  • Reference Implementation (sdk/, app/): MIT License

    • The code implementation requires attribution but is freely usable
    • Compatible with commercial and open-source projects

Roadmap

  • Protocol specification v1.0
  • TypeScript/React Native SDK
  • Example chat application
  • Example notes application
  • Swift SDK for native iOS
  • Kotlin SDK for native Android
  • Embedding/vector search support
  • Encryption helpers
  • Protocol v2.0 (compression, archival)

About

Edge Memory Protocol (EMP) v1.0, demonstrated in example React Native app. Built for hackathon 🌡 see spec and SDK folder in repo for details (maybe coming soon to NPM? Let us know your feedback)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published