Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .tmp/sitecustomize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import tempfile

_real_mkdir = tempfile._os.mkdir

def _mkdir(path, mode=0o777):
return _real_mkdir(path, 0o777)

tempfile._os.mkdir = _mkdir
15 changes: 15 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
include README.md
include LICENSE
include CHANGELOG.md
include CONTRIBUTING.md
include requirements.txt

recursive-include meshmind/knowledge *.json
recursive-include meshmind/ui/template *.html
recursive-include meshmind/ui/static *
recursive-include meshmind/cli/templates *.tmpl
recursive-include meshmind/cli/presets *.yaml
recursive-include meshmind/cli/plugin_stubs *.yaml *.txt *.md

prune meshmind.egg-info
global-exclude __pycache__ *.py[cod]
36 changes: 36 additions & 0 deletions PUBLISHING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Publishing to PyPI

## 1) Prep

- Make sure `pyproject.toml` has the right `project.version`.
- Update `CHANGELOG.md` (and optionally docs release notes).
- Tag the release (recommended): `git tag vX.Y.Z`

## 2) Build

```bash
python -m pip install -U build twine
python -m build
python -m twine check dist/*
```

## 3) Upload

TestPyPI (recommended first):

```bash
python -m twine upload -r testpypi dist/*
```

PyPI:

```bash
python -m twine upload dist/*
```

## 4) Verify install

```bash
python -m pip install -U meshmind
meshmind --help
```
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div align="center">
<div align="center">

# MeshMind

Expand Down Expand Up @@ -28,7 +28,7 @@ This is not distributed inference for a single giant model. MeshMind is built ar
**Install (released package):** Python **3.11+** and [Ollama](https://ollama.com). Stable installs:

```bash
pip install meshmind
pip install -U meshmind
```

**Install (from source, contributors):** from the repo root:
Expand Down
4 changes: 2 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ When `meshmind.yaml` sets `plugin: "<plugin-id>"` on a node:

## Bundled demos

The repo ships stub plugins `demo_review` and `demo_security` under `meshmind/cli/plugin_stubs/`.
`meshmind init <name> --preset code` can copy them into your plugin directory (default unless `--skip-bundled-plugins`).
The repo ships stub plugins `demo_review`, `demo_security`, `demo_documentation`, and `demo_research` under `meshmind/cli/plugin_stubs/`.
`meshmind init <name> --preset code` can copy `demo_review` and `demo_security` into your plugin directory (default unless `--skip-bundled-plugins`).
If you skipped that step or moved machines, run `meshmind plugin sync -c meshmind.yaml` before `meshmind up`.

## meshmind.yaml
Expand Down
1 change: 1 addition & 0 deletions meshmind/cli/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""MeshMind CLI package."""
Empty file removed meshmind/cli/__inti__.py
Empty file.
13 changes: 13 additions & 0 deletions meshmind/cli/plugin_stubs/demo_documentation/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id: demo_documentation
name: Demo Documentation
capabilities:
- documentation
- writing
- editing
functions:
- name: write_documentation
description: Generate clear documentation, user guides, or API reference.
parameters: {}
- name: improve_readability
description: Rewrite text to make it easier to understand and scan.
parameters: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You are a documentation specialist. Produce clear, concise guides, API reference, and examples with a reader-first approach.
13 changes: 13 additions & 0 deletions meshmind/cli/plugin_stubs/demo_research/plugin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
id: demo_research
name: Demo Research
capabilities:
- research
- analysis
- summarization
functions:
- name: research_topic
description: Investigate a topic and summarize key findings.
parameters: {}
- name: extract_insights
description: Extract the most important insights from a body of text.
parameters: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You are a researcher assistant. Gather relevant information, analyze it critically, and summarize your findings in a useful way.
1 change: 1 addition & 0 deletions meshmind/config/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class DefaultsConfig(BaseModel):
model: str = "gemma4"
timeout: int = 60
retries: int = 1
capability_keywords: dict[str, list[str]] = Field(default_factory=dict)


class PluginReference(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions meshmind/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def __init__(
registry=self.registry,
ai_engine=self.ai_engine if use_ai else None,
event_logger=self._log_event,
capability_keywords=config.get("capability_keywords"),
)

self.discovery = MeshDiscovery(
Expand Down
4 changes: 3 additions & 1 deletion meshmind/core/orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def __init__(
ai_engine=None,
max_retries: int = 0,
event_logger=None,
capability_keywords: dict[str, list[str]] | None = None,
) -> None:
self.node_id = node_id
self.node_name = node_name
Expand All @@ -148,6 +149,7 @@ def __init__(
self.event_logger = event_logger
self.traces: list[QueryTrace] = []
self._max_traces = 100
self._capability_keywords = capability_keywords

def _log_event(self, event_type: str, data: dict[str, Any]) -> None:
if callable(self.event_logger):
Expand Down Expand Up @@ -186,7 +188,7 @@ async def _classify_and_route(self, query: str) -> list[dict]:
except Exception:
logger.warning("AI classification failed, falling back to keywords")

return build_routing_plan(self.registry, query, self.node_id)
return build_routing_plan(self.registry, query, self.node_id, self._capability_keywords)

async def process_query(self, query: str) -> tuple[str, QueryTrace]:
"""Process a user query by routing to specialized nodes and aggregating responses.
Expand Down
7 changes: 7 additions & 0 deletions meshmind/sdk/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def __init__(
manual_peers: list[dict] | None = None,
default_model: str = "gemma4",
dev_mode: bool | None = None,
capability_keywords: dict[str, list[str]] | None = None,
) -> None:
self.name = name
self.discovery = discovery
Expand All @@ -138,6 +139,7 @@ def __init__(
self._running = False
self._event_handlers: dict[str, list[Callable]] = {}
self._config_dir: Path = Path(".")
self._capability_keywords = capability_keywords or {}

@classmethod
def from_yaml(cls, path: str | Path) -> "Mesh":
Expand All @@ -152,6 +154,7 @@ def from_yaml(cls, path: str | Path) -> "Mesh":
manual_peers=peers,
default_model=config.defaults.model,
dev_mode=None,
capability_keywords=config.defaults.capability_keywords,
)
mesh._config_dir = path.parent

Expand Down Expand Up @@ -235,6 +238,10 @@ async def start(self) -> None:
+ knowledge_context
)

# Add mesh-wide capability keywords to node config
if self._capability_keywords:
config["capability_keywords"] = self._capability_keywords

node = MeshNode(
node_info=node_info,
config=config,
Expand Down
68 changes: 68 additions & 0 deletions my-project/.meshmind/repl_history
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

# 2026-04-20 11:27:03.556918
+python -m venv venv-test
+.\venv-test\Scripts\Activate.ps1
+python -m pip install --upgrade pip
+python -m pip install meshmind==0.1.1
+meshmind --version

# 2026-04-20 12:19:55.876072
+ meshmind plugin install demo_documentation
+meshmind plugin install demo_research

# 2026-04-20 12:32:16.012494
+hi

# 2026-04-20 12:40:28.008274
+hiii which plugins are there

# 2026-04-20 12:44:55.592211
+What tools do you have available?

# 2026-04-20 12:50:44.647563
+Write a short guide on how to install Python packages

# 2026-04-20 12:52:01.938719
+hi

# 2026-04-20 12:52:13.162441
+

# 2026-04-20 12:57:08.104379
+hi

# 2026-04-20 12:58:16.572155
+What tools do you have available?

# 2026-04-20 12:58:59.034871
+what is cg

# 2026-04-20 12:59:10.187850
+what is dsa

# 2026-04-20 12:59:22.030278
+dsa

# 2026-04-20 13:00:39.975381
+what other plugins are there in the meshmind

# 2026-04-20 13:03:03.884260
+Research the benefits of renewable energy

# 2026-04-20 13:24:54.566450
+Research renewable energy AND write documentation about solar panels

# 2026-04-20 13:27:04.002920
+hu

# 2026-04-20 13:35:17.967465
+hi

# 2026-04-20 13:36:03.873971
+Research renewable energy AND write documentation about solar panels

# 2026-04-20 13:38:40.568903
+write a short poem

# 2026-04-20 14:12:39.308336
+hi
72 changes: 60 additions & 12 deletions my-project/meshmind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,47 @@ mesh:
# - host: "192.168.1.10"
# port: 8401

defaults:
model: 'gemma3:1b' # Lower-memory Gemma model for local development
defaults:
model: 'llama3.2:latest' # Model with tool support
timeout: 60 # Query timeout in seconds
retries: 1 # Retry failed sub-queries once
capability_keywords:
research:
- research
- investigate
- study
- analyze
- survey
analysis:
- analysis
- analyze
- examine
- evaluate
summarization:
- summary
- summarize
- brief
- concise
documentation:
- documentation
- document
- guide
- manual
- write
- writing
writing:
- write
- writing
- compose
- draft

nodes:
# ------------------------------------
# Specialist Node - handles a specific domain
# ------------------------------------
assistant:
type: 'specialist'
# model: "gemma3:1b" # Override default model
model: "llama3.2:latest"
port: 8401
system_prompt: |
You are a helpful assistant specializing in research and analysis.
Expand All @@ -38,21 +67,40 @@ nodes:
knowledge:
- ./data/knowledge.json

# Add more specialist nodes as needed:
# writer:
# type: "specialist"
# port: 8402
# system_prompt: "You are a technical writer..."
# capabilities:
# - "writing"
# - "documentation"
documentation_specialist:
type: 'specialist'
model: "llama3.2:latest"
port: 8402
plugin: demo_documentation
capabilities:
- 'documentation'
- 'writing'
knowledge_domains:
- 'documentation'
system_prompt: |
You are a documentation specialist. Use the documentation plugin to generate clear guides, examples, and API reference.

research_specialist:
type: 'specialist'
model: "llama3.2:latest"
port: 8405
plugin: demo_research
capabilities:
- 'research'
- 'analysis'
- 'summarization'
knowledge_domains:
- 'research'
system_prompt: |
You are a research specialist. Use the research plugin to investigate topics and summarize findings.

# ------------------------------------
# Coordinator - routes queries and aggregates
# ------------------------------------
coordinator:
type: 'coordinator'
model: 'llama3.2:latest'
port: 8403
ui: true # Enable web dashboard
ui_port: 9000 # Dashboard at http://localhost:9080
ui_port: 9000 # Dashboard at http://localhost:9000

Loading
Loading