Skip to content

Bug: plain markdown files silently dropped from RAG index (0 chunks) #19

Description

@ch405canova-sudo

Bug report

Describe the bug
Markdown files that are not named readme.md and not located under a docs/ path are silently skipped during index_documents — they produce 0 chunks even though they exist.

To reproduce

  1. Create a file like knowledge/mahoo-architecture.md containing # Title\n\nsome content.
  2. Run index_documents on the parent directory.
  3. index_metadata shows 0 chunks for that file.

Expected behavior
Every .md file should be indexed as a docs source.

Environment

  • agent-memory-mcp v0.9.1
  • Ubuntu 24.04, Linux

Root cause
internal/rag/documents.go: processFile calls classifySourceType(relPath, "", "") with empty content, so the .md branch heuristic strings.Contains(contentLower, "# ") can never match. The result "" causes the file to be skipped. (There is a second call site in supportedSourceType with the same empty-content problem.)

Fix available
See PR #17 (classifies every .md file as docs, adds regression tests).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions