Skip to content

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

Merged
AmitoVrito merged 6 commits into
SynapseKit:mainfrom
DhruvGarg111:feat/issue-740-knowledge-mesh
Jul 14, 2026
Merged

AmitoVrito merged 6 commits into
SynapseKit:mainfrom
DhruvGarg111:feat/issue-740-knowledge-mesh

Conversation

@DhruvGarg111

Copy link
Copy Markdown
Collaborator

Summary

  • Add a local-first Personal Knowledge Mesh API with incremental metadata state, privacy filtering, cross-project entity resolution, duplication detection, and offline hash embeddings.
  • Add mesh loaders for local markdown/design docs and local git repositories, including heading hierarchy, file paths, line numbers, content hashes, and commit subjects.
  • Add synapsekit mesh CLI commands and MCP tools (mesh_query, mesh_reindex, mesh_duplicates, mesh_status).
  • Add optional Kuzu graph backend support without making it a hard dependency.

Closes #740

Test Plan

  • PYTHONPATH=src PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest tests/mesh tests/cli/test_mesh.py tests/mcp/test_mesh_tools.py -q
  • PYTHONPATH=src PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 python -m pytest -p pytest_asyncio.plugin tests/retrieval/test_world_model.py tests/retrieval/test_sqlite_vec.py tests/mcp/test_server.py tests/api/test_mcp_server.py -q
  • python -m ruff check src/synapsekit/mesh src/synapsekit/cli/mesh.py src/synapsekit/retrieval/world_model.py src/synapsekit/mcp/server/core.py tests/mesh tests/cli/test_mesh.py tests/mcp/test_mesh_tools.py

Notes

  • uv is not installed in this local environment, so I used python -m pytest/python -m ruff equivalents with PYTHONPATH=src.
  • Full python -m ruff check src tests is blocked by unrelated existing lint in src/synapsekit/agents/agent_registry.py, tests/agents/test_agent_swarm_market.py, tests/llm/test_mlx.py, and tests/symbolic/*.
  • Pytest plugin autoload is disabled locally because the globally installed logfire plugin has an OpenTelemetry import mismatch.

@AmitoVrito
AmitoVrito merged commit 7bbc2fa into SynapseKit:main Jul 14, 2026
4 checks passed
@AmitoVrito

Copy link
Copy Markdown
Collaborator

Thanks Dhruv, the knowledge mesh is a nice piece of work.

Merged via #771 with four fixes on top:

  1. _hits_from_embeddings treated an empty active_chunk_ids set as no filter rather than nothing active, so an emptied or pre-first-reindex mesh could still surface old or deleted content. Fixed to distinguish None from an empty set.
  2. Reindexing never removed stale vectors from the vector store on file change, only flipped chunk rows inactive in SQLite, leaking vectors over time. Added delete_by_metadata to the vector store backends and wired it into reindex.
  3. mesh stop only wrote a status row and never signaled the actually running watch process, so it could not stop a real daemon in another process. Now uses a real PID and SIGTERM with a proper handler and polling.
  4. The default docs/**/*.md include pattern never matched files directly under docs/, only masked by a co-listed *.md fallback. Fixed the glob matcher to handle globstar properly.

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

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