Skip to content

Privacy-first semantic general purpose memory system with on-device AI for intelligent form assistance

Notifications You must be signed in to change notification settings

TensorCraft/Memora

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Semantic Memory Extension

A powerful Chrome extension that enables intelligent semantic memory storage and retrieval using AI technology. The extension analyzes web page form fields and provides contextually relevant memory suggestions to enhance your browsing and form-filling experience.

Extension Demo

๐ŸŒŸ Features

Core Functionality

  • ๐Ÿง  Semantic Memory Storage: Store and organize textual memories with vector embeddings for intelligent retrieval
  • ๐Ÿ” Smart Form Analysis: Automatically analyze form fields on web pages and suggest relevant stored memories
  • ๐ŸŽฏ Contextual Suggestions: Get AI-powered suggestions based on form field context and your stored memories
  • ๐Ÿ“Š Similarity Scoring: Advanced cosine similarity matching to find the most relevant memories

AI Integration

  • ๐Ÿ”ง Chrome Built-in AI: Leverage Chrome's experimental on-device AI capabilities
  • ๐ŸŒ OpenRouter Support: Integrate with OpenRouter for access to various LLM models
  • ๐Ÿ“ฑ Smart Fallback: Automatic fallback from Chrome AI to OpenRouter when needed
  • โšก Real-time Processing: Fast vector similarity computation with WebGPU acceleration

User Experience

  • ๐ŸŽจ Modern Interface: Clean, intuitive popup and dashboard interfaces
  • ๐ŸŒ™ Theme Support: Light, dark, and auto theme modes
  • ๐Ÿ“‹ Easy Management: Comprehensive dashboard for memory management and settings
  • ๐Ÿ’ฌ AI Chat: Interactive AI assistant for natural language memory operations

Privacy & Performance

  • ๐Ÿ”’ Local Processing: Optional local-only mode with Chrome's on-device AI
  • โšก WebGPU Acceleration: Hardware-accelerated vector operations for fast similarity search
  • ๐Ÿ—„๏ธ Efficient Storage: IndexedDB-based storage with namespace organization
  • ๐Ÿ”„ Import/Export: Easy data portability with JSON import/export

๐Ÿš€ Installation

Manual Installation (Development)

  1. Clone this repository:

    git clone https://github.com/Tensorcraft/Memora.git
    cd Memora
  2. Enable Developer Mode in Chrome:

    • Open chrome://extensions/
    • Toggle "Developer mode" in the top right
  3. Load the extension:

    • Click "Load unpacked"
    • Select the project directory

๐Ÿ”ง Setup & Configuration

Chrome Built-in AI (Recommended)

For the best privacy and performance, enable Chrome's experimental AI features:

  1. Update Chrome: Ensure you have Chrome 127 or newer
  2. Enable AI Features:
    • Open chrome://flags/
    • Search for "Optimization Guide On Device Model"
    • Set to "Enabled BypassPerfRequirement"
    • Restart Chrome
  3. Download Model: The extension will guide you through downloading the AI model on first use

OpenRouter Integration (Alternative)

For broader model access or if Chrome AI is unavailable:

  1. Get API Key: Sign up at OpenRouter and get your API key
  2. Configure Extension:
    • Right-click the extension icon โ†’ Options
    • Go to Settings tab
    • Enter your OpenRouter API key
    • Select your preferred model

๐Ÿ“– Usage

Basic Workflow

  1. Visit a webpage with form fields
  2. Click the extension icon to analyze the page
  3. Review suggestions for relevant stored memories
  4. Copy or use the suggested content

Managing Memories

  1. Open Dashboard: Right-click extension icon โ†’ Options
  2. Add Memories: Click "New Memory" or import from files
  3. Organize: Use namespaces to categorize your memories
  4. Search: Use text or semantic search to find specific memories

AI Chat Assistant

  1. Open the dashboard and expand the AI chat panel
  2. Natural commands like:
    • "Add a memory about my work address"
    • "Find memories related to customer support"
    • "Delete memories about old projects"

โš™๏ธ Configuration Options

AI Providers

  • Chrome Built-in AI: Local, private, fast
  • OpenRouter: Cloud-based, multiple models available

Privacy Settings

  • Local Privacy Mode: Forces all processing to use local AI only
  • Per-feature Providers: Configure different AI providers for different features

Performance Settings

  • Top-K Results: Number of similar memories to retrieve (default: 10)
  • Similarity Threshold: Minimum similarity score for relevance (default: 0.1)
  • WebGPU Acceleration: Hardware acceleration for vector operations

Import/Export

  • JSON Format: Standard export format for backup and sharing
  • Text Files: Import documents as chunked memories
  • Images: Basic image reference support (OCR coming soon)

๐Ÿ—๏ธ Technical Architecture

Core Components

src/
โ”œโ”€โ”€ core/                 # Core constants and utilities
โ”œโ”€โ”€ ai/                   # AI provider implementations
โ”‚   โ”œโ”€โ”€ chrome-ai-manager.js      # Chrome AI status management
โ”‚   โ”œโ”€โ”€ chrome-builtin-provider.js # Chrome AI integration
โ”‚   โ”œโ”€โ”€ openrouter-provider.js    # OpenRouter API integration
โ”‚   โ””โ”€โ”€ providers.js              # Provider management
โ”œโ”€โ”€ storage/              # Data persistence layer
โ”œโ”€โ”€ content/              # Content script for page analysis
โ”œโ”€โ”€ popup/                # Extension popup interface
โ”œโ”€โ”€ options/              # Settings and dashboard
โ”œโ”€โ”€ ui/                   # Reusable UI components
โ””โ”€โ”€ utils/                # Shared utilities

Key Technologies

  • Vector Embeddings: Text-to-vector conversion for semantic search
  • WebGPU: Hardware acceleration for vector operations
  • IndexedDB: Client-side storage for memories and metadata
  • Chrome Extensions API: Integration with browser functionality
  • ES6 Modules: Modern JavaScript module system

Data Flow

  1. Content Analysis: Content script extracts form field information
  2. Vector Generation: AI provider converts text to embeddings
  3. Similarity Search: Vector comparison to find relevant memories
  4. Result Presentation: Ranked results displayed in popup

๐Ÿ› ๏ธ Development

Prerequisites

  • Chrome 127+ (for built-in AI features)
  • Node.js 16+ (for development tools)
  • Git

Development Setup

# Clone and setup
git clone https://github.com/Tensorcraft/Memora
cd Memora

# Install development dependencies (if any)
npm install

# Load extension in Chrome
# 1. Open chrome://extensions/
# 2. Enable Developer mode
# 3. Click "Load unpacked" and select this directory

Project Structure

โ”œโ”€โ”€ manifest.json         # Extension manifest
โ”œโ”€โ”€ background.js          # Service worker
โ”œโ”€โ”€ content.js            # Content script entry
โ”œโ”€โ”€ popup.html            # Popup interface
โ”œโ”€โ”€ options.html          # Options/dashboard page
โ”œโ”€โ”€ src/                  # Source code modules
โ”œโ”€โ”€ docs/                 # Documentation
โ””โ”€โ”€ README.md             # This file

Testing

  • Manual Testing: Load the extension and test on various websites
  • Chrome DevTools: Use console for debugging
  • Extension DevTools: Monitor background script and content scripts

๐Ÿ“š API Reference

Chrome AI Manager

import { getChromeAIManager } from './src/ai/chrome-ai-manager.js';

const manager = getChromeAIManager();
await manager.init();
const status = manager.status; // 'ready', 'downloading', etc.

Memory Operations

// Add memory
const response = await chrome.runtime.sendMessage({
  action: 'ADD_MEMORY',
  text: 'My important information',
  namespace: 'work',
  metadata: { type: 'contact' }
});

// Retrieve memories
const response = await chrome.runtime.sendMessage({
  action: 'RETRIEVE_MEMORIES',
  query: 'contact information',
  topK: 5
});

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Guidelines

  1. Follow the existing code style and architecture patterns
  2. Write clear commit messages describing your changes
  3. Test thoroughly on multiple websites and scenarios
  4. Update documentation for any API or feature changes

Bug Reports

Please use the GitHub Issues to report bugs with:

  • Steps to reproduce
  • Expected vs actual behavior
  • Chrome version and extension version
  • Console error messages (if any)

Feature Requests

We're open to new ideas! Please open an issue to discuss feature requests before implementing.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ”ฎ Roadmap

Upcoming Features

  • OCR Support: Extract text from images for memory storage
  • Multi-language Support: Internationalization for global users
  • Advanced Filtering: More sophisticated memory organization
  • Cloud Sync: Optional cloud storage for memory synchronization
  • Browser Import: Import bookmarks and browsing history as memories
  • API Integration: Connect with popular note-taking and CRM tools

Performance Improvements

  • Incremental Indexing: Faster memory updates and additions
  • Compression: Optimize storage space usage
  • Caching: Improve response times for frequent queries

๐Ÿ“ž Support

๐Ÿ™ Acknowledgments

  • Chrome Team: For the experimental AI APIs
  • OpenRouter: For providing access to various LLM models
  • WebGPU Community: For hardware acceleration capabilities
  • Open Source Community: For inspiration and foundations

Built with โค๏ธ by Tensorcraft

Enhance your browsing experience with intelligent semantic memory!

About

Privacy-first semantic general purpose memory system with on-device AI for intelligent form assistance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published