DEV Community

Cover image for Building DevMentor: Designing a Voice-to-Pull Request AI Pipeline
Heet Mehta
Heet Mehta

Posted on

Building DevMentor: Designing a Voice-to-Pull Request AI Pipeline

Category: AI Engineering • LLMs • Developer Tools • Agentic AI


Building DevMentor: Designing a Voice-to-Pull Request AI Pipeline

What if shipping code became as simple as having a conversation?

Artificial Intelligence has dramatically changed how developers write software. We now have AI systems capable of generating functions, explaining codebases, fixing bugs, and even creating entire applications. Yet despite these advances, software development remains fragmented.

Developers still spend a significant amount of time switching between tools:

  • Writing code
  • Running tests
  • Fixing linting issues
  • Updating documentation
  • Writing commit messages
  • Creating Pull Requests
  • Responding to code review comments

Coding is only one part of software engineering.

The real workflow is much larger.

This realization became the motivation behind DevMentor, an AI-powered developer platform designed to automate the entire software engineering lifecycle—not just code generation.

This article explores the architecture behind one of its core ideas: a Voice-to-Pull Request Pipeline.


The Problem

Modern Large Language Models are excellent at generating code.

However, software development is fundamentally an iterative process rather than a single prompt-response interaction.

Consider a simple request:

"Add JWT authentication."

A human developer naturally understands that this task involves much more than writing a few lines of code.

It requires:

  • Understanding the existing project architecture
  • Identifying the correct files
  • Implementing authentication logic
  • Running tests
  • Fixing errors
  • Updating documentation
  • Creating meaningful commits
  • Opening a Pull Request

Today's AI assistants typically stop after generating code.

Developers still perform the remaining engineering tasks manually.

The question became:

Can AI own the complete workflow?


The Vision

Imagine opening your IDE and simply saying:

"Implement JWT authentication using refresh tokens."

Instead of generating a code snippet, the system would:

  1. Understand the repository.
  2. Plan the required changes.
  3. Modify the correct files.
  4. Execute tests.
  5. Fix compilation issues.
  6. Generate documentation.
  7. Commit changes.
  8. Push the branch.
  9. Open a Pull Request.

The developer transitions from writing code to supervising an autonomous engineering assistant.


System Architecture

The pipeline consists of several independent components working together.

Voice Command
       │
       ▼
Speech-to-Text
       │
       ▼
Task Understanding
       │
       ▼
LLM Planner
       │
       ▼
Execution Agent
       │
       ▼
Repository Analysis
       │
       ▼
Code Generation
       │
       ▼
Test Runner
       │
       ▼
Self-Correction Loop
       │
       ▼
Git Commit
       │
       ▼
GitHub Pull Request
Enter fullscreen mode Exit fullscreen mode

Each stage has a clearly defined responsibility.

Rather than relying on one enormous prompt, the pipeline decomposes complex engineering work into manageable tasks.


Understanding the Repository

One of the largest limitations of existing AI coding assistants is context.

Large repositories frequently exceed the model's context window.

Instead of loading the entire repository into memory, DevMentor constructs a semantic representation of the project.

This includes:

  • File hierarchy
  • Dependency graph
  • Import relationships
  • Function definitions
  • API endpoints
  • Configuration files
  • Documentation

The AI retrieves only the information required for the current task.

This dramatically reduces token consumption while improving accuracy.


Planning Before Coding

Instead of immediately generating code, DevMentor first creates an execution plan.

For example, implementing JWT authentication may produce something similar to:

Task 1
Create authentication middleware

Task 2
Add JWT verification

Task 3
Update login endpoint

Task 4
Protect private routes

Task 5
Write integration tests

Task 6
Update documentation
Enter fullscreen mode Exit fullscreen mode

Breaking work into smaller subtasks makes failures easier to detect and significantly improves reliability.


Executing Changes Safely

Generating code is not enough.

Every modification must be validated.

The execution pipeline performs:

  • File edits
  • Dependency installation
  • Type checking
  • Linting
  • Unit tests
  • Integration tests
  • Formatting

If any stage fails, execution immediately enters the recovery pipeline.


The Self-Correction Loop

One of the most interesting aspects of DevMentor is its iterative correction mechanism.

Instead of abandoning execution after the first failure, the AI analyses the error and attempts to repair the issue automatically.

The loop follows a simple pattern.

Generate Code

↓

Run Tests

↓

Compilation Failed?

↓

Read Error Logs

↓

Plan Fix

↓

Rewrite Code

↓

Run Tests Again
Enter fullscreen mode Exit fullscreen mode

This continues until:

  • All checks pass
  • A retry limit is reached
  • Human intervention becomes necessary

The objective is not to produce perfect code on the first attempt.

The objective is to build systems capable of improving themselves.


Working with Git

Once validation succeeds, DevMentor prepares a clean commit.

Instead of generic commit messages, the system generates descriptive summaries.

Example:

feat(auth): implement JWT authentication with refresh tokens

- Added authentication middleware
- Created token verification utilities
- Protected private API routes
- Added integration tests
Enter fullscreen mode Exit fullscreen mode

After committing, the pipeline automatically opens a Pull Request containing:

  • Summary
  • Technical changes
  • Testing results
  • Future improvements

This removes another repetitive engineering task.


Technical Challenges

Building autonomous software agents introduces several engineering problems.

Repository Scale

Large repositories may contain thousands of files.

Loading everything into an LLM is inefficient.

A retrieval-based architecture becomes essential.


Hallucinated File Paths

Models occasionally reference files that do not exist.

To reduce these failures, repository indexing verifies every path before execution.


Infinite Repair Loops

AI systems can repeatedly apply ineffective fixes.

DevMentor prevents this through:

  • Retry limits
  • Error clustering
  • State tracking
  • Failure memory

Context Drift

Long-running sessions gradually lose focus.

Persistent project memory ensures the agent remembers previous architectural decisions throughout execution.


Why This Matters

The future of software engineering is unlikely to revolve around replacing developers.

Instead, developers will increasingly become supervisors of intelligent engineering systems.

The role shifts from manually writing every implementation detail to defining goals, reviewing architecture, and validating outcomes.

In this workflow, AI becomes another member of the engineering team rather than simply an autocomplete tool.


What's Next

The current pipeline is only the beginning.

Future work includes:

  • Multi-agent collaboration
  • Long-term project memory
  • Autonomous documentation generation
  • Automatic architecture reviews
  • Security auditing
  • Performance optimization
  • Continuous deployment
  • Production monitoring

The long-term vision is a platform capable of understanding an entire software project, continuously improving it, and collaborating with developers throughout the software lifecycle.


Final Thoughts

Artificial Intelligence has already transformed how we write code.

The next transformation is not about generating better code snippets.

It is about building systems capable of reasoning through entire engineering workflows.

DevMentor is an ongoing exploration into that future.

Rather than asking AI to write code, we are asking it to become a software engineer.

There is still a long journey ahead, but each iteration brings us one step closer to truly autonomous software development.


About the Author

Hi, I'm Heet Mehta, a Computer Engineering student passionate about AI, Machine Learning, and Developer Experience. I enjoy building intelligent developer tools, experimenting with autonomous AI systems, and sharing what I learn through open-source projects and technical writing.

If you enjoyed this article, stay tuned for the next post in the series:

Inside the Ralph Loop: How AI Learns to Fix Its Own Code

Top comments (0)