Skip to main content
GraphRAG supports processing and querying documents in multiple languages by leveraging multilingual language models. This guide shows you how to configure GraphRAG for non-English content and mixed-language datasets.

Language model selection

The key to multi-lingual support is choosing models that support your target languages:

GPT-4 and GPT-4 Turbo

Excellent support for 50+ languages including European, Asian, and Middle Eastern languages

GPT-3.5 Turbo

Good support for major languages, more cost-effective for large-scale processing

Multilingual embeddings

text-embedding-3-small and text-embedding-3-large support 100+ languages

Azure OpenAI

Same language support with additional compliance and regional deployment options

Basic configuration

No special configuration is needed for most languages. The default settings work well:
settings.yaml

Language-specific prompt tuning

For better results, customize prompts in your target language:
prompts/entity_extraction_es.txt

Processing mixed-language documents

When working with documents in multiple languages:
1

Organize by language

Optionally separate documents by language for better tracking:
2

Use language-agnostic prompts

For truly mixed content, use English prompts with instructions to handle multiple languages:
3

Configure language metadata

Track language information in your chunking configuration:

Querying in multiple languages

GraphRAG supports queries in different languages:
The LLM will attempt to respond in the same language as your query. For mixed-language datasets, you can specify the desired response language in your query.

Best practices for specific languages

  • Use larger chunk sizes due to character density
  • Consider using gpt-4 for better understanding of classical vs. modern Chinese
  • Test entity extraction with both simplified and traditional characters
  • Account for mixed scripts (Hiragana, Katakana, Kanji)
  • Use character-based rather than token-based chunking
  • Test entity extraction with company names (often use Kanji)
  • Ensure text encoding is UTF-8
  • Be aware that some entity names may be transliterated
  • Test with mixed RTL/LTR content (common in technical documents)
  • Long compound words may need special handling
  • Consider noun capitalization in entity extraction
  • Adjust chunk sizes for longer words

Example: Multi-lingual research corpus

Here’s a complete example for processing academic papers in multiple languages:
1

Prepare data

Organize papers with language metadata:
input/papers.csv
2

Configure for CSV input

settings.yaml
3

Create multilingual prompts

prompts/entity_extraction_multilingual.txt
4

Query across languages

Language detection and routing

For advanced use cases, implement language detection:

Troubleshooting

Solutions:
  • Use language-specific prompts
  • Run auto prompt tuning with documents in target language
  • Increase chunk size for languages with longer words/characters
  • Verify model supports your target language well
Solutions:
  • Explicitly specify response language in your query
  • Use language-specific system prompts
  • Separate documents by language during indexing
Solutions:
  • Ensure all files are UTF-8 encoded
  • Verify .env file doesn’t have encoding issues
  • Check that storage systems support Unicode

Supported languages

OpenAI models (GPT-4, GPT-3.5-turbo, embeddings) have strong support for:
  • English, Spanish, French, German, Italian
  • Portuguese, Dutch, Polish, Russian
  • Swedish, Norwegian, Danish, Finnish
  • Greek, Turkish, Czech, Romanian

Next steps

Custom prompts

Create language-specific prompts

Document Q&A

Build multilingual Q&A systems

Azure deployment

Deploy with regional Azure endpoints

Prompt tuning

Auto-tune prompts for your language