mind_map_prompt.py
Overview
This file, mind_map_prompt.py, defines a single constant string variable MIND_MAP_EXTRACTION_PROMPT which serves as a pre-formulated prompt template for a text processing task. The prompt is designed for use with a natural language processing (NLP) model or AI system tasked with summarizing arbitrary text into a structured mind map format.
The prompt instructs the AI to:
Generate a title for the input text.
Break down the text into mind map sections and sub-sections (up to at least 4 levels).
Summarize each bottom-level section briefly.
Output the mind map in Markdown format.
Maximize the number of subsections to capture complexity.
Produce the output in the same language as the input text.
This file is likely a utility or configuration resource used by the larger InfiniFlow system to guide AI-powered text summarization and visualization workflows.
Components
Constant: MIND_MAP_EXTRACTION_PROMPT
Description
MIND_MAP_EXTRACTION_PROMPT is a multi-line string containing detailed instructions and formatting rules for generating a mind map from a given piece of text. It is designed to be formatted with an input_text placeholder where the actual text to be processed is inserted.
Content Breakdown
Role: Defines the AI's role as a "talent text processor" focused on summarization into mind maps.
Step of task:
Generate a title for the user's text.
Classify the text into hierarchical mind map sections.
For complex topics, recursively subdivide sections into sub-sections.
Add brief content summaries at the lowest section level.
Output requirement:
At least 4 hierarchical levels.
Maximize the number of sub-sections (to capture detail).
Output must be in the input text's language.
Output must be in Markdown format.
Placeholder:
{input_text}: This is where the actual text to be summarized is injected when the prompt is used.
Usage Example
from mind_map_prompt import MIND_MAP_EXTRACTION_PROMPT
input_text = "The solar system consists of the Sun and the objects bound to it by gravity..."
prompt = MIND_MAP_EXTRACTION_PROMPT.format(input_text=input_text)
# `prompt` can then be sent to a language model API for processing.
result = language_model.generate(prompt)
print(result)
Implementation Details
The file contains no classes, functions, or methods—only a single constant string.
The prompt is carefully crafted to guide the AI model toward generating structured, multilayered mind maps from raw text.
The instructions emphasize structure, language consistency, and output format to ensure compatibility and usability downstream.
The use of Markdown format facilitates easy rendering of the mind maps in markdown viewers or conversion to other formats.
Integration and Interaction
This file is intended to be imported wherever the InfiniFlow system requires a prompt template for mind map extraction.
It acts as a standardized instruction set to maintain consistency in how text is parsed and summarized by AI components.
The output generated from using this prompt can be further processed by other modules in the system, such as visualization tools, note-taking apps, or knowledge management components.
It does not perform any text processing itself but provides the foundation for prompt-based AI workflows.
Visual Diagram
The following Mermaid class diagram illustrates the structure and role of the mind_map_prompt.py file within the system:
classDiagram
class mind_map_prompt.py {
+MIND_MAP_EXTRACTION_PROMPT: str
}
mind_map_prompt.py ..> "AI Language Model" : provides prompt to
"AI Language Model" --> "Mind Map Output" : generates structured Markdown mind map
"Mind Map Output" --> "Visualization Module" : consumed by
mind_map_prompt.pydefines the prompt constant.The prompt is sent to an AI language model to generate the mind map.
The generated mind map is then used by visualization or other application modules.
Summary
This file is a concise but critical resource in the InfiniFlow ecosystem, providing a reusable, well-defined prompt to enable consistent extraction of mind maps from arbitrary text inputs via AI models. It encapsulates best practices and detailed instructions for hierarchical text summarization, ensuring that downstream components receive well-structured, language-consistent, Markdown-formatted mind maps ready for visualization or further processing.