Skip to main content
Loading navigation
Back to prompt library

Implementation brief

Linked challenge: Build an Enterprise Policy Question-Answering Assistant

Prompt source

Build the complete application69 lines11 sectionsNo variables1 code block
## Who Uses It
An employee seeking an authoritative answer to a workplace policy question.

## What You Will Build
Build an assistant that searches authorized company documents and answers policy questions with source citations. Show the applicable policy version, explain conflicts, and route unresolved questions to the policy owner.

## Inputs
- Policy documents with access labels
- Employee role and question
- Policy ownership and version metadata

## Workflow
1. Filter documents using the requesting user permissions.
2. Retrieve relevant policy sections.
3. Resolve authority, scope, and effective dates.
4. Answer with citations or create a clarification request.

## Interface
A chat interface with clickable evidence, policy version details, conflict notices, and a clarification action.

## Working Demo
Answer 150 with a citation to P1, explain the conflicting chat message, and omit the restricted note.

## Deliverables
- A working local application with the specified review interface.
- Source code, dependency lockfile, and setup commands.
- A recorded end-to-end demo using the supplied starter data.
- Example outputs, action logs, and automated tests.

## Starter Data
These fictional records are a small development fixture, not a production dataset. Implement the mock services described in the brief.

```json
{
  "requester": {
    "role": "employee"
  },
  "question": "What is the hotel nightly limit?",
  "documents": [
    {
      "id": "P1",
      "allowed_roles": [
        "employee"
      ],
      "authority": "approved_policy",
      "version": 2,
      "text": "The hotel limit is 150 per night."
    },
    {
      "id": "M1",
      "allowed_roles": [
        "employee"
      ],
      "authority": "chat_message",
      "text": "I heard the hotel limit is 200."
    },
    {
      "id": "P2",
      "allowed_roles": [
        "finance-admin"
      ],
      "authority": "restricted_note",
      "text": "Confidential exception details."
    }
  ],
  "policy_owner": "Travel Operations"
}
```

## Constraints
Use supplied synthetic documents. Enforce access filters before retrieval, not only during answer generation.
Choose an available model that supports your implementation. Record its identifier and version.

## Evaluation
Review the complete application, not only the starter-case answers.
- The answer cites the approved policy and its version.
- Restricted text does not appear in the answer.
- The user can request clarification from the named policy owner.
Add one normal case, one incomplete-input case, and one failure-recovery case.