Repository Index
CodeArts Agent provides a repository index function to help you quickly search and retrieve code-related information. This function supports creating both local user indexes and cloud-shared indexes, flexibly adapting to the requirements of different scenarios.
Constraints
| Category | Description |
|---|---|
| Language | Java, JavaScript, TypeScript, and Go are supported. |
| Total number of code files |
|
Differences Between Local User Indexes and Cloud Indexes
| Dimension | Local User Index | Cloud Index |
|---|---|---|
| Used by | Current user |
|
| Repository type | Unlimited | Git and GitHub repositories are supported. |
Prerequisites
An enterprise administrator has joined a team, if they want to create a team repository index.
Creating Indexes
You can create local user indexes and cloud indexes.
- Log in to CodeArts Agent IDE as instructed in Quick Start.
- Click
in the upper right corner of CodeArts Agent IDE to open the settings page. - In the navigation pane on the left, choose Repository Index.
- Enable the index function.
- Automatic indexing: After Auto Update is enabled, CodeArts Agent will automatically create and update indexes for repositories containing 50,000 or fewer files.
After enabling this function, CodeArts Agent will perform incremental updates every 5 minutes to ensure the agent always analyzes and responds based on the latest code.
- Manual indexing: When the number of files in a local repository exceeds 50,000, you need to click Create Index to manually build an index.
- Automatic indexing: After Auto Update is enabled, CodeArts Agent will automatically create and update indexes for repositories containing 50,000 or fewer files.
- View the indexing results.
Once the index is successfully built, the page will show the progress at 100%.
Figure 1 Index created
- (Optional) Use the index in the intelligent Q&A mode.
To use the index in the intelligent Q&A mode, first ensure that the indexing process is completed. Then, at the bottom of the input box on the chat panel, click
to search for indexes. When the icon changes to
, the index function is enabled.
If your account has been assigned a seat, you can create cloud repository indexes. If not, you cannot create them.
- Log in to the CodeArts Agent console.
- In the navigation pane on the left, choose Agent Settings > Repository Index.
- Click Create Index.
- Set basic index information by referring to Table 3 and click Next.
Table 3 Repository index parameters Parameter
Description
Visible To
Visible scope of the repository index.
- User: available only to members themselves.
- Team: available only to team members and created by the enterprise administrator, team administrator, or team members.
- Enterprise: available to all enterprise members and created by the enterprise administrator, team administrator, enterprise members, or team members.
Teams
This parameter is displayed only when Visible To is set to Team.
Select a team from the drop-down list; only the teams which the current account belongs to are displayed.
Code Source
Source of the code repository that you want to index.
- Git: a general Git repository.
- GitHub: a GitHub repository, which can be a public repository or an authorized private repository.
Authorization Method
Method to authorize the system to access your code source.
- Authorize by Service: Select a service endpoint from the drop-down list. The endpoint corresponds to the connection information of the GitHub or Git repository.
If no service endpoint has been created, click Add to create one by referring to Table 4.
- Authorize by Personal Token: Authorize access requests using an access token generated from your personal account.
Default Branch
This parameter is displayed only when Code Source is set to Git.
Enter the branch name of a Git repository. The branch name can contain a maximum of 200 characters.
Figure 2 Creating a service endpoint
Table 4 Service endpoint parameters Parameter
Description
Connection Name
Name of the custom repository to be connected.
Naming rules: The name can contain letters, digits, underscores (_), and hyphens (-), but cannot start with an underscore.
Git URL
This parameter is displayed only when Code Source is set to Git.
HTTPS access address of the Git repository
User Name
This parameter is displayed only when Code Source is set to Git.
User name for HTTPS authentication of the Git repository.
Password or Access Token
This parameter is displayed only when Code Source is set to Git.
Password or access token for HTTPS authentication of the Git repository.
Access Token
This parameter is displayed only when Code Source is set to Github.
Access token for HTTPS authentication of the GitHub repository.
- Select the repository and language, and click OK to finish creating the index.
On the repository index page, view the newly created repository index. When its status changes from parsing to parsing completed, the repository index has been successfully parsed.
- Return to the CodeArts Agent IDE client and open the Git, Repo, or GitHub repository project. CodeArts Agent automatically downloads team repository indexes from the cloud.
After the team repository indexes are successfully downloaded, the progress displayed on the page reaches 100%.
If the number of files in the repository is greater than 50,000, click Create Index to manually build the repository index.
- (Optional) Use the index in the intelligent Q&A mode.
To use the index in the intelligent Q&A mode, first ensure that the indexing process is completed. Then, at the bottom of the input box on the chat panel, click
to search for indexes. When the icon changes to
, the index function is enabled.
Managing Repository Indexes
After a repository index is built, you can manage it throughout its lifecycle.
Beyond creation, local repository indexes support operations such as restarting and deleting. For details, see Table 5.
| Operation | Instruction |
|---|---|
| Stop indexing | Click Stop to halt the indexing process at any time. |
| Restart indexing | To resume a paused indexing process, click Resume Indexing. |
| Update indexes | Incremental update is supported. The system compares the current status with the result of the last update, indexes the added or modified code files, and skips unchanged files to save time. |
| Reindex | If you need to rebuild an index entirety, click Reindex to trigger a complete indexing process. |
| Delete indexes | To clear all current index data, click Delete Index. |
| Ignore files in the current directory | If you want to exclude any file in the current folder from being indexed, click Configure. Then, in .codebaseignore, specify the file name. |
Table 6 shows the operation permissions of different roles to delete repository indexes.
| Role | Enterprise-Level Repository Index | Team-Level Repository Index | User-Level Repository Index |
|---|---|---|---|
| Enterprise administrator | All repository indexes | All repository indexes of the administrator's team | All repository indexes created by the user |
| Team administrator | All repository indexes created by the user | All repository indexes created by team administrator and members of the team managed by the team administrator | All repository indexes created by the user |
| Team member | All repository indexes created by the user | All repository indexes created by the user | All repository indexes created by the user |
| Enterprise member | All repository indexes created by the user | No operation permissions. | All repository indexes created by the user |
| Operation | Procedure |
|---|---|
| Delete a specified repository index. | When there are only several indexes, you can delete them one by one.
|
| Delete the repository indexes in a batch. | If there are many indexes, you can delete them in batches.
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot