Skip to main content
ClaudeChatGPT

Good Practices

info

So far, Wren AI has been designed around OpenAI models. We understand that prompt customization for different models may be important to you. However, you currently cannot customize prompts in Wren AI, and some community members have already raised this feature request. You can follow the issue to get the latest status and share your feedback.

warning

After changing the configuration in ~/.wrenai/config.yaml, you need to restart Wren AI using the launcher and choose the "Custom" option to apply the changes.

  1. Set up Langfuse to trace the performance and issues of Wren AI.
  2. Start with the most powerful model you can afford, so you understand how far you can currently go with the model. If you are satisfied with the performance, you can stop there, or try weaker models if you want to save costs and improve latency.
  3. If you are using OpenAI models from the launcher, we will automatically skip the "column pruning" step. This can improve the latency of asking questions and also prevent losing any tables or columns you want to keep. If you are using other models, you can set the allow_using_db_schemas_without_pruning parameter to true in ~/.wrenai/config.yaml to achieve the same effect. However, this may feed many more tokens to the model and exceed the model's token limit.
  4. If you would like to reduce the latency of asking questions further, you can try these methods in the ~/.wrenai/config.yaml file: (Warning: This may affect the performance of asking questions.)
    • define allow_intent_classification: false to disable the intent classification step.
    • define allow_sql_generation_reasoning: false to disable the SQL generation reasoning step.
  5. When you are indexing the MDL, if you have so many columns that they exceed the token limit of the model, you can try reducing the value of the column_indexing_batch_size parameter.
  6. By default, Wren AI retrieves the top 10 tables from the vector database. You can change the value of table_retrieval_size in ~/.wrenai/config.yaml if needed.