From Model Replication to a Usable Product: Rebuilding an AI Q&A System

    Recreating an AI Q&A product involves far more than reproducing its visual design. This article explains how to analyze information architecture, interaction flows, model invocation, state management, error handling, and responsive layouts, while also presenting a practical framework for comparing AI coding models and validating whether the result is a stable, maintainable application.

    As generative AI continues to evolve, more developers are trying to recreate mature AI question-and-answer products. The challenge is not simply redrawing the interface. A successful implementation requires an understanding of the product’s information architecture, interaction logic, model-calling strategy, and cross-device behavior.

    In practice, different AI coding models perform very differently on application replication tasks. Some can generate a polished interface quickly but overlook state management and error handling. Others can implement a relatively complete workflow but introduce obvious issues in mobile layouts, input sizing, and small interaction details.

    For this reason, model capability should not be evaluated only by whether code was generated. The more important question is whether the resulting product provides a stable, complete, and maintainable user experience.

    1. The Real Challenges of Replicating an AI Q&A Product

    Requirements Are More Than a Screenshot

    An AI Q&A product typically includes multiple layers:

    • A conversation interface
    • A conversation list
    • Input and message-sending logic
    • Streaming output
    • Stop-generation controls
    • Content copying
    • Code block rendering
    • Error notifications
    • Mobile responsiveness
    • Conversation history management
    • Authentication or access control

    If a model receives only a screenshot, it may interpret the task as building a static page. The result may look similar to the reference but behave like a simple demo rather than a usable application.

    A real replication task must also answer questions such as:

    1. What changes in the interface after the user clicks Send?
    2. Is a loading state displayed while the model is generating?
    3. Can the user interrupt generation?
    4. How does the application recover from a failed request?
    5. Does the layout differ between an empty conversation and an existing conversation?
    6. How does the main content area respond when the sidebar opens on mobile?
    7. How are long messages, tables, and code blocks rendered?

    These questions determine whether the application reproduces the product’s behavior instead of merely its appearance.

    Interaction Details Are Often Harder Than the Main Workflow

    The primary workflow is usually straightforward: enter a prompt, click Send, and display an answer. The difference between a basic replica and a high-quality one often lies in the details:

    • Does the input field expand automatically as text grows?
    • Is the Send button disabled when the input is empty?
    • What do Enter and modifier-key combinations do?
    • Does the page scroll automatically to the latest message?
    • Is a placeholder displayed during generation?
    • Can code blocks be copied?
    • Are buttons compressed or misaligned on narrow screens?
    • Does the sidebar open as a drawer on mobile?

    These interactions require the model to understand visual structure, user behavior, and frontend state transitions at the same time. One-shot code generation rarely covers every scenario. A more reliable process is an iterative cycle of analysis, implementation, execution, and correction.

    2. How to Design a Model Replication Task

    To compare different AI coding models fairly, the task input should be standardized. A useful task specification can be divided into four categories.

    1. Visual References

    Provide screenshots for both desktop and mobile layouts. At minimum, the reference material should cover:

    • The initial empty state
    • A conversation with multiple messages
    • A focused input field
    • The generation state
    • An expanded sidebar
    • An error state

    More complete screenshots make it easier for the model to understand how the interface changes. However, screenshots only show what the page looks like. They cannot fully describe how it should behave, so written requirements are also necessary.

    2. Functional Requirements

    Functional requirements should be as specific as possible. For example:

    • Users can create a new conversation.
    • Users can send a message and receive a simulated response.
    • Responses support basic rich-text rendering.
    • Code blocks include a copy action.
    • Generation can be stopped.
    • Users can switch between conversations.
    • The page remains usable on mobile devices.
    • Failed requests produce clear feedback.

    If a production model API is not yet available, local mock data or a test endpoint can be used to complete the interaction loop. This allows the frontend logic to be validated without forcing the model to spend most of its effort on backend integration.

    3. Technical Constraints

    Technical constraints should describe the runtime environment, directory structure, dependency limitations, and delivery requirements. For example:

    • Use a common frontend framework.
    • The page must run through a local development server.
    • Do not depend on inaccessible external resources.
    • Keep configuration files and startup commands clear.
    • Organize styles, components, and data logic into separate layers.
    • Do not place all critical logic in a single page file.

    Clear constraints reduce the likelihood of the model producing code that is difficult to run or maintain.

    4. Acceptance Criteria

    Acceptance criteria should cover functionality, visual quality, and engineering quality.

    Evaluation Area What to Check
    Runability Whether the project starts successfully and avoids obvious errors
    Functional completeness Whether sending, stopping, copying, and conversation switching work
    Visual consistency Whether spacing, colors, typography, and layout match the reference
    Mobile responsiveness Whether narrow screens avoid overflow, overlap, and inaccessible controls
    State management Whether loading, success, failure, and empty states are handled
    Maintainability Whether components are reasonably separated and easy to modify

    3. Characteristics of Strong AI Coding Models

    In model comparisons, the strongest models are not necessarily the ones that write the most code. They are usually the ones that can perform the following tasks.

    Analyze Before Coding

    High-quality models often begin by outlining the page structure, component hierarchy, and state transitions before generating implementation code. For example, they may divide the interface into navigation, conversation list, message area, input area, and feedback components, while defining the responsibility of each part.

    This approach reduces duplicated code and makes later debugging easier. By contrast, models that immediately output a complete file often produce tightly coupled components, conflicting styles, and tangled logic.

    Build a Working State Model

    An AI Q&A interface should account for at least the following states:

    1. Idle
    2. ├─ Empty input
    3. └─ Non-empty input
    4. Sending
    5. ├─ Request in progress
    6. ├─ Request succeeded
    7. └─ Request failed
    8. Generating
    9. ├─ Streaming output
    10. ├─ Stopped by the user
    11. └─ Completed automatically

    Without a clear state model, the application may display incorrect button states, duplicate messages, fail to restore the input field, or leave error notifications visible indefinitely.

    A general-purpose data structure might look like this:

    1. {
    2. id: "conversation-1",
    3. title: "New conversation",
    4. messages: [
    5. {
    6. id: "message-1",
    7. role: "user",
    8. content: "User question",
    9. status: "completed"
    10. },
    11. {
    12. id: "message-2",
    13. role: "assistant",
    14. content: "Response content",
    15. status: "streaming"
    16. }
    17. ],
    18. updatedAt: 0
    19. }

    The key point is not the exact field names. It is the separation of conversations, messages, and generation states. This makes conversation switching, request retries, and generation cancellation more predictable.

    Handle Edge Cases Proactively

    The following situations are common in real-world use:

    • The user clicks Send repeatedly.
    • The user submits blank content.
    • A message is extremely long.
    • A network request fails midway.
    • The user switches views during generation.
    • The mobile soft keyboard covers the input area.
    • The browser window changes size.

    Code generated by a strong model will often include safeguards such as duplicate-submission prevention, request cancellation, scroll management, and fallback error handling. It should not implement only the ideal path.

    4. Mobile Responsiveness Is a Major Quality Divide

    Many applications appear correct on desktop but reveal serious problems on phones. Common issues include:

    • A fixed-width input field causing horizontal overflow
    • A sidebar that permanently consumes screen space
    • The bottom input area being hidden by the soft keyboard
    • Message bubbles that are too wide or too narrow
    • Controls that are difficult or impossible to reach
    • Long code blocks breaking the page layout
    • Fonts and spacing that do not adapt to the screen size

    Mobile support should not rely only on a few media queries. The layout strategy itself should be reconsidered.

    For example, desktop layouts can use a fixed sidebar alongside a flexible content area. On mobile, a hidden sidebar with drawer navigation is usually more appropriate. The input area should also avoid a fixed height. It can expand with the content while enforcing a reasonable maximum height.

    An illustrative layout strategy is shown below:

    1. .layout {
    2. display: flex;
    3. min-height: 100dvh;
    4. }
    5. .sidebar {
    6. width: 280px;
    7. flex: 0 0 auto;
    8. }
    9. .main {
    10. min-width: 0;
    11. flex: 1;
    12. }
    13. @media (max-width: 768px) {
    14. .sidebar {
    15. position: fixed;
    16. inset: 0 auto 0 0;
    17. transform: translateX(-100%);
    18. }
    19. .sidebar.open {
    20. transform: translateX(0);
    21. }
    22. .main {
    23. width: 100%;
    24. }
    25. }

    The min-width: 0 rule is particularly important for preventing content overflow in flex layouts. Using dynamic viewport height on mobile can also reduce layout problems caused by changes in the browser address bar.

    5. How to Build a More Objective Evaluation Process

    Step 1: Standardize the Input Materials

    Give every model the same screenshots, functional requirements, and technical constraints. This avoids introducing bias through differences in task descriptions.

    Step 2: Record the First Generated Result

    Pay attention to the following:

    • Whether the project starts successfully
    • Whether obvious runtime errors exist
    • Whether the main page structure is correct
    • Whether the functional workflow is complete
    • Whether the model explains its implementation assumptions

    Step 3: Run Interaction Tests

    Use a fixed test script:

    1. Open the page.
    2. Create a new conversation.
    3. Enter a relatively long message.
    4. Send the message.
    5. Check the generation state.
    6. Attempt to stop generation.
    7. Copy code from the response.
    8. Switch to a previous conversation.
    9. Resize the browser window.
    10. Repeat the key workflow on a mobile device.

    Step 4: Compare the Visual Output

    Visual validation should not depend only on subjective impressions. Check the following areas individually:

    • Overall page width
    • Top and bottom spacing
    • Input position and height
    • Button sizes and spacing
    • Maximum message width
    • Sidebar proportions
    • Whether mobile elements are misaligned

    Screenshot overlays or pixel-difference tools can provide additional evidence, but the final evaluation should still include the experience of using the application.

    Step 5: Review Delivery Quality

    After functional and visual validation, also check:

    • Whether unused dependencies remain
    • Whether sensitive configuration has been exposed in the frontend
    • Whether duplicate components exist
    • Whether any resources are inaccessible
    • Whether the project can be installed and started in a clean environment
    • Whether the run instructions are clear

    6. Moving from Replication to a Maintainable Product

    The value of a replication task is not limited to copying a page. It also helps development teams build complete product engineering capabilities. A satisfactory result should have the following characteristics:

    1. A complete workflow: Users can move from entering a prompt to receiving a result.
    2. Clear states: Loading, success, failure, and cancellation all provide explicit feedback.
    3. Cross-device usability: Desktop and mobile users can complete the core workflow.
    4. A reasonable structure: Components, data, and styles have clear responsibilities and can be extended.
    5. Recoverable errors: Network failures and user mistakes do not leave the application unusable.
    6. Repeatable acceptance testing: Different developers can follow the same criteria and reach broadly consistent conclusions.

    Overall, a model’s ability to replicate an AI Q&A product should not be measured simply by generation speed or code volume. The more meaningful criteria are whether it can understand requirements, break down problems, establish a state model, handle edge cases, and continue correcting its implementation based on runtime feedback.

    For developers, the most effective approach is not to ask a model to generate the entire application in one pass. Instead, divide the work into verifiable stages: build the structure first, then implement interactions; make the project run before optimizing its visual details; complete the desktop experience before refining mobile behavior; and finally perform acceptance testing with a standardized script.

    Only through this process is generated code more likely to evolve from a demo prototype into a genuinely usable and maintainable application.