Prompt file imported from nonlinear/literature (
.github/prompts/literature.prompt.md). Copyright stays with the author.
Literature Research
Purpose: Search indexed books using RAG to answer questions based on book contents.
Instructions for AI
When this prompt is activated:
-
Check if user specified a folder:
- Look for patterns like: "use oracles:", "from AI folder:", "search in urbanism:"
- If folder specified, search ONLY in that folder
- Check
~/Documents/literature/books/for available folders
-
If NO folder specified, analyze the question to identify relevant topics:
- Read all
.rag-topicsfiles in~/Documents/literature/books/*/ - Match question keywords against topics in each folder
- Identify which folders contain relevant books
- Read all
-
Consult the RAG system:
- Use as ferramentas MCP para consultar os livros relevantes
- Foque na pasta especificada OU nas pastas cujos tópicos correspondem à pergunta
- Recupere trechos e citações relevantes
-
Provide answer with sources:
-
When mentioning an answer that has a source, add a reference in parentheses at the end of the sentence or term, like (1), (2), (3).
-
At the end, list sources as a numbered list, each with the file:// link and a 5-word string to search, like this:
-
📚 Sources:
-
file:///Users/nfrota/Documents/literature/books/folder/book.epub "five sequential words here"
-
file:///Users/nfrota/Documents/literature/books/folder/another_book.epub "another five word example"
-
If no relevant books found:
- Explain which topics you searched
- List available folders and their topics
- Suggest how to rephrase the question
Advanced MCP Arguments
You can use these arguments in your MCP JSON requests for more control:
question: The main query string.book_context: (optional) Specify a book or folder for focused search.auto_detect: (optional, default true) Set to false to disable topic auto-detection.max_sources: (optional) Limit the number of sources returned (e.g., 5).return_snippets: (optional) If true, include text snippets from sources.return_metadata: (optional) If true, include extra metadata (author, year, etc.).
Example MCP JSON request:
{
"method": "tools/call",
"arguments": {
"return_snippets": true,
"return_metadata": true
---
## Available Topics
Current indexed folders and keywords:
- **AI:** ethics, UX, machine learning, algorithmic bias, software design
- **anthropocene:** ecology, forests, indigenous knowledge, climate
- **art direction:** generative design, creative coding, Processing
- **fiction:** sci-fi narratives (limited support)
- **oracles:** I Ching, hexagrams, divination
- **system theory:** complexity, emergence, gradients, simulation
- **urbanism:** legibility, state power, planning, high modernism
- **usability:** content strategy, validation, writing, UX
---
## Debug Commands
# View keywords for a folder
cat ~/Documents/literature/books/AI/.rag-topics
Tips
To ensure RAG activates:
- Mention topics explicitly (e.g., "according to I Ching")
- Ask conceptual questions rather than generic ones
- "What is legibility?" → urbanism/ Examples that might NOT trigger:
- "How are you today?" (social, not knowledge-based)