feat: add memory system frontend components and settings UI#801
feat: add memory system frontend components and settings UI#801inoribea wants to merge 1 commit intomoeru-ai:mainfrom
Conversation
Summary of ChangesHello @inoribea, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the AIRI application by integrating a robust memory system. It provides users with a dedicated settings interface to control both short-term and long-term memory functionalities, allowing for detailed configuration of storage providers, embedding services, and message retention policies. This feature aims to improve context continuity and semantic search capabilities within the application. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive memory system with frontend components and a settings UI. The implementation is well-structured, utilizing a Pinia store for state management and breaking down the UI into logical, reusable Vue components. The new memory.ts store is particularly robust, handling configuration from environment variables for multiple providers, which is a great feature for deployability. I've identified a few minor issues in the Vue components, primarily related to template syntax and CSS classes, and have provided suggestions for fixes. Overall, this is a solid feature addition.
| v-model="longTermQdrantApiKey" | ||
| type="password" | ||
| class="w-full border border-neutral-200 rounded-md bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900" | ||
| placeholder="{{ t('settings.memory.long_term.qdrantApiKeyPlaceholder', 'Optional if public instance') }}" |
There was a problem hiding this comment.
The placeholder attribute is using mustache syntax {{ ... }} which is not valid for attribute values in Vue templates. This will result in the literal string {{ ... }} being displayed as the placeholder. You should use v-bind: or its shorthand : to bind the result of the t() function.
This issue also occurs on:
- line 276:
placeholder="{{ t('settings.memory.long_term.userIdPlaceholder', 'e.g. airi@home') }}" - line 323:
placeholder="{{ t('settings.memory.long_term.searchPlaceholder', 'What should AIRI remember...') }}"
:placeholder="t('settings.memory.long_term.qdrantApiKeyPlaceholder', 'Optional if public instance')"
| {{ t('settings.memory.long_term.promoteAssistant', 'Persist assistant messages automatically') }} | ||
| </span> | ||
| </label> | ||
| <label class="items中心 flex gap-3 border border-neutral-200 rounded-lg bg-neutral-50 px-3 py-3 dark:border-neutral-800 dark:bg-neutral-900/70"> |
There was a problem hiding this comment.
| <input | ||
| v-model="userId" | ||
| type="text" | ||
| class="w-full border border-neutral-200 rounded-md bg-white px-3 py-2 text-sm dark-border-neutral-700 dark:bg-neutral-900" |
There was a problem hiding this comment.
The class dark-border-neutral-700 is not a valid Tailwind CSS class for dark mode. The correct syntax is dark:border-neutral-700. This will ensure the border color is applied correctly in dark mode. This issue is repeated in several places in this file (e.g., lines 321, 327, 335, 340, 347, 355, and 365).
class="w-full border border-neutral-200 rounded-md bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"
| function handleToggle(value: boolean) { | ||
| enabledShortTerm.value = value | ||
| } |
There was a problem hiding this comment.
The handleToggle function is redundant. v-model="enabledShortTerm" on the <input> element (line 37) already provides two-way data binding, which updates the enabledShortTerm ref automatically. This function can be removed, along with the corresponding @change handler on line 40, to simplify the component.
| <input | ||
| v-model="enabledShortTerm" | ||
| type="checkbox" | ||
| class="h-5 w-5 accent-primary-500" | ||
| @change="handleToggle(enabledShortTerm)" | ||
| > |
There was a problem hiding this comment.
Summary
This PR adds memory system frontend components and settings UI to allow users to configure and manage memory settings in the AIRI application.
Details
Testing