raggrep 0.7.1 → 0.8.1

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.
@@ -2,9 +2,11 @@
2
2
  * JSON Data Index Module
3
3
  *
4
4
  * Provides JSON file search using:
5
- * - JSON structure parsing
6
- * - Local text embeddings for semantic similarity
7
- * - Key/value extraction for better search
5
+ * - Literal indexing of dot-notation key paths (e.g., "package.dependencies.react")
6
+ * - BM25 keyword matching for fuzzy search
7
+ *
8
+ * Note: This module uses literal-only indexing (no embeddings) for fast indexing.
9
+ * JSON keys are indexed as dot-notation paths prefixed with the filename.
8
10
  *
9
11
  * Supported file types: .json
10
12
  *
@@ -12,7 +14,7 @@
12
14
  */
13
15
  import { IndexModule, IndexContext, SearchContext, SearchOptions, FileIndex, SearchResult, ModuleConfig } from "../../../types";
14
16
  /** Default minimum similarity score for search results */
15
- export declare const DEFAULT_MIN_SCORE = 0.15;
17
+ export declare const DEFAULT_MIN_SCORE = 0.1;
16
18
  /** Default number of results to return */
17
19
  export declare const DEFAULT_TOP_K = 10;
18
20
  /** File extensions supported by this module */
@@ -26,24 +28,40 @@ export declare const supportsFile: typeof isJsonFile;
26
28
  * Module-specific data stored alongside file index
27
29
  */
28
30
  export interface JsonModuleData {
29
- embeddings: number[][];
30
- embeddingModel: string;
31
- jsonKeys: string[];
31
+ /** Dot-notation paths extracted from the JSON file */
32
+ jsonPaths: string[];
32
33
  [key: string]: unknown;
33
34
  }
34
35
  export declare class JsonModule implements IndexModule {
35
36
  readonly id = "data/json";
36
37
  readonly name = "JSON Search";
37
- readonly description = "JSON file search with structure-aware indexing";
38
- readonly version = "1.0.0";
38
+ readonly description = "JSON file search with literal-based key path indexing";
39
+ readonly version = "2.0.0";
39
40
  supportsFile(filepath: string): boolean;
40
- private embeddingConfig;
41
41
  private symbolicIndex;
42
+ private literalIndex;
42
43
  private pendingSummaries;
44
+ /** Map from chunkId → { filepath, literals } for building literal index */
45
+ private pendingLiterals;
43
46
  private rootDir;
44
47
  private logger;
45
48
  initialize(config: ModuleConfig): Promise<void>;
46
49
  indexFile(filepath: string, content: string, ctx: IndexContext): Promise<FileIndex | null>;
50
+ /**
51
+ * Finalize indexing by building and saving the symbolic and literal indexes
52
+ */
47
53
  finalize(ctx: IndexContext): Promise<void>;
54
+ /**
55
+ * Search the JSON index for files matching the query.
56
+ *
57
+ * Uses a two-source approach:
58
+ * 1. Literal index for exact path matches (e.g., `package.dependencies.react`)
59
+ * 2. BM25 keyword search for fuzzy matching
60
+ *
61
+ * @param query - Search query (supports backticks for exact literal matching)
62
+ * @param ctx - Search context with index access
63
+ * @param options - Search options (topK, minScore, filePatterns)
64
+ * @returns Array of search results sorted by relevance
65
+ */
48
66
  search(query: string, ctx: SearchContext, options?: SearchOptions): Promise<SearchResult[]>;
49
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "raggrep",
3
- "version": "0.7.1",
3
+ "version": "0.8.1",
4
4
  "description": "Local filesystem-based RAG system for codebases - semantic search using local embeddings",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",