Skip to content

Create PMLLarchitecture.js - #1

Open
Hellebore wants to merge 1 commit into
base-sha/8848a2a69a32b85ca2ca186a334cb15a1a8fe9bbfrom
head-sha/ab6a7cd0e89631937a1e7d82d122ae86ad56a6d9/2025-05-02T11-38-41/c20b86
Open

Create PMLLarchitecture.js#1
Hellebore wants to merge 1 commit into
base-sha/8848a2a69a32b85ca2ca186a334cb15a1a8fe9bbfrom
head-sha/ab6a7cd0e89631937a1e7d82d122ae86ad56a6d9/2025-05-02T11-38-41/c20b86

Conversation

@Hellebore

@Hellebore Hellebore commented May 2, 2025

Copy link
Copy Markdown

what I have been figuring out inside Java with Claude to make some true persistent memroy architecture inside LLMs

@coderabbitai

Summary by Sourcery

Create a comprehensive memory architecture for language models, implementing a multi-tier memory system with advanced semantic tracking and compression capabilities

New Features:

  • Implemented a three-tier memory management system (Volatile Short-Term, Persistent Long-Term, Context/Working Memory)
  • Added semantic embedding and similarity tracking
  • Developed memory compression and redundancy detection mechanisms
  • Created advanced memory tracing and generation lineage tracking

Enhancements:

  • Implemented dynamic memory importance calculation
  • Added sophisticated relationship tracking between memories
  • Created semantic similarity detection for memory compression
  • Developed multi-dimensional memory classification system

Chores:

  • Refactored memory management classes
  • Added comprehensive logging and metrics tracking

Summary by CodeRabbit

  • New Features
    • Introduced an advanced memory management system for efficient content storage and retrieval.
    • Enhanced user experience with intelligent prioritization and semantic search, ensuring more relevant content is surfaced.
    • Improved system performance through automated memory optimization techniques, including compression and redundancy checks.

what I have been figuring out inside Java with Claude to make some true persistent memroy architecture inside LLMs

Signed-off-by: J. K. Edwards <joed6834@colorado.edu>
@Hellebore

Copy link
Copy Markdown
Author

This is a benchmark review for experiment bakeoff.
Run ID: bakeoff/benchmark_2025-05-02T11-38-04_v1-36-0-dirty.

This pull request was cloned from https://github.com/bearycool11/AI_memory_Loops/pull/142. (Note: the URL is not a link to avoid triggering a notification on the original pull request.)

Experiment configuration
review_config:
  # User configuration for the review
  # - benchmark - use the user config from the benchmark reviews
  # - <value> - use the value directly
  user_review_config:
    enable_ai_review: true
    enable_rule_comments: false

    enable_complexity_comments: benchmark
    enable_security_comments: benchmark
    enable_tests_comments: benchmark
    enable_comment_suggestions: benchmark

    enable_pull_request_summary: benchmark
    enable_review_guide: benchmark

    enable_approvals: false
    base_branches: [base-sha.*]

  ai_review_config:
    # The model responses to use for the experiment
    # - benchmark - use the model responses from the benchmark reviews
    # - llm - call the language model to generate responses
    model_responses:
      comments_model: benchmark
      comment_validation_model: benchmark
      comment_suggestion_model: benchmark
      complexity_model: benchmark
      security_model: benchmark
      tests_model: benchmark
      pull_request_summary_model: benchmark
      review_guide_model: benchmark
      overall_comments_model: benchmark

# The pull request dataset to run the experiment on
pull_request_dataset:
# CodeRabbit
- https://github.com/neerajkumar161/node-coveralls-integration/pull/5
- https://github.com/gunner95/vertx-rest/pull/1
- https://github.com/Altinn/altinn-access-management-frontend/pull/1427
- https://github.com/theMr17/github-notifier/pull/14
- https://github.com/bearycool11/AI_memory_Loops/pull/142

# Greptile
- https://github.com/gumloop/guMCP/pull/119
- https://github.com/autoblocksai/python-sdk/pull/335
- https://github.com/grepdemos/ImageSharp/pull/6
- https://github.com/grepdemos/server/pull/61
- https://github.com/websentry-ai/pipelines/pull/25

# Graphite
- https://github.com/KittyCAD/modeling-app/pull/6648
- https://github.com/KittyCAD/modeling-app/pull/6628
- https://github.com/Varedis-Org/AI-Test-Repo/pull/2
- https://github.com/deeep-network/bedrock/pull/198
- https://github.com/Metta-AI/metta/pull/277

# Copilot
- https://github.com/hmcts/rpx-xui-webapp/pull/4438
- https://github.com/ganchdev/quez/pull/104
- https://github.com/xbcsmith/ymlfxr/pull/13
- https://github.com/tinapayy/B-1N1T/pull/36
- https://github.com/coder/devcontainer-features/pull/6

# Questions to ask to label the review comments
review_comment_labels: []
# - label: correct
#   question: Is this comment correct?

# Benchmark reviews generated by running
#   python -m scripts.experiment benchmark <experiment_name>
benchmark_reviews: []

@Hellebore

Copy link
Copy Markdown
Author

Reviewer's Guide

This pull request introduces a new JavaScript file, PMLLarchitecture.js, which implements a multi-tiered persistent memory architecture. It defines classes for memory items (MemoryItem), memory tiers (MemoryTier with volatile, persistent, and context types), and a central MemoryManager to orchestrate operations. The implementation includes semantic embedding generation (SemanticEmbedding) for retrieval, relationship tracking between memories, dynamic importance scoring, and memory tracing/compression features (MemoryTracer). Note that several classes appear to be defined multiple times within the file.

File-Level Changes

Change Details Files
Introduced core classes for the multi-tiered memory architecture.
  • Defined MemoryItem to represent individual memory units with metadata (type, factualness, importance, timestamp, relationships).
  • Defined MemoryTier to represent different memory levels (volatile, persistent, context) with capacity and pruning logic.
  • Defined MemoryManager to manage memory tiers, handle insertion/retrieval, and orchestrate other components.
PMLLarchitecture.js
Implemented semantic search and memory management features.
  • Added SemanticEmbedding class structure for generating and comparing text embeddings (using placeholders for external libraries).
  • Implemented retrieval logic based on semantic similarity.
  • Added mechanisms for tracking access counts and updating memory importance.
  • Implemented basic relationship tracking between memory items.
PMLLarchitecture.js
Added memory tracing and compression capabilities.
  • Introduced MemoryTracer class to log memory generation, track access, detect redundancy based on semantic similarity, and perform compression.
  • Integrated MemoryTracer into MemoryManager to automate tracking and enable compression operations.
PMLLarchitecture.js
Included conceptual definitions and example usage.
  • Added a large JSON-like object (architectureComponents) defining the conceptual structure, characteristics, and operations of the memory system.
  • Included lists of perceived strengths and challenges.
  • Provided example code demonstrating the usage of the implemented classes.
PMLLarchitecture.js

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@Hellebore Hellebore left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Hellebore - I've reviewed your changes - here's some feedback:

  • Consider removing the duplicate class definitions (e.g., MemoryItem, MemoryManager, MemoryTracer) to keep only the intended implementation.
  • Consider moving the conceptual architecture description (architectureComponents, strengths, challenges) into separate design documentation rather than keeping it in the implementation file.
  • Consider splitting this large file into smaller modules, each focused on a specific component (e.g., tiers, items, manager, tracer, embedding).
Here's what I looked at during the review
  • 🟡 General issues: 3 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Documentation: all looks good

LangSmith trace

Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread PMLLarchitecture.js
@@ -0,0 +1,921 @@
// Simplified Memory Item

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Duplicate MemoryItem definitions detected.

Merge the two MemoryItem definitions into a single class to improve maintainability and avoid ambiguity.

Suggested implementation:

If any unique methods or properties exist in the duplicate MemoryItem definition, you need to merge them into the first MemoryItem definition (the one starting at the top of the file). Make sure you consolidate any differences so that the single class covers all required functionality.

Comment thread PMLLarchitecture.js
}
}

// Memory Manager

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: MemoryManager is defined multiple times.

Merge the overlapping MemoryManager implementations or split tracing and core management into separate modules to reduce confusion and streamline future updates.

Suggested implementation:

// Core Memory Manager
class CoreMemoryManager {

If there is another implementation of MemoryManager elsewhere in the file (or in the project) that provides tracing functionality, please move that implementation into its own module (for example, tracingMemoryManager.js) and update its class name and usage accordingly. Also review and update any instantiation of MemoryManager to reference CoreMemoryManager or the new module, as appropriate.

Comment thread PMLLarchitecture.js

module.exports = { MemoryManager, MemoryItem, MemoryTier };

class MemoryTracer {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Memory tracing code appears redundant.

Consolidate the two MemoryTracer implementations into one to eliminate redundancy and simplify maintenance while retaining memory tracking and compression functionality.

Suggested implementation:

module.exports = { MemoryManager, MemoryItem, MemoryTier, MemoryTracer };

Review the file for any additional duplicate implementations of the MemoryTracer class. Remove any extra copies so that only the consolidated MemoryTracer (with both generationLog and redundancyMap alongside compressionMetrics) remains.

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