SkillAgentSearch skills...

Tostore

Fast distributed AI vector database and persistent local storage engine. High-performance key-value store supporting SQL, NoSQL, offline cache and encrypted data.

Install / Use

/learn @tocreator/Tostore
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<h1 align="center"> <img src="doc/resource/logo-tostore.svg" width="400" alt="ToStore"> </h1> <p align="center"> <a href="https://pub.dev/packages/tostore"><img src="https://img.shields.io/pub/v/tostore.svg" alt="pub package"></a> <a href="https://pub.dev/packages/tostore/score"><img src="https://img.shields.io/pub/points/tostore.svg" alt="Pub Points"></a> <a href="https://pub.dev/packages/tostore/likes"><img src="https://img.shields.io/pub/likes/tostore.svg" alt="Pub Likes"></a> <a href="https://pub.dev/packages/tostore"><img src="https://img.shields.io/pub/dm/tostore.svg" alt="Monthly Downloads"></a> </p> <p align="center"> <a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg" alt="License"></a> <a href="https://pub.dev/packages/tostore"><img src="https://img.shields.io/badge/Platform-Multi--Platform-02569B?logo=dart" alt="Platform"></a> <img src="https://img.shields.io/badge/Architecture-Neural--Distributed-orange" alt="Architecture"> </p> <p align="center"> English | <a href="doc/translations/README.zh-CN.md">简体中文</a> | <a href="doc/translations/README.ja.md">日本語</a> | <a href="doc/translations/README.ko.md">한국어</a> | <a href="doc/translations/README.es.md">Español</a> | <a href="doc/translations/README.pt-BR.md">Português (Brasil)</a> | <a href="doc/translations/README.ru.md">Русский</a> | <a href="doc/translations/README.de.md">Deutsch</a> | <a href="doc/translations/README.fr.md">Français</a> | <a href="doc/translations/README.it.md">Italiano</a> | <a href="doc/translations/README.tr.md">Türkçe</a> </p>

Quick Navigation

<a id="why-tostore"></a>

Why Choose ToStore?

ToStore is a modern data engine designed for the AGI era and edge intelligence scenarios. It natively supports distributed systems, multi-modal fusion, relational structured data, high-dimensional vectors, and unstructured data storage. Based on a neural-network-like underlying architecture, nodes possess high autonomy and elastic horizontal scalability, building a flexible data topology network for seamless edge-cloud cross-platform collaboration. It features ACID transactions, complex relational queries (JOIN, cascading foreign keys), table-level TTL, and aggregate computations. It includes multiple distributed primary key algorithms, atomic expressions, schema change identification, encryption protection, multi-space data isolation, resource-aware intelligent load scheduling, and disaster/crash self-healing recovery.

As computing continues to shift toward edge intelligence, various terminals such as agents and sensors are no longer mere "content displays" but intelligent nodes responsible for local generation, environmental perception, real-time decision-making, and data collaboration. Traditional database solutions, limited by their underlying architecture and "plug-in" extensions, struggle to meet the low-latency and stability requirements of edge-cloud intelligent applications when facing high-concurrency writes, massive data, vector retrieval, and collaborative generation.

ToStore empowers the edge with distributed capabilities sufficient to support massive data, complex local AI generation, and large-scale data flow. Deep intelligent collaboration between edge and cloud nodes provides a reliable data foundation for scenarios such as immersive AR/VR fusion, multi-modal interaction, semantic vectors, and spatial modeling.

<a id="key-features"></a>

Key Features

  • 🌐 Unified Cross-Platform Data Engine

    • Unified API for Mobile, Desktop, Web, and Server.
    • Supports relational structured data, high-dimensional vectors, and unstructured data storage.
    • Ideal for data lifecycles from local storage to edge-cloud collaboration.
  • 🧠 Neural-Network-Like Distributed Architecture

    • High node autonomy; interconnected collaboration builds flexible data topologies.
    • Supports node collaboration and elastic horizontal scalability.
    • Deep interconnection between edge intelligent nodes and the cloud.
  • Parallel Execution & Resource Scheduling

    • Resource-aware intelligent load scheduling with high availability.
    • Multi-node parallel collaborative computing and task decomposition.
  • 🔍 Structured Query & Vector Retrieval

    • Supports complex condition queries, JOINs, aggregate computations, and table-level TTL.
    • Supports vector fields, vector indexes, and Approximate Nearest Neighbor (ANN) search.
    • Structured and vector data can be used collaboratively within the same engine.
  • 🔑 Primary Keys, Indexing & Schema Evolution

    • Built-in Sequential Increment, Timestamp, Date-Prefix, and Short Code PK algorithms.
    • Supports unique indexes, composite indexes, vector indexes, and foreign key constraints.
    • Intelligently identifies schema changes and automates data migration.
  • 🛡️ Transactions, Security & Recovery

    • Provides ACID transactions, atomic expression updates, and cascading foreign keys.
    • Supports crash recovery, persistent flush, and data consistency guarantees.
    • Supports ChaCha20-Poly1305 and AES-256-GCM encryption.
  • 🔄 Multi-Space & Data Workflow

    • Supports data isolation via Spaces with configurable global sharing.
    • Real-time query listeners, multi-level intelligent caching, and cursor pagination.
    • Perfect for multi-user, local-first, and offline-collaborative applications.

<a id="installation"></a>

Installation

[!IMPORTANT] Upgrading from v2.x? Please read the v3.x Upgrade Guide for critical migration steps and breaking changes.

Add tostore as a dependency in your pubspec.yaml:

dependencies:
  tostore: any # Please use the latest version

<a id="quick-start"></a>

Quick Start

[!IMPORTANT] Defining table schema is the first step: You must define the table schema before performing CRUD operations (unless using only KV storage). The specific definition method depends on your scenario:

// 1. Initialize the database
final db = await ToStore.open();

// 2. Insert data
await db.insert('users', {
  'username': 'John',
  'email': 'john@example.com',
  'age': 25,
});

// 3. Chained queries (see [Query Operators](#query-operators); supports =, !=, >, <, LIKE, IN, etc.)
final users = await db.query('users')
    .where('age', '>', 20)
    .where('username', 'like', '%John%')
    .orderByDesc('age')
    .limit(20);

// 4. Update and Delete
await db.update('users', {'age': 26}).where('username', '=', 'John');
await db.delete('users').where('username', '=', 'John');

// 5. Real-time Listening (UI updates automatically when data changes)
db.query('users').where('age', '>', 18).watch().listen((users) {
  print('Matching users updated: $users');
});

Key-Value Storage (KV)

Suitable for scenarios that do not require structured tables. Simple and practical, featuring a built-in high-performance KV store for configuration, status, and other scattered data. Data in different Spaces is isolated by default but can be set for global sharing.

// Initialize the database
final db = await ToStore.open();

// Set key-value pairs (supports String, int, bool, double, Map, List, etc.)
await db.setValue('theme', 'dark');
await db.setValue('login_attempts', 3);

// Get data
final theme = await db.getValue('theme'); // 'dark'

// Remove data
await db.removeValue('theme');

// Global key-value (shared across Spaces)
// Default KV data becomes inactive after switching spaces. Use isGlobal: true for global sharing.
await db.setValue('app_version', '1.0.0', isGlobal: true);
final version = await db.getValue('app_version', isGlobal: true);

<a id="schema-definition"></a>

Schema Definition

The following mobile and server-side examples reuse appSchemas defined here.

TableSchema Overview

const userSchema = TableSchema(
  name: 'users', // Table name, required
  tableId: 'users', // Unique identifier, optional; used for 100% accurate rename detection
  primaryKeyConfig: PrimaryKeyConfig(
    name: 'id', // PK field name, defaults to 'id'
    type: PrimaryKeyType.sequential, // Auto-generation type
    sequentialConfig: SequentialIdConfig(
      initialValue: 1000, // Starting value
      increment: 1, // Step size
      useRandomIncrement: false, // Whether to use random increments
    ),
  ),
  fields: [
    FieldSchema(
      name: 'username', // Field name, required
      type: DataType.text, // Data type, required
      nullable: false, // Whether null is allowed
      minLength: 3, // Min length
      maxLength: 32, // Max length
      unique: true, // Unique constraint
      fieldId: 'username', // Field unique identifier, optional; for identify renames
      comment: 'Login name', // Optional comment
    ),
    FieldSchema(
 

Related Skills

View on GitHub
GitHub Stars50
CategoryData
Updated14h ago
Forks6

Languages

Dart

Security Score

100/100

Audited on Mar 28, 2026

No findings