Skip to content

feat: add .mempalaceignore support + fix ChromaDB telemetry spam - #144

Closed
Matt-GPT-6 wants to merge 1 commit into
MemPalace:mainfrom
Matt-GPT-6:feat/mempalaceignore-and-telemetry-fix
Closed

feat: add .mempalaceignore support + fix ChromaDB telemetry spam#144
Matt-GPT-6 wants to merge 1 commit into
MemPalace:mainfrom
Matt-GPT-6:feat/mempalaceignore-and-telemetry-fix

Conversation

@Matt-GPT-6

Copy link
Copy Markdown

Summary

Two focused fixes in one PR:

1. .mempalaceignore file support (closes #102)

Users can now create a .mempalaceignore (or .mempalace-ignore) file in any project directory to exclude files from mining — using the exact same syntax as .gitignore.

Why this matters: Issue #102 reported that mempalace mine scoops up junk files. While .gitignore is already honored, many files that should be excluded from memory (credentials, drafts, large data files) shouldn't necessarily be in .gitignore. A separate ignore file gives users fine-grained control without modifying their project's git config.

How it works:

  • .mempalaceignore is always applied — even when --no-gitignore is passed (so users can skip gitignore but still respect mempalace-specific exclusions)
  • Supports the full .gitignore syntax: globs, directory-only rules, negation (!keep-this.py), anchored patterns, ** wildcards
  • Works at any directory depth, just like nested .gitignore files
  • Both .mempalaceignore and .mempalace-ignore filenames are accepted
  • Both filenames are auto-excluded from mining (added to SKIP_FILENAMES)
  • Refactored GitignoreMatcherIgnoreFileMatcher with a backwards-compatible alias so existing imports and tests don't break

2. Fix ChromaDB/posthog telemetry error spam

Every CLI command printed Failed to send telemetry event ClientStartEvent: capture() takes 1 positional argument but 3 were given to stderr.

Root cause: ChromaDB 0.6.x calls posthog.capture(user_id, event_name, properties) with positional args, but posthog >= 7.0 changed capture() to keyword-only args. The env var ANONYMIZED_TELEMETRY=False doesn't prevent the broken call from firing.

Fix: Neutralize posthog.capture early in __init__.py before ChromaDB initializes. MemPalace is a local-only tool — upstream telemetry is not useful.

Test plan

  • All 20 existing tests pass (no regressions)
  • 5 new tests added for .mempalaceignore behavior:
    • Basic file and directory exclusion
    • Works even with respect_gitignore=False
    • .mempalace-ignore (hyphenated) variant
    • Negation patterns (!keep.csv)
    • Overrides files that .gitignore would allow
  • Manual verification: mempalace status, mempalace search produce clean output with no telemetry errors
  • 25/25 tests pass on Python 3.13, macOS ARM64

Made with Cursor

Two changes:

1. .mempalaceignore / .mempalace-ignore file support (closes MemPalace#102)

   Users can now create a .mempalaceignore (or .mempalace-ignore) file
   in any directory using the same syntax as .gitignore to exclude files
   from mining without modifying their project's .gitignore.

   - .mempalaceignore is always applied (even with --no-gitignore)
   - Supports negation patterns (e.g. !keep-this.py)
   - Works at any directory level, just like .gitignore
   - Both filename variants are auto-excluded from mining
   - Refactored GitignoreMatcher → IgnoreFileMatcher with a
     backwards-compatible alias

2. Fix ChromaDB/posthog telemetry error on every command

   ChromaDB 0.6.x bundles posthog for anonymous telemetry, but
   posthog>=7.0 changed capture() to keyword-only args, causing
   "Failed to send telemetry event" on every CLI invocation.
   Neutralize the call early in __init__.py since MemPalace is
   a local-only tool with no use for upstream telemetry.

Includes 5 new tests covering .mempalaceignore behavior.
All 25 tests pass.

Made-with: Cursor
@bensig

bensig commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Thanks! .gitignore support already landed in #78 which covers most of this. A separate .mempalaceignore is tracked in #102. The telemetry fix is a good catch though — could you open a focused PR for just that piece?

@PaTiToMaSteR

Copy link
Copy Markdown

@bensig if scans the code as it is, consumes 3 times the tokens compared with GREP. .mempalace-ignore to only scan *.md make it incredibly great, run a test performs much more! we have:

  1. MCP layer consumes more than tool execution: mempalace search "" is way cheaper than the MCP layer
  2. GREP performs better than the mempalace search, that consume a lot of tokens
  3. for MD files or non-code knowledge seems to be incredibly great

Either there's a test to confirm that performs better for searching code lines, or we whitelist only *md files coz adding this MCP greatly consumes A LOT more on top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need some soft of .mempalace-ignore funtionality

4 participants