Skip to content

Sync Protocol (UUIDs), HiRAG Foundation & CI Fixes#29

Merged
iberi22 merged 1 commit into
mainfrom
sync-protocol-uuid-hirag-v2
Nov 25, 2025
Merged

Sync Protocol (UUIDs), HiRAG Foundation & CI Fixes#29
iberi22 merged 1 commit into
mainfrom
sync-protocol-uuid-hirag-v2

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This PR implements the "Sync & Privacy" feature requested in the roadmap and fixes CI issues.

Key Changes

  1. Sync Protocol (LWW + UUIDs):

    • Introduced a SyncManager that handles exporting/importing encrypted snapshots.
    • Encryption: Uses AES-256-GCM via package:cryptography.
    • Conflict Resolution: Uses Last-Write-Wins (LWW) based on modifiedAt timestamps.
    • Identity: Added uuid to MemoryNode and MemoryEdge to ensure correct merging across devices (fixing the potential data corruption issue of using local IDs).
  2. HiRAG Foundation:

    • Added layer property to nodes.
    • Implemented HierarchicalMemoryGraph extension to allow creating summary nodes (Child -> Summary relation).
  3. Dependency Hell Resolution:

    • Navigated a conflict between isar_generator (requires old source_gen) and modern objectbox_generator/json_serializable.
    • Successfully generated code for Isar, ObjectBox, and JSON serialization.
  4. CI & Testing:

    • Fixed isar_agent_memory_tests failing to find isar.dll by ensuring isar_flutter_libs is present.
    • Added unit tests for encryption and integration tests for the sync flow.

Verification

  • dart test passed for encryption service.
  • flutter test passed for sync integration (export -> clear -> import -> verify).
  • isar and objectbox generated files are present and correct.

PR created automatically by Jules for task 6694733581578485995 started by @iberi22

- **Sync & Privacy**:
  - Added `cryptography` package for AES-GCM encryption.
  - Implemented `SyncManager` with `exportEncryptedSnapshot` and `importEncryptedSnapshot`.
  - Updated `MemoryNode` and `MemoryEdge` schemas to include:
    - `uuid` (Globally Unique Identifier, indexed).
    - `modifiedAt` (Last modification timestamp for LWW).
    - `version`, `deviceId`, `isDeleted`.
  - Fixed critical sync flaw by using `uuid` for matching records across devices instead of local `id`.
  - Added `EncryptionService` unit tests and `SyncManager` integration tests.

- **HiRAG (Hierarchical RAG)**:
  - Added `layer` field to `MemoryNode` to support hierarchical knowledge.
  - Created `HierarchicalMemoryGraph` extension with `createSummaryNode` and `getNodesByLayer`.

- **Build & Dependencies**:
  - Resolved complex dependency conflicts between `isar_generator`, `objectbox_generator`, and `json_serializable` by using a two-phase build process and manual `source_gen` overrides where necessary.
  - Fixed `isar_agent_memory_tests` CI configuration by adding missing `isar_flutter_libs` dependency.

- **Documentation**:
  - Updated README with "Sync & Privacy (Beta)" guide and HiRAG roadmap status.
@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 25, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@iberi22 iberi22 marked this pull request as ready for review November 25, 2025 02:59
@iberi22 iberi22 merged commit d7b5a9a into main Nov 25, 2025
5 of 7 checks passed
@iberi22 iberi22 deleted the sync-protocol-uuid-hirag-v2 branch November 25, 2025 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant