Skip to content

GitLab

The GitLab Datasource connects a GitLab repository to Cognipeer as a searchable knowledge source. Cognipeer recursively fetches all files from the specified project and branch, indexes their content, and makes it available for your Peer to retrieve during conversations.


Use Cases

  • Enable developers to ask questions about a codebase hosted on GitLab.
  • Index Markdown-based documentation living in a GitLab repository.
  • Power engineering chatbots or internal knowledge portals.
  • Support code review and onboarding by letting Peers explain repository structure.

Prerequisites

  • A GitLab Personal Access Token with read_api and read_repository scopes.
  • The numeric Project ID of the GitLab repository (visible on the project's main page).
  • The branch or tag you want to index (default: main).

Setting Up a GitLab Datasource

  1. Navigate to Datasources and click Add Datasource.
  2. Select GitLab as the datasource type.
  3. Fill in the required fields:
    • Project ID: The numeric ID of the GitLab project (e.g., 12345678).
    • Access Token: Your GitLab Personal Access Token.
    • Reference (optional): Branch or tag to index (defaults to main).
  4. Click Save.
  5. Click Sync to begin indexing.

What Gets Indexed

Cognipeer fetches the full repository tree and processes all text-based files (up to 5,000 files). File types indexed include source code, documentation (.md, .rst, .txt), and configuration files (.json, .yaml, .toml). Binary files are skipped.


Keeping the Datasource Up to Date

GitLab datasources do not auto-sync when new commits are pushed. To update:

  • Click Sync manually in the datasource settings.
  • For automated sync workflows from GitLab CI, use the Developer Hub.

Best Practices

  • Use descriptive commit messages and file names to improve search result quality.
  • For large monorepos, consider splitting into multiple datasources scoped to specific paths.
  • Rotate access tokens periodically and update the datasource credentials accordingly.

Limitations

  • Maximum 5,000 files per sync.
  • Only text-based files are indexed; binary and compiled assets are skipped.
  • Pagination is handled automatically, but very large repositories may reach the file limit.

Studio · Pulse — Cognipeer product documentation