DEV Community

Cover image for Optimize NotebookLM Input with mq: Efficient Markdown File Merging
Takahiro Sato
Takahiro Sato

Posted on • Edited on

Optimize NotebookLM Input with mq: Efficient Markdown File Merging

Uploading multiple Markdown files to NotebookLM one by one is tedious. mq solves this by merging and filtering files into a single, optimized input for better AI analysis.

demo

Basic File Merging

Merge all content from multiple files:

mq --separator 's"\nFILE: ${__FILE__}\n"' 'identity()' notes/*.md > merged.md
Enter fullscreen mode Exit fullscreen mode

Extract Key Information

Keep only headers and links for focused analysis:

mq --separator 's"\nFILE: ${__FILE__}\n"' 'select(or(.h, .link))' notes/*.md > merged.md
Enter fullscreen mode Exit fullscreen mode

Include code blocks too:

mq --separator 's"\nFILE: ${__FILE__}\n"' 'select(or(.h, .link, .code))' notes/*.md > merged.md
Enter fullscreen mode Exit fullscreen mode

Common Use Cases

  • Documentation: Combine README, API docs, and guides
  • Research: Merge papers, notes, and references
  • Projects: Consolidate specs, meeting notes, and plans

Upload the generated merged.md to NotebookLM for streamlined AI-powered analysis and Q&A.


Top comments (0)