DEV Community

Atsushi
Atsushi

Posted on

Trying Out the New AI Functionality Added to GROWI

GROWI, an open-source Wiki is steadily undergoing development. In version 7.1, a highlight feature was the addition of AI functionality!

FireShot Capture 154 - _ - GROWI - localhost.jpg

This article explains how to use this new AI functionality.

About the AI Functionality in GROWI

GROWI is used as an internal Wiki by companies, communities, laboratories, and more, where a wealth of knowledge is accumulated. GROWI integrates Elasticsearch, which has been well-received for its search capabilities.

Building upon these search results, the AI functionality provides more intuitive responses using AI. By utilizing Elastic as a RAG (Retrieval-Augmented Generation), the feature allows users to receive responses based on content (publicly accessible) within the Wiki.

How to Use

The simplest way to use GROWI is by using Docker Compose.

https://github.com/weseek/growi-docker-compose
Enter fullscreen mode Exit fullscreen mode

Modifying the Dockerfile

When I tried it (as of November 8, 2024), there was an error: error setting certificate file: /etc/ssl/certs/ca-certificates.crt. To resolve this, I added ca-certificates to the Dockerfile.

# After modification
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
    && curl -sL https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
        | tar -xz -C /usr/local/bin
Enter fullscreen mode Exit fullscreen mode

Modifying the docker-compose.yml

This is the configuration when using the AI functionality. Add environment variables for app.

environment:
  - AI_ENABLED=true # Enable AI functionality
  - OPENAI_SERVICE_TYPE=openai # Specify the service type
  - OPENAI_API_KEY=xxxxx # Specify the API key
Enter fullscreen mode Exit fullscreen mode

For OPENAI_SERVICE_TYPE, specify either openai or azure-openai. Obtain the API key for the AI service you intend to use and set it for OPENAI_API_KEY.

The environment variables for the AI functionality are as follows. Adjust settings as needed.

Key Type Default Value
AI_ENABLED BOOLEAN false
OPENAI_SERVICE_TYPE STRING null
OPENAI_API_KEY STRING null (isSecret: true)
OPENAI_SEARCH_ASSISTANT_INSTRUCTIONS STRING null
OPENAI_CHAT_ASSISTANT_INSTRUCTIONS STRING Omitted. Check here for details
OPENAI_ASSISTANT_NAME_SUFFIX STRING null
OPENAI_THREAD_DELETION_CRON_EXPRESSION STRING '0 * * * *' (hourly)
OPENAI_THREAD_DELETION_CRON_MAX_MINUTES_UNTIL_REQUEST NUMBER 60
OPENAI_THREAD_DELETION_BARCH_SIZE NUMBER 100
OPENAI_THREAD_DELETION_API_CALL_INTERVAL NUMBER 36000 (msec)
OPENAI_VECTOR_STORE_FILE_DELETION_CRON_EXPRESSION STRING '0 * * * *' (hourly)
OPENAI_VECTOR_STORE_FILE_DELETION_CRON_MAX_MINUTES_UNTIL_REQUEST NUMBER 60
OPENAI_VECTOR_STORE_FILE_DELETION_BARCH_SIZE NUMBER 100
OPENAI_VECTOR_STORE_FILE_DELETION_API_CALL_INTERVAL NUMBER 36000 (msec)

How to Use the AI Functionality

If the settings are correctly configured, an AI icon will appear at the top of the Wiki page. Clicking on it will display a floating AI assistant.

image.png

You can then ask questions and receive answers.

FireShot Capture 155 - _ - GROWI - localhost.jpg

Notes

The current model is fixed to gpt-4o. It supports up to 30,000 tokens, so if the search results are too extensive, it may hit the limit. More focused queries are recommended.

Currently, responses are only returned as text. If citation sources link to pages, it would be even more convenient (hopefully in the future).

Summary

The AI functionality is still in beta, so we encourage you to try it out and provide feedback! By utilizing AI for internal knowledge management, productivity can be greatly improved. Consider introducing GROWI to help organize and systematize knowledge.

OSS Development Wiki Tool GROWI | Comfortable Information Sharing for Everyone

Top comments (0)