LearnNewsExamplesServices
Frontmatter
id7508
titleImplement Sync Database Service
stateClosed
labels
enhancementai
assigneestobiu
createdAtOct 16, 2025, 12:56 PM
updatedAtOct 16, 2025, 1:01 PM
githubUrlhttps://github.com/neomjs/neo/issues/7508
authortobiu
commentsCount0
parentIssue7501
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtOct 16, 2025, 1:01 PM

Implement Sync Database Service

Closed v11.0.0 enhancementai
tobiu
tobiu commented on Oct 16, 2025, 12:56 PM

This ticket covers the implementation of the sync_database service. This is the primary write operation for the server, responsible for building the knowledge base from source files and embedding the content into the ChromaDB collection.

The implementation will adapt and combine the logic from two scripts:

  1. buildScripts/ai/createKnowledgeBase.mjs (Parsing source files)
  2. buildScripts/ai/embedKnowledgeBase.mjs (Scoring, embedding, and upserting to DB)

Since this is a long-running, asynchronous process, the service should be designed to run in the background without blocking the server.

Acceptance Criteria

  1. The databaseService.mjs file is updated with a syncDatabase function.
  2. The function orchestrates the full build and embed process:
    • It parses all knowledge sources (JSDoc, guides, etc.) into an in-memory array of chunks.
    • It enriches the chunks (e.g., with inheritance chains).
    • It performs a diff against the existing documents in ChromaDB to identify chunks to add, update, or delete.
    • It generates embeddings for new/updated chunks and upserts them into the database.
    • It deletes stale chunks from the database.
  3. The function is asynchronous and does not block the main thread.
  4. The toolService.mjs serviceMapping is updated to point the sync_database operationId to the new service function.
tobiu assigned to @tobiu on Oct 16, 2025, 12:56 PM
tobiu added parent issue #7501 on Oct 16, 2025, 12:56 PM
tobiu added the enhancement label on Oct 16, 2025, 12:56 PM
tobiu added the ai label on Oct 16, 2025, 12:56 PM
tobiu referenced in commit fd2dc6e - "Implement Sync Database Service #7508" on Oct 16, 2025, 1:01 PM
tobiu closed this issue on Oct 16, 2025, 1:01 PM