Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged memdb with choredb #543

Open
wants to merge 15 commits into
base: dev
Choose a base branch
from
Open

Conversation

JegernOUTT
Copy link
Member

No description provided.

This commit deletes the outdated `knowledge.rs` and `mod.rs` files under `src/agent_db`, along with the removal of `agent_db` submodule references. Refactored functionalities are now managed within the newly added `memdb` module. The `memdb` module streamlines database interactions and functions previously managed under `agent_db`. Functions related to pub/sub notifications, vectorization tasks, and memory management are consolidated into `memdb` and its submodules for improved modularity and maintenance efficiency. This includes redefining database schemas, triggers, and event handling to support ongoing system operations and future development.
- Deleted `db_schema_20241102.rs` as it is no longer needed.
- Simplified `db_pubsub.rs` by removing unused imports and functions.
- Updated pubsub channel names in multiple files to match table names.
- Added error handling for chore and chore event settings in `db_chore.rs`.
- Refactored trigger setup in `db_schema.rs` to include new chore event triggers.
@JegernOUTT JegernOUTT self-assigned this Feb 26, 2025
@JegernOUTT JegernOUTT marked this pull request as draft February 26, 2025 04:26
- Remove `vdb_thread.rs` and migrate its code to a dedicated `vectorizer_service.rs`.
- Update module imports to reflect the new organization, removing `vdb_thread` and adding `vectorizer_service`.
- Simplify vectorization initialization by directly using `FileVectorizerService` with centralized functions for enqueuing files and memories.
- Improve error handling during vectorization processes by avoiding panics and using appropriate logging.
- Streamline `VecDb` initialization, background tasks, and file enqueuing logic by better organizing responsibilities between `VecDb` and `FileVectorizerService`.
- Ensure `memdb` is initialized within contexts where it is needed, avoiding potential runtime errors.
- Retain vectorization functionalities while ensuring modular code structure for easier maintenance and clearer API usage.
- Adjust various sections across files in the repo to reflect changes in the vectorization strategy.
…horedb

# Conflicts:
#	refact-agent/engine/src/knowledge.rs
#	refact-agent/engine/src/memdb/db_init.rs
#	refact-agent/engine/src/vecdb/mod.rs
#	refact-agent/engine/src/vecdb/vdb_highlev.rs
- Replace `vec_db_module` with `vectorizer_service` across files for clarity.
- Adjust the logic to handle vectorizer service initialization and usage.
- Ensure background tasks for vectorizer service are started correctly.
- Update import and usage of `memories_add` function from `memdb` module.
- Simplify configuration parameters in vector database initialization functions.
# Conflicts:
#	refact-agent/engine/src/http/routers/v1.rs
- Consolidate vectorization logic by eliminating feature flag checks for vecdb and refactoring related functions.
- Use consistent naming for VectorizerService and VecDb across the codebase.
- Enhance concurrency safety by using appropriate Arc and Mutex types consistently across modules.
- Simplify control flow for various components to manage memory and vectorization tasks more efficiently.
- Optimize initialization and background task startup for memory database (memdb) and vector database (vecdb), ensuring tasks are correctly enqueued and processed.
- Remove unused index creation code from memdb schema.
- Ensure consistent use of async/await for asynchronous operations.
- Refactor duplicated code for initializing and checking services into shared utility functions where possible.
- Remove unnecessary memdb initialization checks and related error handling code to streamline the codebase.
- Refactor `vecdb` initialization logic, renaming `vecdb_background_reload` to `vecdb_init` to align with its functionality.
- Eliminate redundancy by removing `vecdb_constants` from memdb structures, consolidating constant access.
- Clean up background task management by removing obsolete components related to `vecdb`.
- Update relevant sections to directly access cloned versions of `memdb` without additional option handling.
- Optimize the shutdown process by making `memdb_sleeping_point` a direct part of the graceful shutdown procedure.
- Remove conditional VecDb initialization from 'global_context.rs'.
- Modify 'vecdb_init.rs' to return a BackgroundTasksHolder.
- Add vectorization tasks handling in VecDb initialization.
- Update 'background_tasks.rs' to include vecdb background reload task.
- Change visibility of 'MessageToVecdbThread' in 'vectorizer_service.rs'.
- Adjust 'vectorizer_service_init_and_start' to return task handles.
- Refactor error handling in 'vecdb.rs' for clarity.
- Simplify vector database reloading logic in 'vdb_highlev.rs' and manage background tasks.
@JegernOUTT JegernOUTT changed the base branch from main to dev April 2, 2025 06:16
@JegernOUTT JegernOUTT marked this pull request as ready for review April 2, 2025 06:17
- Rename and encapsulate low-level SQL update and insert operations within their respective set functions.
- Remove redundant TODO comments and improve code organization.
- Clean up and standardize redundant clone operations.
- Ensure consistent formatting and indentation in SQL string literals.
…module

- Extract `_cthread_set_lowlevel` logic into `cthread_set_lowlevel` function for better clarity.
- Move `merge_json` function from `mod.rs` to a new `db_utils.rs` module, improving code organization.
- Update imports of `merge_json` across relevant files to use the new location.
- Enhance error logging in subscription handling functions for better debugging.
Correct 'subsription' to 'subscription' in function names and calls. Update field names from 'pubevent_json' to 'pubevent_obj_json' and 'pubevent_memid' to 'pubevent_obj_id'. Introduce tracing for error handling during statement preparation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant