Commit Graph

12 Commits

Author SHA1 Message Date
Ke Sun
3efb3e8a35 fix(memory): add Redis session validation
- Add macOS fork() safety configuration in celery_app.py to prevent initialization issues
- Add null/False checks for Redis session queries in term_memory_save to handle missing sessions gracefully
- Add null/False checks in memory_long_term_storage to prevent processing empty Redis results
- Add null/False checks in aggregate_judgment before format_parsing to avoid errors on missing data
- Initialize redis_messages variable in window_dialogue for consistency
- Add debug logging when no existing session found in Redis for better troubleshooting
- Add TODO comments for magic numbers (scope=6, time=5) to be extracted as constants
- Improve error handling when Redis returns False or empty results instead of crashing
2026-02-03 18:50:59 +08:00
Ke Sun
f27de7df35 feat(memory): add long-term storage task routing and batching 2026-02-03 15:52:45 +08:00
Eternity
b471d56a86 fix(prompt): remove hard-coded import of prompt file paths (#279)
* Fix/develop memory bug (#274)

* 遗漏的历史映射

* 遗漏的历史映射

* fix_timeline_memories

* fix(web): update retrieve_type key

* Fix/develop memory bug (#276)

* 遗漏的历史映射

* 遗漏的历史映射

* fix_timeline_memories

* fix_timeline_memories

* write_gragp/bug_fix

* write_gragp/bug_fix

* write_gragp/bug_fix

* chore(celery): disable periodic task scheduling

* fix(prompt): remove hard-coded import of prompt file paths

---------

Co-authored-by: lixinyue11 <94037597+lixinyue11@users.noreply.github.com>
Co-authored-by: zhaoying <yzhao96@best-inc.com>
Co-authored-by: yingzhao <zhaoyingyz@126.com>
Co-authored-by: Ke Sun <kesun5@illinois.edu>
2026-02-03 10:29:51 +08:00
Ke Sun
ccc2009aa8 feat(celery): add dedicated periodic tasks worker and queue (#261) 2026-01-30 15:31:48 +08:00
Ke Sun
c24fb73147 Fix/memory celery fix (#168)
* refactor(celery): optimize task routing and worker configuration

- Simplify Celery queue configuration with single default 'io_tasks' queue
- Implement task routing strategy separating IO-bound and CPU-bound tasks
- Add Flower monitoring support with task event tracking enabled
- Add summary node search optimization to only retrieve summary nodes
- Clean up unused imports and reorganize import statements for consistency
- Update docker-compose configuration to support multi-queue worker setup

* chore(celery): simplify flower configuration and add gevent dependency

* chore(dependencies): add gevent dependency to requirements

- Add gevent==24.11.1 to api/requirements.txt
- Gevent is required for async worker support in Celery
- Complements existing flower and celery configuration

* refactor(celery): simplify async event loop handling and reorganize task queues

- Replace complex nest_asyncio and manual event loop management with asyncio.run() in read_message_task, write_message_task, regenerate_memory_cache, and workspace_reflection_task
- Rename task queues from io_tasks/cpu_tasks to memory_tasks/document_tasks for better semantic clarity
- Update task routing configuration to reflect new queue names for memory agent tasks and document processing tasks
- Remove redundant exception handling comments and simplify error handling logic
- Update README with improved community support section including GitHub Issues, Pull Requests, Discussions, and WeChat community links
- Simplifies event loop management by leveraging asyncio.run() which handles loop creation and cleanup automatically, reducing code complexity and potential race conditions
2026-01-21 17:58:46 +08:00
乐力齐
e8a5cfe7e3 Merge #85 into develop from feature/actr-forget
[feature]actr-记忆遗忘需求开发

* feature/actr-forget: (12 commits squashed)

  - [feature]
    1.Extended fields of the date_config table;
    2.New activation value calculation has been added, and the ACTR parameter has been introduced in Neo4j.

  - [feature]1.Create a forgetting strategy executor;2.Create the forgetting scheduler

  - [feature]Introduce activation values for retrieval, and develop a two-stage retrieval reordering process

  - [feature]
    1.Extended fields of the date_config table;
    2.New activation value calculation has been added, and the ACTR parameter has been introduced in Neo4j.

  - [feature]1.Create a forgetting strategy executor;2.Create the forgetting scheduler

  - [feature]Introduce activation values for retrieval, and develop a two-stage retrieval reordering process

  - Merge branch &#39;feature/actr-forget&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into feature/actr-forget

  - [fix]Eliminate the interference caused by redundant code

  - [feature]
    1.Extended fields of the date_config table;
    2.New activation value calculation has been added, and the ACTR parameter has been introduced in Neo4j.

  - [feature]1.Create a forgetting strategy executor;2.Create the forgetting scheduler

  - [feature]Introduce activation values for retrieval, and develop a two-stage retrieval reordering process

  - Merge branch &#39;feature/actr-forget&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into feature/actr-forget

Signed-off-by: 乐力齐 <accounts_690c7b0af9007d7e338af636@mail.teambition.com>
Reviewed-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>
Merged-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>

CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/85
2026-01-05 04:30:36 +00:00
Ke Sun
48f6fe04a1 Merge remote-tracking branch 'origin/develop' into refactor/memory-config-management 2025-12-23 17:30:09 +08:00
Ke Sun
283c64a358 refactor(memory): restructure memory system and improve configuration management
- Remove deprecated main.py entry point from memory module
- Reorganize imports across controllers and services for consistency
- Update emotion controller to pass db session instead of config_id to services
- Enhance memory agent controller with db session parameter for status_type and user_profile endpoints
- Refactor memory agent service to accept db parameter in classify_message_type method
- Improve configuration handling in celery_app by removing automatic database reload
- Update all memory-related services to use centralized config management
- Standardize import ordering and remove unused imports across 50+ files
- Add pilot_run_service for new pilot execution workflow
- Refactor extraction engine, reflection engine, and search services for better modularity
- Update LLM utilities and embedder configuration for improved flexibility
- Enhance type classifier and verification tools with better error handling
- Improve memory evaluation modules (LOCOMO, LongMemEval, MemSciQA) with consistent patterns
2025-12-23 17:17:04 +08:00
乐力齐
42e569b8e5 Merge #31 into develop from memory-summary
[feature]开发用户记忆详情的接口

* memory-summary: (69 commits squashed)

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - Merge branch &#39;memory-summary&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into memory-summary

  - [feature]Develop the relationship graph interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - Merge branch &#39;memory-summary&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into memory-summary

  - [feature]Develop the end_user/profile interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - [feature]Develop the end_user/profile interface

  - Merge branch &#39;memory-summary&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into memory-summary

  - [updated]Base change operation

  - [refactor]1.Convert timestamp;2.Remove unnecessary code

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - [feature]Develop the end_user/profile interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [feature]Develop the relationship graph interface

  - [feature]Develop the end_user/profile interface

  - [updated]Base change operation

  - [refactor]1.Convert timestamp;2.Remove unnecessary code

  - Merge branch &#39;memory-summary&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into memory-summary

  - [check]check_code.py checks the quality of the code

  - [fix]Fix insecure database connections

  - [refactor]refactor memory_storage_controller and memory_storage_service

  - [add]The /total_memory_count interface returns the &quot;name&quot; field.

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - [feature]Develop the end_user/profile interface

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [feature]Develop the relationship graph interface

  - [feature]Develop the end_user/profile interface

  - [updated]Base change operation

  - [refactor]1.Convert timestamp;2.Remove unnecessary code

  - [feature]Memory Insights and User Summary Cache Storage Ingestion

  - [featrue]Develop a memory classification interface

  - [feature]Develop the relationship graph interface

  - [feature]Develop the end_user/profile interface

  - [updated]Base change operation

  - [refactor]1.Convert timestamp;2.Remove unnecessary code

  - [check]check_code.py checks the quality of the code

  - [fix]Fix insecure database connections

  - [refactor]refactor memory_storage_controller and memory_storage_service

  - [add]The /total_memory_count interface returns the &quot;name&quot; field.

  - Merge branch &#39;memory-summary&#39; of codeup.aliyun.com:redbearai/python/redbear-mem-open into memory-summary

  - [refactor]Reconstruct the user&#39;s memory location

  - add uv.lock

Signed-off-by: 乐力齐 <accounts_690c7b0af9007d7e338af636@mail.teambition.com>
Reviewed-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>
Merged-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>

CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/31
2025-12-23 08:05:06 +00:00
李新月
5c0d8b42f3 Merge #9 into develop from fix/memory_reflection
新增反思功能(功能配置接口+反思celery后台检测反思的迭代周期)

* fix/memory_reflection: (24 commits squashed)

  - 新增反思功能(功能配置接口+反思celery后台检测反思的迭代周期)

  - 新增反思功能(功能配置接口+反思celery后台检测反思的迭代周期)

  - 新增反思功能(检测代码/规范化程序)

  - 新增反思功能(检测代码/规范化程序)

  - 新增反思功能(检测代码/规范化程序)

  - 新增反思功能(检测代码/规范化程序)

  - 新增反思功能(检测代码/规范化程序)

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

  - 反思优化

Signed-off-by: aliyun8644380055 <accounts_68c0f5d519f260d93ee2997e@mail.teambition.com>
Commented-by: aliyun8644380055 <accounts_68c0f5d519f260d93ee2997e@mail.teambition.com>
Commented-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>
Reviewed-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>
Merged-by: aliyun6762716068 <accounts_68cb7c6b61f5dcc4200d6251@mail.teambition.com>

CR-link: https://codeup.aliyun.com/redbearai/python/redbear-mem-open/change/9
2025-12-19 08:04:12 +00:00
Mark
a4e276ab27 [MODIFY] Code optimization 2025-12-15 14:09:43 +08:00
Ke Sun
c1adc62ec6 feat: Add base project structure with API and web components 2025-12-02 20:28:01 +08:00