Metadata-Version: 2.4
Name: grp-kb
Version: 0.1.0
Summary: Dual-model semantic search MCP server for an Acumatica KB (general English + multilingual GRP-manual domains), no Obsidian/Smart Connections required
Author: Arvindh
License: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: mcp[cli]
Requires-Dist: numpy
Requires-Dist: sentence-transformers

# grp-kb

Dual-model semantic search MCP server for an Acumatica knowledge base. Two
independently-embedded domains over one vault of markdown notes:

- **general** — everything except `GRP_Manual*.md`, embedded with `TaylorAI/bge-micro-v2`
- **grp** — `GRP_Manual*.md` only, embedded with `paraphrase-multilingual-MiniLM-L12-v2`
  (the GRP manuals are in Bahasa Malaysia — bge-micro-v2 alone tested noticeably
  worse there than a multilingual model)

No Obsidian, no Smart Connections plugin, anywhere in this pipeline — indexes
are built directly from plain `.md` files with `sentence-transformers`.

This package ships **code only**. It needs a real, pre-built vault + index pair
to do anything useful — either build your own (see below) or get one shared
from someone who already has it (just the `.md` vault + two `kb_index.npy` /
`kb_meta.json` pairs, no re-embedding needed on the receiving end).

## Build an index

Run twice — once per domain — pointing at separate `KB_MCP_INDEX_DIR` folders:

```bash
# general domain
export KB_VAULT_DIR=/path/to/vault
export KB_FILE_GLOB="*.md"
export KB_EMBED_MODEL=TaylorAI/bge-micro-v2
export KB_MCP_INDEX_DIR=/path/to/index
python -m grp_kb.build_index

# grp domain
export KB_VAULT_DIR=/path/to/vault
export KB_FILE_GLOB="GRP_Manual*.md"
export KB_EMBED_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
export KB_MCP_INDEX_DIR=/path/to/index_minilm_grp
python -m grp_kb.build_index
```

## Run the server

```bash
export KB_VAULT_DIR=/path/to/vault
export KB_GENERAL_INDEX_DIR=/path/to/index
export KB_GRP_INDEX_DIR=/path/to/index_minilm_grp
grp-kb
```

## Register with Claude Code

```bash
claude mcp add grp-kb -s user \
  -e KB_VAULT_DIR=/path/to/vault \
  -e KB_GENERAL_INDEX_DIR=/path/to/index \
  -e KB_GRP_INDEX_DIR=/path/to/index_minilm_grp \
  -- grp-kb
```

## Tools

- `search_kb(query, top_k=10, source_only=False, guide_filter="")` — returns a
  JSON array of results tagged `source: "general"` or `"grp"`. `top_k` applies
  per domain, so a call can return up to 2x that many results total.
- `read_kb_file(path)` — full markdown content by relative path (as returned
  by `search_kb`).
