knowledge-rag 3.2.1__tar.gz → 3.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: knowledge-rag
3
- Version: 3.2.1
3
+ Version: 3.2.2
4
4
  Summary: Local RAG System for Claude Code — Hybrid search + Cross-encoder Reranking + 12 MCP Tools. Zero external servers.
5
5
  Project-URL: Homepage, https://github.com/lyonzin/knowledge-rag
6
6
  Project-URL: Repository, https://github.com/lyonzin/knowledge-rag
@@ -37,7 +37,7 @@ Description-Content-Type: text/markdown
37
37
 
38
38
  <div align="center">
39
39
 
40
- ![Version](https://img.shields.io/badge/version-3.2.1-blue.svg)
40
+ ![Version](https://img.shields.io/badge/version-3.2.2-blue.svg)
41
41
  ![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12-green.svg)
42
42
  ![License](https://img.shields.io/badge/license-MIT-yellow.svg)
43
43
  ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)
@@ -1024,6 +1024,12 @@ With ~200 documents, expect ~300-500MB RAM. The embedding model (~50MB) and rera
1024
1024
 
1025
1025
  ## Changelog
1026
1026
 
1027
+ ### v3.2.2 (2026-03-22)
1028
+
1029
+ - **FIX**: `pip install knowledge-rag` now works as plug-and-play (BASE_DIR falls back to CWD when installed from PyPI)
1030
+ - **FIX**: `category="aar"` now accepted by search_knowledge (was rejected by validator)
1031
+ - **NEW**: `KNOWLEDGE_RAG_DIR` env var for explicit base directory override
1032
+
1027
1033
  ### v3.2.1 (2026-03-22)
1028
1034
 
1029
1035
  - **FIX**: Auto-recovery from corrupted ChromaDB on startup (no more segfault loops)
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div align="center">
4
4
 
5
- ![Version](https://img.shields.io/badge/version-3.2.1-blue.svg)
5
+ ![Version](https://img.shields.io/badge/version-3.2.2-blue.svg)
6
6
  ![Python](https://img.shields.io/badge/python-3.11%20%7C%203.12-green.svg)
7
7
  ![License](https://img.shields.io/badge/license-MIT-yellow.svg)
8
8
  ![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-lightgrey.svg)
@@ -989,6 +989,12 @@ With ~200 documents, expect ~300-500MB RAM. The embedding model (~50MB) and rera
989
989
 
990
990
  ## Changelog
991
991
 
992
+ ### v3.2.2 (2026-03-22)
993
+
994
+ - **FIX**: `pip install knowledge-rag` now works as plug-and-play (BASE_DIR falls back to CWD when installed from PyPI)
995
+ - **FIX**: `category="aar"` now accepted by search_knowledge (was rejected by validator)
996
+ - **NEW**: `KNOWLEDGE_RAG_DIR` env var for explicit base directory override
997
+
992
998
  ### v3.2.1 (2026-03-22)
993
999
 
994
1000
  - **FIX**: Auto-recovery from corrupted ChromaDB on startup (no more segfault loops)
@@ -1,6 +1,6 @@
1
1
  """Knowledge RAG MCP Server - Local Retrieval-Augmented Generation System"""
2
2
 
3
- __version__ = "3.2.1"
3
+ __version__ = "3.2.2"
4
4
  __author__ = "Ailton Rocha (Lyon.)"
5
5
 
6
6
  from .config import Config
@@ -1,10 +1,21 @@
1
1
  """Configuration for Knowledge RAG System v3.0"""
2
2
 
3
+ import os
3
4
  from dataclasses import dataclass, field
4
5
  from pathlib import Path
5
6
  from typing import Dict, List
6
7
 
7
- BASE_DIR = Path(__file__).parent.parent
8
+ # Determine base directory:
9
+ # 1. KNOWLEDGE_RAG_DIR env var (explicit override)
10
+ # 2. Source checkout (../documents/ exists relative to this file)
11
+ # 3. Current working directory (fallback for pip install)
12
+ _source_dir = Path(__file__).parent.parent
13
+ if os.environ.get("KNOWLEDGE_RAG_DIR"):
14
+ BASE_DIR = Path(os.environ["KNOWLEDGE_RAG_DIR"])
15
+ elif (_source_dir / "documents").exists():
16
+ BASE_DIR = _source_dir
17
+ else:
18
+ BASE_DIR = Path.cwd()
8
19
 
9
20
 
10
21
  @dataclass
@@ -1542,7 +1542,7 @@ def search_knowledge(query: str, max_results: int = 5, category: str = None, hyb
1542
1542
  max_results = max(1, min(max_results or 5, config.max_results))
1543
1543
  hybrid_alpha = max(0.0, min(hybrid_alpha if hybrid_alpha is not None else 0.3, 1.0))
1544
1544
 
1545
- valid_categories = list(config.keyword_routes.keys()) + ["general"]
1545
+ valid_categories = list(config.keyword_routes.keys()) + list(set(config.category_mappings.values()))
1546
1546
  if category and category not in valid_categories:
1547
1547
  return json.dumps(
1548
1548
  {"status": "error", "message": f"Invalid category '{category}'. Valid: {', '.join(valid_categories)}"}
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "knowledge-rag"
7
- version = "3.2.1"
7
+ version = "3.2.2"
8
8
  description = "Local RAG System for Claude Code — Hybrid search + Cross-encoder Reranking + 12 MCP Tools. Zero external servers."
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes