AI-Powered BRD Generator

April 24, 2026 ยท View on GitHub

An intelligent, full-stack agentic application designed to automate the creation of comprehensive Business Requirements Documents (BRD). Built with a state-of-the-art tech stack including Next.js, FastAPI, LangGraph, and CopilotKit, this tool leverages local LLMs (via Ollama) to guide users through the process of defining project scopes, identifying stakeholders, and generating a professional, formatted BRD markdown file.

๐ŸŽฅ Video Demo

Watch the BRD Generator Demo

๐Ÿ— Architecture & Tech Stack

This project is divided into two primary components: a highly responsive React frontend and a robust, agentic Python backend.

Frontend

  • Framework: Next.js 14+ (App Router)
  • Language: TypeScript
  • Styling: Tailwind CSS
  • AI Integration: CopilotKit (v2) for seamless chat UI and agent orchestration.
  • Client: @ag-ui/client for HTTP Agent communication with the backend.

Backend

  • Framework: FastAPI
  • Language: Python 3.12+
  • Agent Orchestration: LangGraph (StateGraph)
  • LLM Engine: Ollama (Running llama3.1:8b locally for privacy and cost-efficiency)
  • Protocol: Standardized HTTP Agent endpoints to stream LangGraph events to the CopilotKit frontend.

How It Works

  1. User Interaction: The user interacts with the CopilotChat interface on the Next.js frontend.
  2. Agent Routing: The frontend uses a local HttpAgent configuration to bypass remote discovery, directly routing the chat messages to the FastAPI backend at /api/copilotkit/agent/agentic_chat.
  3. Graph Execution: The FastAPI server receives the request and initializes a LangGraph state machine.
  4. LLM Processing: The LangGraph nodes invoke the local Ollama LLM with specific system prompts to act as a seasoned Business Analyst.
  5. Streaming Response: The backend streams the generated tokens and state updates back to the frontend using Server-Sent Events (SSE).
  6. Result: The assistant dynamically refines the user's requirements and eventually generates a fully structured BRD.

๐Ÿš€ Setup Instructions

Prerequisites

  • Git installed on your system.
  • Node.js (v18+) installed.
  • Python (v3.12+) installed.
  • uv (Python package manager) installed.
  • Ollama installed and running locally.

1. Clone the Repository

First, clone the project to your local machine and navigate into it:

git clone https://github.com/sarveshtalele/brd-generator-using-agui-langraph.git
cd brd-generator-using-agui-langraph

2. Setup Ollama (Local LLM)

Ensure Ollama is installed. Then, pull and run the llama3.1:8b model required for the agent:

# Pull the model
ollama pull llama3.1:8b

# Run the model locally in the background or a separate terminal
ollama run llama3.1:8b

3. Backend Setup

You can set up the backend directly from the root directory using the pyproject.toml workspace or from the backend folder. Here is the step-by-step guide for the backend:

# Open a new terminal and navigate to the backend directory
cd backend

# Create a virtual environment using uv
uv venv

# Activate the virtual environment
# On macOS/Linux:
source .venv/bin/activate
# On Windows:
# .venv\Scripts\activate

# Install the project dependencies (listed in pyproject.toml)
uv pip install -r pyproject.toml

# Start the FastAPI server
uvicorn main:app --reload --port 8000

The backend API and LangGraph agent will now be available at http://localhost:8000.

4. Frontend Setup

In a new terminal window, navigate to the frontend directory to start the web application:

# From the root of the project, navigate to the frontend directory
cd frontend

# Install the Node.js dependencies
npm install

# Start the Next.js development server
npm run dev

The frontend application will be up and running at http://localhost:3000.

๐Ÿ’ก Sample Usage

  1. Open your browser and navigate to http://localhost:3000.
  2. You will be greeted by the BRD Assistant.
  3. Example Prompt:

    "I want to build a mobile application for a local coffee shop. The app should allow users to browse the menu, place orders ahead of time, and earn loyalty points. The stakeholders are the shop owners, baristas, and customers."

  4. The AI will respond, asking clarifying questions to flesh out the requirements (e.g., payment gateways, timeline, specific features).
  5. Once sufficient context is gathered, ask the AI to "Generate the BRD", and it will output a comprehensive, professional Business Requirements Document in Markdown format.

๐Ÿค Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

๐Ÿ“ License

This project is licensed under the MIT License.