# fish827-08/rag-kb [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/fish827-08/rag-kb  
**GitHub Stars:** 5  
**Views:** 24  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/fish827-08-rag-kb

## Description
Local-first agent memory & knowledge service with hybrid retrieval (BGE-M3 dense vectors + BM25 via jieba, fused with RRF), document & webpage ingestion, and optional RAG answering via local Ollama. Single process, embedded ChromaDB, REST + native MCP server; fully functional offline without any LLM. Apache-2.0.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "rag-kb": {
    "command": "uvx",
    "args": ["--from","kb-memory","kb"]
  }
}
```

## Documentation

## What fish827-08/rag-kb does

fish827-08/rag-kb is a local-first knowledge and memory service for agents, scripts, and desktop clients. It stores agent memories separately from RAG sources such as documents, webpages, and spreadsheets, while exposing both through REST and MCP.

The service runs as a single `python -m kb serve` process and uses embedded ChromaDB for storage. A local web interface is available at `http://127.0.0.1:8000/ui`, and command-line commands cover importing, searching, asking questions, inspecting statistics, querying tables, and managing memories.

## How it works

Retrieval combines dense embeddings with BM25 keyword search. The default embedding model is `BAAI/bge-small-zh-v1.5`, which is loaded when a write or search first needs it. `BAAI/bge-m3` can be selected for larger semantic models; optional reranking and BGE-M3 sparse retrieval are also available.

CSV and Excel files are imported row by row as column-value text. Table queries use deterministic matching and can return cell values, identify rows by conditions, disambiguate multiple sheets by sheet name, and handle some simple aggregations. Spreadsheet rows do not require vector embeddings, making this path usable without an LLM.

Memories may be global or assigned to a project. Project storage is physically separated, while project searches can combine the project store with global memories. The service records access activity in JSON audit logs and supports namespaces, tags, types, updates, deletion, and listing.

## Setup and configuration

Install the ingestion extras and start the service:

```bash
pip install "kb-memory[ingest]"
python -m kb serve
```

The same process provides REST and MCP access. On Linux, installing the CPU-only PyTorch package first can avoid downloading CUDA dependencies when GPU support is not needed. The first write or search downloads and caches the embedding model; after caching, storage and retrieval can operate offline.

Useful settings include `KB_DEVICE=cpu`, `KB_LLM_MODE=off`, `KB_EMBED_MODEL`, `KB_IDLE_UNLOAD_SECONDS`, `KB_WATCH_DIR`, and `KB_DATA_DIR`. Only one running instance may use a given data directory. To run separate instances, assign each one a different `KB_DATA_DIR`; changing only the port does not bypass this restriction.

## Tools and capabilities

The MCP interface exposes 13 tools, including:

- `write_memory`, `search_memory`, and `delete_memory` for agent memory.
- `add_document` and `add_webpage` for RAG source ingestion.
- `list_documents` and `delete_document` for knowledge-base administration.

`search_memory` can enable table-aware lookup and return structured answers with sources. The REST API provides corresponding memory and document endpoints, while the CLI supports commands such as `kb import`, `kb search`, `kb ask`, and `kb table query`.

Optional LLM configuration enables `/ask` and CLI RAG answers. Without an LLM, ingestion, memory management, table lookup, source-aware retrieval, and hybrid search remain available. A local Ollama setup can provide answering without sending data to a hosted service; the service also supports cloud API configuration.

## Limitations and notes

The service is designed for a local, single-user shared memory model: memories and knowledge are visible across clients and tasks, with client identifiers used for audit and metadata rather than isolation. Documents, webpages, and tables do not participate in memory decay and are removed only explicitly.

The project is intended for quick lookup across spreadsheets rather than replacing SQL or BI systems. RAG answering, conceptual questions, and aggregate questions depend on an LLM, while table matching remains deterministic. Web ingestion includes SSRF protection and a 5 MB response limit; individual file uploads are limited by `KB_MAX_UPLOAD_BYTES`, whose default is 100 MB. The project is licensed under Apache-2.0.

_Full upstream README: https://allmcps.com/mcp/fish827-08-rag-kb/readme_

