All Products
Search
Document Center

AI Coding Assistant Lingma:Knowledge base as context for chat

Last Updated:Apr 22, 2025

Enable a knowledge base as a context for chat so Lingma can use internal company documents and files, to give answers that better fit the company's needs.

Who can use this feature?

  • Editions: Lingma Enterprise Dedicated

  • Roles: Lingma admins and global admins in an organization

Lingma admins and global admins in an organization can add or remove files in a knowledge base. They can also turn the knowledge base feature on or off from the Knowledge Base page in Lingma console.

image

Manage a knowledge base

Lingma admins and global admins in an organization can manage a knowledge base and its access controls. For example, admins can:

  • Create, edit, and remove a knowledge base.

  • Add or remove enterprise members.

  • Add or remove documents in a knowledge base.

Create, edit, and delete a knowledge base

Create a knowledge base

  1. Click Knowledge Base in the left-side navigation pane to go to the Knowledge Base page.

  2. Click Create Knowledge Base.

  3. In the panel that appears, do the following:

    1. Select Chat under Scenarios. This is the default option.

    2. Enter a name for the knowledge base. Pick a name that is easy to recognize.

    3. (Optional) Write a description that tells what the knowledge base is about.

    4. Choose who can access the knowledge base under Access Control. By default, it's set to Private - Any member in this knowledge base.

  4. Click OK to save the information.

After the knowledge base is created, it appears in the list.

image

Edit a knowledge base

Admins can change the basic information of a knowledge base, like the name, description, and access control, using either of the following methods:

  • On the list page: Find a knowledge base you want to edit from the list on the Knowledge Base page, and click the Edit icon in the Actions column.

  • On the detail page: Select a knowledge base from the list on the Knowledge Base page, and then click the Edit icon in the top-right corner of the page that appears.

Delete a knowledge base

To delete a knowledge base, click on it, then click the More icon, and select Delete Knowledge Base. Confirm by entering the knowledge base name, and click OK.

Important

Once deleted, a knowledge base cannot be restored. Proceed with caution. Re-create a knowledge base and populate data if needed.

Add documents

image

Here's how Lingma admins and global admins in an organization add data to the knowledge base:

  1. Select a knowledge base from the list to enter the details page.

  2. Click Add Data.

  3. On the Add Data panel, select Document as the data type, then drag the file to the gray area. Keep these tips in mind:

    • You can upload up to 10 files at a time.

    • Supported formats include pdf, docx, txt, markdown, and csv.

    • Each file must be 5 MB or smaller.

    • File names must be 200 characters or less. Only UFT-8 and GBK encoded files are supported.

    • Use structured documents to make sure the information is easy to find.

After the file is uploaded, click Add. This starts the data processing.

image

Enable or disable knowledge base

After the file data is processed, admins can enable or disable the knowledge base using one of the following methods:

  • On the list page: Find the knowledge base you want to manage from the list on the Knowledge Base page, then click Toggle.

    image

  • On the details page: Click the knowledge base you want to manage in the knowledge base list on the Knowledge Base page, and then click Toggle knowledge base as context for chat.

    image

After the feature is enabled, when authorized developers chat with Lingma in the IDE, Lingma will answer questions based on the data in the knowledge base that is visible to the authorized developers. You can disable this feature if you don't need it.image

Access control

Lingma admins and global admins in an organization can change the access control for a knowledge base using either of the following methods:

  • Go to the edit mode of the knowledge base and change the access control settings.

  • Go to the knowledge base page, click Access Control, and add or remove the members.

image

Note

After knowledge base as context for chat is enabled, developers can start a chat using #teamDocs. Lingma will answer questions based on the knowledge base data for authorized developers.

Check the processing status of your documents

After documents are uploaded, the system converts the data into vectors that can be searched. You can see the data processing status in the document list. The possible statuses are:

  • Awaiting: The system processes uploaded documents in sequence. Documents that are not processed are queued.

  • Processing: The system is analyzing and processing the data as vectors.

  • Completed: The system has finished analyzing and processing the document.

  • Error: An exception occurred while processing the document. You can check the status to find out what went wrong, and choose to reprocess or delete the document.

  • Duplicate Files: The file is a duplicate, and won't be processed again. You can delete the duplicate file.

Update documents

To update a document, click Add Data to upload a new version. Once the upload is completed, the system will process the document again.

Delete documents

Click Delete in the Actions column to remove a wrong, duplicate, or unneeded document. To delete multiple documents at a time, select the ones you want to delete and click Delete.