Skip to content

feat(mesh): add personal knowledge mesh - #771

Merged
AmitoVrito merged 8 commits into
mainfrom
fix/pr764-bugs
Jul 14, 2026
Merged

AmitoVrito merged 8 commits into
mainfrom
fix/pr764-bugs

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Merges #764 (personal knowledge mesh from @DhruvGarg111) with review fixes applied on top:

  • _hits_from_embeddings treated an empty active_chunk_ids set as no filter instead of nothing active, so an emptied or pre-reindex mesh could surface stale or deleted content. Fixed to distinguish None from an empty active set.
  • Reindexing never deleted the old vectors for changed files from the vector store, only flipped their chunk rows inactive in SQLite. Added delete_by_metadata to the vector store backends and wired it into reindex.
  • mesh stop wrote a status row but never actually signaled the running watch process, so it could not stop a real daemon. Now writes the daemon PID and sends a real SIGTERM, with the watch loop handling it and stop() polling for exit.
  • The default docs/**/*.md include pattern never matched files directly under docs/, only masked by a co-listed *.md fallback. Replaced the glob matcher with proper globstar semantics.

Regression tests added for all four, including a subprocess integration test for the daemon stop path. Full suite passing.

Closes #740

DhruvGarg111 and others added 8 commits July 3, 2026 12:25
…ss stop, and globstar include matching

Fixes four bugs found in PR #764's knowledge mesh implementation.

_hits_from_embeddings treated an empty active_chunk_ids set the same as
no filter at all (falsy check), so a freshly emptied index could still
surface embeddings from the vector store. It now distinguishes None
(no filter) from an empty set (filter active, nothing matches).

KnowledgeMesh.reindex never removed stale vectors when a file's content
changed and its chunk_id was regenerated: old rows were marked
inactive in SQLite but their vectors stayed in the vector store forever.
Added delete_by_metadata to VectorStore, InMemoryVectorStore, and
SQLiteVecStore, plus WorldModelRAG.delete_by_metadata, and wired reindex
to delete stale chunk_id vectors after ingesting the new ones.

MeshDaemon.stop() only flipped a SQLite status row from a brand-new
MeshDaemon instance, never reaching the asyncio.Event inside the
separate process actually running `mesh start --watch`. The running
watch process now records its PID and installs SIGTERM/SIGINT handlers
that set its own _stop_event; stop() signals that PID via os.kill and
waits briefly for the status row to confirm the watch loop exited.

LocalMdLoader._matches_include's glob fallback did not implement
globstar semantics, so the default include pattern docs/**/*.md never
matched files directly under docs/ (e.g. docs/architecture.md) unless a
co-listed bare *.md pattern happened to catch it by basename. Added a
proper glob-to-regex compiler where ** matches zero or more directory
segments.

Co-authored-by: Dhruv Garg <[email protected]>
# Conflicts:
#	src/synapsekit/agents/agent_registry.py
#	src/synapsekit/computer_use/decorators.py
@AmitoVrito
AmitoVrito merged commit 2057d1c into main Jul 14, 2026
9 of 10 checks passed
@AmitoVrito AmitoVrito mentioned this pull request Jul 14, 2026
3 tasks done
@AmitoVrito
AmitoVrito deleted the fix/pr764-bugs branch July 14, 2026 20:50
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.

v2.1: Personal Knowledge Mesh — federated WorldModelRAG across every project on the PC

2 participants