Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/EncrEor/rlm-claude
/ functions
Functions
334 in github.com/EncrEor/rlm-claude
⨍
Functions
334
◇
Types & classes
31
↓ 25 callers
Function
tokenize_fr
Tokenize French/English text for BM25 search. Features: - Lowercases text - Normalizes accents for matching - Extracts words and
src/mcp_server/tools/tokenizer_fr.py:201
↓ 23 callers
Method
load
Load vectors from .npz file. Returns: True if loaded successfully, False if file doesn't exist or numpy unavailable
src/mcp_server/tools/vecstore.py:45
↓ 21 callers
Function
_extract_entities
Extract named entities from chunk content (Phase 7.2, MAGMA-inspired). Uses regex patterns to identify domain-specific entities: files,
src/mcp_server/tools/navigation.py:286
↓ 18 callers
Function
_chunk_in_date_range
Check if a chunk falls within a date range. Uses simple string comparison on YYYY-MM-DD format (lexicographic = chronologic). Args:
src/mcp_server/tools/navigation.py:257
↓ 16 callers
Method
search
Search chunks (and optionally insights) using BM25 ranking. Args: query: Natural language search query top_k
src/mcp_server/tools/search.py:189
↓ 12 callers
Function
_entity_matches
Check if a chunk's entities contain a given entity (Phase 7.2). Performs case-insensitive substring matching across all entity types. A
src/mcp_server/tools/navigation.py:400
↓ 12 callers
Method
add
(self, chunk_id, vec)
tests/test_retention_semantic.py:31
↓ 11 callers
Function
archive_chunk
Archive a chunk by compressing it to archive/. Steps: 1. Read chunk file 2. Compress to archive/*.md.gz 3. Remove from main inde
src/mcp_server/tools/retention.py:321
↓ 10 callers
Method
_make_store
(self, tmp_path)
tests/test_semantic.py:24
↓ 10 callers
Method
add
Add a vector for a chunk. If chunk_id already exists, replaces the vector. Args: chunk_id: The chunk identifier
src/mcp_server/tools/vecstore.py:91
↓ 10 callers
Function
chunk
Save content to an external chunk file. Use this to externalize parts of the conversation that you might need to reference later but don
src/mcp_server/tools/navigation.py:515
↓ 9 callers
Function
atomic_write_json
Write JSON atomically using write-to-temp-then-rename. On POSIX systems, rename is atomic, so the file is never in a half-written state.
src/mcp_server/tools/fileutil.py:116
↓ 9 callers
Function
normalize_accent
Remove accents from text for matching purposes. Uses NFD normalization to decompose characters, then removes diacritical marks (combinin
src/mcp_server/tools/tokenizer_fr.py:176
↓ 8 callers
Method
_create_chunk
Helper to create a chunk for testing.
tests/test_grep_fuzzy.py:43
↓ 8 callers
Function
_get_cached_provider
Get or create the cached embedding provider (singleton, lazy). Reads RLM_EMBEDDING_PROVIDER env var (default: "model2vec"). Returns None if t
src/mcp_server/tools/embeddings.py:94
↓ 8 callers
Method
embed
Embed a list of texts into vectors. Args: texts: List of text strings to embed Returns: numpy ndarray of sha
src/mcp_server/tools/embeddings.py:30
↓ 7 callers
Function
_load_archive_index
Load archive index from JSON file.
src/mcp_server/tools/retention.py:71
↓ 7 callers
Function
_parse_date_from_chunk
Extract date string (YYYY-MM-DD) from chunk metadata or ID. Tries created_at first, then falls back to parsing the chunk ID. Args:
src/mcp_server/tools/navigation.py:232
↓ 6 callers
Function
_load_index
Load chunks index from JSON file.
src/mcp_server/tools/retention.py:53
↓ 6 callers
Function
_load_index
Load chunks index from JSON file.
src/mcp_server/tools/navigation.py:141
↓ 6 callers
Function
_normalize_bm25_scores
Normalize BM25 scores to [0, 1] range using min-max scaling. Adds a 'score_norm' field to each result dict. Args: results: List of B
src/mcp_server/tools/search.py:245
↓ 6 callers
Method
dim
Return the embedding dimension.
src/mcp_server/tools/embeddings.py:41
↓ 6 callers
Function
is_immune
Determine if a chunk is protected from archiving/purging. A chunk is IMMUNE if ANY of these apply: - Has a protected tag (critical, deci
src/mcp_server/tools/retention.py:112
↓ 5 callers
Function
_load_memory
Load session memory from JSON file.
src/mcp_server/tools/memory.py:19
↓ 5 callers
Function
_load_sessions
Load sessions index from disk.
src/mcp_server/tools/sessions.py:17
↓ 5 callers
Function
restore_chunk
Restore an archived chunk back to active storage. Steps: 1. Find in archive index 2. Decompress to chunks/ 3. Remove from archiv
src/mcp_server/tools/retention.py:420
↓ 5 callers
Function
retention_run
Execute retention actions. Args: archive: Archive old unused chunks (default: True) purge: Purge very old archives (default:
src/mcp_server/tools/retention.py:626
↓ 5 callers
Method
save
Persist vectors atomically to .npz file.
src/mcp_server/tools/vecstore.py:67
↓ 5 callers
Function
validate_chunk_id
Validate chunk ID format to prevent path traversal. Allows: alphanumeric, hyphens, underscores, dots, ampersands. Blocks: slashes, "..",
src/mcp_server/tools/fileutil.py:72
↓ 4 callers
Function
_add_active_chunk
Create an active chunk file + index entry old enough to archive.
tests/test_retention_semantic.py:71
↓ 4 callers
Method
_create_chunk
Helper to create a chunk for testing.
tests/test_grep_fuzzy.py:171
↓ 4 callers
Method
_create_chunk
Helper to create a chunk file and index entry.
tests/test_temporal_filter.py:177
↓ 4 callers
Method
_write_chunk
(self, chunks_dir: Path, filename: str, content: str)
tests/test_semantic.py:299
↓ 4 callers
Function
get_archive_candidates
Get list of chunks eligible for archiving. A chunk is an archive candidate if: - Age > ARCHIVE_AFTER_DAYS (30 days) - access_count =
src/mcp_server/tools/retention.py:158
↓ 4 callers
Function
list_chunks
List all available chunks with their metadata. Use this to see what conversation history is available in external storage. Args:
src/mcp_server/tools/navigation.py:1032
↓ 4 callers
Function
t
Get translated string for current language.
hooks/i18n.py:95
↓ 3 callers
Method
_create_chunk
Helper to create a chunk.
tests/test_grep_fuzzy.py:398
↓ 3 callers
Method
_extract_content
Extract content from a chunk file, skipping YAML header. Phase 8.1: Prepends summary, tags, project, and domain from the YAM
src/mcp_server/tools/search.py:54
↓ 3 callers
Function
_hybrid_search
Perform semantic vector search if available. Returns None if semantic search is not available (deps missing), allowing the caller to fall bac
src/mcp_server/tools/search.py:273
↓ 3 callers
Function
_load_purge_log
Load purge log from JSON file.
src/mcp_server/tools/retention.py:89
↓ 3 callers
Function
_save_archive_index
Save archive index atomically.
src/mcp_server/tools/retention.py:84
↓ 3 callers
Function
_save_sessions
Save sessions index atomically.
src/mcp_server/tools/sessions.py:26
↓ 3 callers
Method
build_index
Build BM25 index from all chunks and optionally insights. Reads all .md files in chunks directory, tokenizes content, and bu
src/mcp_server/tools/search.py:129
↓ 3 callers
Function
peek
Read content from a chunk file. Use this to view the contents of a previously saved chunk. Can read the whole chunk or just a portion (b
src/mcp_server/tools/navigation.py:714
↓ 3 callers
Function
purge_chunk
Permanently delete an archived chunk. Steps: 1. Find in archive index 2. Log metadata to purge_log.json (NOT content) 3. Remove
src/mcp_server/tools/retention.py:514
↓ 3 callers
Method
remove
(self, chunk_id)
tests/test_retention_semantic.py:27
↓ 3 callers
Function
retention_preview
Preview retention actions without executing. Shows what would be archived or purged based on current rules. Returns: Dictionary
src/mcp_server/tools/retention.py:589
↓ 3 callers
Function
safe_path
Build a safe file path from chunk ID, validating against traversal. Args: base_dir: The directory the file must remain within
src/mcp_server/tools/fileutil.py:90
↓ 2 callers
Method
_create_chunk
Helper to create a chunk.
tests/test_grep_fuzzy.py:253
↓ 2 callers
Method
_create_chunk
(self, chunk_id: str, content: str, created_at: str)
tests/test_temporal_filter.py:318
↓ 2 callers
Method
_create_chunk
Helper to create a chunk file and index entry.
tests/test_temporal_filter.py:418
↓ 2 callers
Function
_detect_project
Auto-detect project name from environment or git (Phase 5.5). Priority: 1. RLM_PROJECT environment variable (explicit override) 2. G
src/mcp_server/tools/navigation.py:56
↓ 2 callers
Function
_make_chunks
Create one chunk per date, all containing the term 'deployment', appended to the index in chronological (oldest-first) order.
tests/test_grep_ordering.py:26
↓ 2 callers
Function
_save_index
Save chunks index atomically.
src/mcp_server/tools/retention.py:66
↓ 2 callers
Function
_save_memory
Save session memory atomically.
src/mcp_server/tools/memory.py:36
↓ 2 callers
Function
_semantic_remove
Drop a chunk's vector from the semantic store. Never raises.
src/mcp_server/tools/retention.py:262
↓ 2 callers
Function
extract_content
Extract content from a chunk file, enriched with YAML metadata. Phase 8.1: Prepends summary and tags from YAML header to improve embedding qu
scripts/backfill_embeddings.py:30
↓ 2 callers
Function
forget
Remove an insight from memory. Args: insight_id: The ID of the insight to remove Returns: Confirmation of removal
src/mcp_server/tools/memory.py:172
↓ 2 callers
Function
get_purge_candidates
Get list of archived chunks eligible for purging. A chunk is a purge candidate if: - In archive for > PURGE_AFTER_DAYS (180 days) -
src/mcp_server/tools/retention.py:208
↓ 2 callers
Function
grep
Search for a pattern across all chunks. Use this to find where a topic was discussed or where specific information is stored. Phase
src/mcp_server/tools/navigation.py:796
↓ 2 callers
Function
list_domains
List all available domains from domains.json. Returns: dict with domains organized by category
src/mcp_server/tools/sessions.py:198
↓ 2 callers
Function
list_sessions
List available sessions with optional filtering. Args: project: Filter by project name domain: Filter by domain limi
src/mcp_server/tools/sessions.py:162
↓ 2 callers
Method
load
(self)
tests/test_retention_semantic.py:24
↓ 2 callers
Function
main
Entry point for the MCP RLM server.
src/mcp_server/server.py:673
↓ 2 callers
Function
memory_status
Get current status of the memory system. Returns: Statistics about stored insights
src/mcp_server/tools/memory.py:199
↓ 2 callers
Function
recall
Retrieve insights from memory. Use this to: - Find information discussed earlier in conversation - Review decisions made - Check
src/mcp_server/tools/memory.py:95
↓ 2 callers
Function
remember
Save an important insight to persistent memory. Use this to remember: - Key decisions made during conversation - Important facts dis
src/mcp_server/tools/memory.py:49
↓ 2 callers
Method
remove
Remove a chunk's vector. Args: chunk_id: The chunk identifier to remove Returns: True if found and removed,
src/mcp_server/tools/vecstore.py:118
↓ 2 callers
Function
restore
Restore an archived chunk back to active storage. Args: chunk_id: ID of the archived chunk Returns: Dictionary with sta
src/mcp_server/tools/retention.py:669
↓ 2 callers
Method
search
Search for nearest vectors using cosine similarity. Args: query_vec: 1D numpy array (query embedding) top_k: Maximum
src/mcp_server/tools/vecstore.py:140
↓ 1 callers
Function
_active_ids
()
scripts/reconcile_stores.py:56
↓ 1 callers
Function
_archived_ids
()
scripts/reconcile_stores.py:60
↓ 1 callers
Function
_auto_summarize
Generate automatic summary from content (Phase 4.1). Extracts the first non-empty line as summary. If too long, truncates with ellipsis.
src/mcp_server/tools/navigation.py:181
↓ 1 callers
Function
_check_duplicate
Check if content with this hash already exists (Phase 4.2). Args: content_hash: MD5 hash of normalized content Returns:
src/mcp_server/tools/navigation.py:426
↓ 1 callers
Function
_content_hash
Generate hash of normalized content for duplicate detection (Phase 4.2). Normalizes whitespace and lowercases before hashing to catch ne
src/mcp_server/tools/navigation.py:214
↓ 1 callers
Function
_estimate_tokens
Rough token estimation (1 token ~ 4 chars for French/English).
src/mcp_server/tools/navigation.py:171
↓ 1 callers
Method
_extract_summary
Extract summary from chunk YAML header. Args: chunk_file: Path to the chunk .md file Returns: Summa
src/mcp_server/tools/search.py:110
↓ 1 callers
Function
_generate_chunk_id
Generate a unique chunk ID (Phase 5.5 enhanced). Format 2.0: {date}_{project}_{seq}[_{ticket}][_{domain}] Args: project: Projec
src/mcp_server/tools/navigation.py:473
↓ 1 callers
Function
_generate_id
Generate a short unique ID for an insight.
src/mcp_server/tools/memory.py:43
↓ 1 callers
Function
_increment_access
Increment access counter for a chunk (Phase 4.3). Uses file locking to prevent race conditions on concurrent access. Args: chun
src/mcp_server/tools/navigation.py:445
↓ 1 callers
Function
_load_domains
Load domains configuration from disk. Creates default if not exists.
src/mcp_server/tools/sessions.py:31
↓ 1 callers
Function
_save_index
Save chunks index atomically.
src/mcp_server/tools/navigation.py:164
↓ 1 callers
Function
_save_purge_log
Save purge log atomically.
src/mcp_server/tools/retention.py:102
↓ 1 callers
Function
_semantic_add
(Re)embed a restored chunk into the semantic store. Never raises. Mirrors the enrichment used at chunk creation time (tags + summary + body)
src/mcp_server/tools/retention.py:274
↓ 1 callers
Function
_ts
()
scripts/reconcile_stores.py:52
↓ 1 callers
Function
add_chunk_to_session
Add a chunk ID to a session's chunk list. Args: chunk_id: The chunk ID to add session_id: Target session (uses current if no
src/mcp_server/tools/sessions.py:130
↓ 1 callers
Function
atomic_write_text
Write text file atomically using write-to-temp-then-rename. Args: filepath: Target file path content: Text content to write
src/mcp_server/tools/fileutil.py:145
↓ 1 callers
Function
benchmark_provider
Run full benchmark for one provider.
scripts/benchmark_providers.py:90
↓ 1 callers
Function
compare_results
Compare search results between providers.
scripts/benchmark_providers.py:162
↓ 1 callers
Function
extract_content
Extract content from a chunk file, skipping YAML header.
scripts/benchmark_providers.py:45
↓ 1 callers
Function
get_context_percentage
Read context usage from stdin (passed by Claude Code).
hooks/pre_compact_chunk.py:22
↓ 1 callers
Function
grep_fuzzy
Fuzzy grep - find matches even with typos (Phase 5.2). Uses thefuzz library for approximate string matching. Tolerates typos like "valid
src/mcp_server/tools/navigation.py:924
↓ 1 callers
Function
is_memory_path
Check if the target file is in an auto-memory directory.
hooks/memory_write_redirect.py:27
↓ 1 callers
Function
load_chunks
Load all chunks (id, content) from index.
scripts/benchmark_providers.py:61
↓ 1 callers
Function
locked_json_update
Context manager for locked read-modify-write on a JSON file. Acquires an exclusive lock, yields the data for modification, then writes b
src/mcp_server/tools/fileutil.py:169
↓ 1 callers
Function
main
Entry point for the MCP RLM server.
mcp_server/server.py:673
↓ 1 callers
Function
main
()
scripts/backfill_embeddings.py:68
↓ 1 callers
Function
main
()
scripts/benchmark_providers.py:213
↓ 1 callers
Function
main
()
scripts/backfill_entities.py:91
↓ 1 callers
Function
main
()
scripts/reconcile_stores.py:64
next →
1–100 of 334, ranked by callers