init command generates a default configuration file and project structure for a new GraphRAG project.
Usage
Options
The project root directory where the configuration will be created.Aliases:
-rThe default chat/completion model to use for entity extraction, summarization, and other LLM operations.Aliases:
-mThis will be written to the settings.yaml configuration file and can be changed later.The default embedding model to use for generating vector embeddings.Aliases:
-eThis will be written to the settings.yaml configuration file.Force initialization even if the project already exists. This will overwrite existing configuration files.Aliases:
-fExamples
Initialize with default settings
Create a new project in the current directory:Initialize in a specific directory
Specify custom models
Force overwrite existing project
What gets created
When you rungraphrag init, the following files and directories are created:
Configuration files
settings.yaml- Main configuration file with indexing and search settings.env- Environment variables file for API keys and secrets
Directories
input/- Place your source documents here (text files, PDFs, etc.)prompts/- Contains all prompt templates used during indexing and querying
Prompt files
The following prompt templates are created in theprompts/ directory:
extract_graph.txt- Entity and relationship extractionsummarize_descriptions.txt- Entity description summarizationextract_claims.txt- Claim extraction (if enabled)community_report_graph.txt- Community report generation from graphcommunity_report_text.txt- Community report generation from textdrift_search_system_prompt.txt- DRIFT search system promptdrift_reduce_prompt.txt- DRIFT search reduce promptglobal_search_map_system_prompt.txt- Global search map phaseglobal_search_reduce_system_prompt.txt- Global search reduce phaseglobal_search_knowledge_system_prompt.txt- Global search knowledge instructionlocal_search_system_prompt.txt- Local search system promptbasic_search_system_prompt.txt- Basic search system promptquestion_gen_system_prompt.txt- Question generation system prompt
Next steps
After initializing your project:-
Add your API key to the
.envfile: -
Place your documents in the
input/directory -
Optionally customize
settings.yamlfor your use case -
Run the indexing pipeline:
Error handling
If you try to initialize a project that already exists, you’ll receive an error:--force flag to overwrite the existing configuration.