Enhanced LanceDB memory plugin for OpenClaw — Hybrid Retrieval (Vector + BM25), Cross-Encoder Rerank, Multi-Scope Isolation, Management CLI
This report presents the forensic synthetic code analysis of CortexReach/memory-lancedb-pro, a JavaScript project with 4,454 GitHub stars. SynthScan v2.0 examined 49,410 lines of code across 93 source files, recording 231 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 5.0 places this repository in the Low AI signal band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 231 distinct pattern matches across 9 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | cli.ts | 89 | function resolveOpenClawConfigPath(explicit?: string): string { | CODE |
| LOW | cli.ts | 119 | function resolveConfiguredOauthPath(configPath: string, rawPath: unknown): string { | CODE |
| LOW | cli.ts | 152 | function extractRestorableApiKeyLlmConfig(value: unknown): RestorableApiKeyLlmConfig { | CODE |
| LOW | cli.ts | 176 | function extractOauthSafeLlmConfig(value: unknown): RestorableApiKeyLlmConfig { | CODE |
| LOW | cli.ts | 191 | function hasRestorableApiKeyLlmConfig(value: RestorableApiKeyLlmConfig): boolean { | CODE |
| LOW | cli.ts | 195 | function buildLogoutFallbackLlmConfig(value: unknown): RestorableApiKeyLlmConfig { | CODE |
| LOW | cli.ts | 262 | async function promptOauthProviderSelection( | CODE |
| LOW | cli.ts | 360 | async function resolveOauthProviderSelection( | CODE |
| LOW | cli.ts | 511 | function formatRetrievalDiagnosticsLines(diagnostics: { | CODE |
| LOW⚡ | index.ts | 541 | function getEffectiveAutoRecallMaxItems(config: PluginConfig): number { | CODE |
| LOW⚡ | index.ts | 547 | function getAutoRecallRetrieveLimit(autoRecallMaxItems: number): number { | CODE |
| LOW⚡ | index.ts | 551 | function getAutoRecallRerankInputLimit(retrieveLimit: number): number { | CODE |
| LOW⚡ | index.ts | 555 | function getAutoRecallRerankTimeoutMs( | CODE |
| LOW⚡ | index.ts | 2264 | function isSessionBoundaryReflectionAction(action: unknown): boolean { | CODE |
| LOW⚡ | index.ts | 2271 | function getReflectionEmptyEventGuardMap(): Map<string, ReflectionEmptyEventGuardEntry> { | CODE |
| LOW⚡ | index.ts | 2277 | function pruneReflectionEmptyEventGuard(now = Date.now()): void { | CODE |
| LOW | index.ts | 379 | function resolveWorkspaceDirFromContext(context: Record<string, unknown> | undefined): string { | CODE |
| LOW | index.ts | 401 | function isSupportedSecretRefSource(value: unknown): value is SecretRefSource { | CODE |
| LOW | index.ts | 451 | function resolveSecretCredentialArray( | CODE |
| LOW | index.ts | 473 | function resolveOptionalPathWithEnv( | CODE |
| LOW | index.ts | 570 | export function buildAutoRecallRerankCostWarning( | CODE |
| LOW | index.ts | 638 | function resolveSourceFromSessionKey(sessionKey: string | undefined): string { | CODE |
| LOW | index.ts | 645 | function summarizeAgentEndMessages(messages: unknown[]): string { | CODE |
| LOW | index.ts | 828 | export function getExtensionApiImportSpecifiers( | CODE |
| LOW | index.ts | 955 | function extractJsonObjectFromOutput(stdout: string): Record<string, unknown> { | CODE |
| LOW | index.ts | 973 | function extractReflectionTextFromCliResult(resultObj: Record<string, unknown>): string | null { | CODE |
| LOW | index.ts | 1084 | export function buildReflectionCliSpawnCommand( | CODE |
| LOW | index.ts | 1100 | async function loadSelfImprovementReminderContent(workspaceDir?: string): Promise<string> { | CODE |
| LOW | index.ts | 1114 | function resolveAgentPrimaryModelRef(cfg: unknown, agentId: string): string | undefined { | CODE |
| LOW | index.ts | 1194 | function isInternalReflectionSessionKey(sessionKey: unknown): boolean { | CODE |
| LOW | index.ts | 1223 | function shouldSkipReflectionMessage(role: string, text: string): boolean { | CODE |
| LOW | index.ts | 1261 | function isExplicitRememberCommand(text: string): boolean { | CODE |
| LOW | index.ts | 1266 | export function buildAutoCaptureConversationKeyFromIngress( | CODE |
| LOW | index.ts | 1285 | function buildAutoCaptureConversationKeyFromSessionKey(sessionKey: string): string | null { | CODE |
| LOW | index.ts | 1356 | function extractTextFromToolResult(result: unknown): string { | CODE |
| LOW | index.ts | 1380 | function summarizeRecentConversationMessages( | CODE |
| LOW | index.ts | 1406 | async function readSessionConversationForReflection(filePath: string, messageCount: number): Promise<string | null> { | CODE |
| LOW | index.ts | 1427 | export async function readSessionConversationWithResetFallback(sessionFilePath: string, messageCount: number): Promise<s | CODE |
| LOW | index.ts | 1576 | function buildReflectionFallbackText(): string { | CODE |
| LOW | index.ts | 1674 | async function generateReflectionTextUnbounded( | CODE |
| LOW | index.ts | 2140 | function createAdmissionRejectionAuditWriter( | CODE |
| LOW | index.ts | 2291 | async function getReflectionEmptyEventGuardKey(params: { | CODE |
| LOW | index.ts | 2623 | function isPluginExplicitlyDisabled(config: Record<string, unknown>, pluginName: string): boolean { | CODE |
| LOW | index.ts | 2633 | export function warnForDisabledChannelPlugin( | CODE |
| LOW | index.ts | 5329 | function scheduleNextDreamingSweep() { | CODE |
| LOW | src/workspace-boundary.ts | 44 | export function resolveUserMdExclusiveConfig( | CODE |
| LOW | src/workspace-boundary.ts | 58 | export function shouldFilterUserMdExclusiveRecall( | CODE |
| LOW | src/batch-dedup.ts | 140 | export function createExtractionCostStats(): ExtractionCostStats { | CODE |
| LOW | src/auto-capture-cleanup.ts | 28 | function stripLeadingInboundMetadata(text: string): string { | CODE |
| LOW | src/auto-capture-cleanup.ts | 47 | function stripAutoCaptureSessionResetPrefix(text: string): string { | CODE |
| LOW | src/auto-capture-cleanup.ts | 65 | function stripAutoCaptureAddressingPrefix(text: string): string { | CODE |
| LOW | src/auto-capture-cleanup.ts | 69 | function stripRuntimeWrapperBoilerplate(text: string): string { | CODE |
| LOW | src/auto-capture-cleanup.ts | 90 | function stripLeadingRuntimeWrappers(text: string): string { | CODE |
| LOW | src/auto-capture-cleanup.ts | 123 | export function stripAutoCaptureInjectedPrefix(role: string, text: string): string { | CODE |
| LOW | src/memory-upgrader.ts | 95 | function isCurrentReflectionMemory(entry: MemoryEntry): boolean { | CODE |
| LOW | src/memory-categories.ts | 129 | export function matchesMemoryCategoryFilter( | CODE |
| LOW | src/memory-categories.ts | 155 | export function resolveCategoryFilterCandidates(requestedCategory: string): string[] { | CODE |
| LOW | src/memory-categories.ts | 173 | export function getStorageCategoryForMemoryCategory( | CODE |
| LOW | src/memory-categories.ts | 179 | export function resolveToolMemoryCategory(rawCategory: string): { | CODE |
| LOW | src/memory-categories.ts | 209 | function extractMetadataMemoryCategory(rawMetadata?: string): MemoryCategory | null { | CODE |
| 112 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | openclaw.plugin.json | 1714 | "placeholder": "sk-proj-... or [\"key1\", \"key2\"] for rotation", | CODE |
| LOW⚡ | openclaw.plugin.json | 1719 | "placeholder": "text-embedding-3-small", | CODE |
| LOW⚡ | openclaw.plugin.json | 1724 | "placeholder": "https://api.openai.com/v1", | CODE |
| LOW⚡ | openclaw.plugin.json | 1730 | "placeholder": "auto-detected from model", | CODE |
| LOW⚡ | openclaw.plugin.json | 1736 | "placeholder": "omit by default", | CODE |
| LOW⚡ | openclaw.plugin.json | 1802 | "placeholder": "24", | CODE |
| LOW⚡ | openclaw.plugin.json | 1808 | "placeholder": "7", | CODE |
| LOW⚡ | openclaw.plugin.json | 1814 | "placeholder": "300000", | CODE |
| LOW⚡ | openclaw.plugin.json | 1820 | "placeholder": "0", | CODE |
| LOW⚡ | openclaw.plugin.json | 1826 | "placeholder": "redis://localhost:6379", | CODE |
| LOW⚡ | openclaw.plugin.json | 1838 | "placeholder": "redis://localhost:6379", | CODE |
| LOW⚡ | openclaw.plugin.json | 1845 | "placeholder": "memory-lancedb-pro:write-lock", | CODE |
| LOW⚡ | openclaw.plugin.json | 1851 | "placeholder": "60000", | CODE |
| LOW⚡ | openclaw.plugin.json | 1857 | "placeholder": "5000", | CODE |
| LOW⚡ | openclaw.plugin.json | 1863 | "placeholder": "50", | CODE |
| LOW⚡ | openclaw.plugin.json | 1869 | "placeholder": "1000", | CODE |
| LOW⚡ | openclaw.plugin.json | 1880 | "placeholder": "sk-... or ${GROQ_API_KEY}", | CODE |
| LOW⚡ | openclaw.plugin.json | 1885 | "placeholder": "openai/gpt-oss-120b", | CODE |
| LOW⚡ | openclaw.plugin.json | 1890 | "placeholder": "https://api.groq.com/openai/v1", | CODE |
| LOW⚡ | openclaw.plugin.json | 2045 | "placeholder": "jina_... / sk-... / pcsk_...", | CODE |
| LOW⚡ | openclaw.plugin.json | 2051 | "placeholder": "jina-reranker-v3", | CODE |
| LOW⚡ | openclaw.plugin.json | 2057 | "placeholder": "https://api.jina.ai/v1/rerank", | CODE |
| LOW⚡ | openclaw.plugin.json | 2063 | "placeholder": "5000", | CODE |
| LOW | openclaw.plugin.json | 1747 | "placeholder": "retrieval.query", | CODE |
| LOW | openclaw.plugin.json | 1753 | "placeholder": "retrieval.passage", | CODE |
| LOW | openclaw.plugin.json | 1764 | "placeholder": "model-specific default", | CODE |
| LOW | openclaw.plugin.json | 1785 | "placeholder": "30000", | CODE |
| LOW | openclaw.plugin.json | 1791 | "placeholder": "~/.openclaw/memory/lancedb-pro", | CODE |
| LOW | openclaw.plugin.json | 2218 | "placeholder": "anthropic/claude-sonnet-4-6", | CODE |
| LOW | openclaw.plugin.json | 2327 | "placeholder": "30000", | CODE |
| LOW | openclaw.plugin.json | 2366 | "placeholder": "0 3 * * *", | CODE |
| LOW | openclaw.plugin.json | 2371 | "placeholder": "anthropic/claude-sonnet-4-6", | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/memory-upgrader.ts | 344 | // Step 1: Reverse-map category | COMMENT |
| LOW⚡ | src/memory-upgrader.ts | 347 | // Step 2: Generate L0/L1/L2 | COMMENT |
| LOW | src/memory-upgrader.ts | 396 | // Step 3: Build enriched metadata | COMMENT |
| LOW | src/smart-extractor.ts | 389 | // Step 1: LLM extraction | COMMENT |
| LOW | src/smart-extractor.ts | 432 | // Step 2: Process each surviving candidate through dedup pipeline. | COMMENT |
| LOW | src/smart-extractor.ts | 735 | // Step 1: LLM Extraction | COMMENT |
| LOW | src/smart-extractor.ts | 837 | // Step 2: Dedup + Persist | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | src/memory-upgrader.ts | 344 | // Step 1: Reverse-map category | COMMENT |
| LOW⚡ | src/memory-upgrader.ts | 347 | // Step 2: Generate L0/L1/L2 | COMMENT |
| LOW | src/memory-upgrader.ts | 396 | // Step 3: Build enriched metadata | COMMENT |
| LOW | src/smart-extractor.ts | 389 | // Step 1: LLM extraction | COMMENT |
| LOW | src/smart-extractor.ts | 432 | // Step 2: Process each surviving candidate through dedup pipeline. | COMMENT |
| LOW | src/smart-extractor.ts | 735 | // Step 1: LLM Extraction | COMMENT |
| LOW | src/smart-extractor.ts | 837 | // Step 2: Dedup + Persist | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | index.ts | 2661 | kind: "memory" as const, | COMMENT |
| LOW | .github/workflows/claude.yml | 41 | actions: read | COMMENT |
| LOW | src/auto-recall-tier1.ts | 1 | import type { SmartMemoryMetadata } from "./smart-metadata.ts"; | COMMENT |
| LOW | src/store.ts | 141 | if (!lancedbImportPromise) { | COMMENT |
| LOW | src/store.ts | 601 | }> = []; | COMMENT |
| LOW | src/store.ts | 1201 | entry: Omit<MemoryEntry, "id" | "timestamp">, | COMMENT |
| LOW | src/smart-extractor.ts | 101 | // remainder. This avoids erasing legitimate inline payload that merely quotes | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | cli.ts | 967 | // ── Deduplication check (scope-aware exact match) ─────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/jsonl_distill.py | 312 | except Exception: | CODE |
| LOW | scripts/jsonl_distill.py | 436 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/jsonl_distill.py | 17 | CODE | |
| LOW | scripts/jsonl_distill.py | 24 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/jsonl_distill.py | 98 | CODE |