Contextual Dev Assistant: Accuracy degrades with multi-repo complexity and cross-dependency chains

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem to Solve

The Contextual Dev Assistant (Duo Agentic Chat) performs well for straightforward, single-repository scenarios — helping address issues, creating MRs for reported bugs, and resolving pipeline errors. However, accuracy degrades significantly as multi-repo complexity increases. Hallucinations and incorrect suggestions emerge as dependency chains grow, making the assistant unreliable for the kinds of cross-cutting concerns that are most common in enterprise codebases.

Customer feedback:

"Accuracy degraded significantly with multi-repo complexity; hallucinations and incorrect suggestions emerged as dependency chains grew."

This is a recurring pattern: the assistant lacks the cross-repository context needed to reason correctly about how changes in one repo affect another, what the correct dependency versions or interfaces are, or how shared libraries are consumed across a monorepo or multi-repo setup.

Intended Users

  • Developers working across multiple repositories or in monorepos with complex internal dependency graphs
  • Platform engineers who need AI assistance that understands cross-package relationships
  • Enterprise teams whose codebases span multiple GitLab projects or groups

User Experience Goal

The Contextual Dev Assistant should be able to:

  1. Understand the dependency relationships between repositories and packages relevant to the current task
  2. Fetch and reason over code from related repositories when answering questions or generating suggestions
  3. Clearly indicate when it lacks sufficient cross-repo context, rather than hallucinating plausible-sounding but incorrect answers
  4. Degrade gracefully — providing partial, clearly-scoped answers rather than confident incorrect ones

Proposal

Cross-Repository Context Awareness

  • Allow the assistant to access and reason over multiple repositories simultaneously when the task requires it (e.g. when a dependency is defined in a separate repo)
  • Support explicit multi-repo context: users should be able to add additional repositories as context sources for a session
  • Integrate with GitLab's existing project/group structure to automatically discover related repositories (e.g. submodules, dependency declarations in package.json, Gemfile, go.mod, etc.)

Hallucination Reduction for Unknown Context

  • When the assistant cannot access a dependency or related repository, it should explicitly say so rather than generating plausible-sounding but incorrect suggestions
  • Implement confidence signalling: the assistant should indicate when its answer is based on incomplete context
  • Consider a "context gap" warning when the user's question involves repositories or packages the assistant cannot access

Dependency Graph Awareness

  • Parse and understand common dependency manifest formats (package.json, Gemfile, go.mod, pom.xml, requirements.txt, etc.) to understand the dependency graph of the current project
  • Use this graph to proactively fetch relevant context from linked repositories when available

Benefits

  1. Increased reliability — reduces hallucinations in complex scenarios, building trust in the assistant
  2. Enterprise readiness — multi-repo complexity is the norm, not the exception, in enterprise codebases
  3. Better developer experience — developers can trust the assistant's answers rather than having to verify everything
  4. Competitive parity — IDE-based tools with full local file access don't suffer from this limitation

Availability

  • GitLab.com (SaaS)
  • Self-Managed
  • Dedicated
  • #596270 (closed) — Agentic MR Review: Expand review context beyond MR diffs to include full repository access
  • #588653 (closed) — Allow custom agents and flows to be used as automatic MR reviewers
Edited by 🤖 GitLab Bot 🤖