# Build agent with Enterprise Knowledge

# Building a RAG Agent: Example Use Case: "Internal Policy Q&A"

This example walks you through creating a RAG Agent that answers questions based on your company's internal HR policies.

  1. Prerequisites: Before building, ensure your "Enterprise Knowledge Garden" (EKG) is prepared and populated with relevant HR policy documents (e.g., "Leave Policy.pdf", "Expense Guidelines.docx", "Code of Conduct.pdf").

  2. Step 1: Navigate to Expert Agent Studio and Start Building

    • Action: From your Purple Fabric workspace:
      • Open Expert Agent Studio.

      • Click + Build to create a new agent.

  3. Step 2: Setup Agent

    • Configure basic details:
      • Solution Name: Internal HR Policy Assistant

      • Interaction Type: Conversation

      • Visibility: Private (or appropriate for internal HR access)

  4. Step 3: Select Template

    • In the "Prompt Template" dropdown, choose RAG.
  5. Step 4: Add Perspective

    • Define the agent's role, persona, goals, and guidelines in the"Perspective" field.
      • Example Perspective: "You are an HR Policy Assistant. Yourrole is to provide accurate and concise answers to employeequestions based solely on the provided internal HR policydocuments. If the answer is not in the documents, state that youcannot find the information."
  6. Step 5: Link to Knowledge Garden

    • In the "Knowledge settings" section, select the EKG thatcontains your HR policy documents.
  7. Step 6: Configure Retrieval Parameters

    • Go to "Advanced Retrieval Configurations" to fine-tune settings:
      • Retrieval Strategy: Semantic Search (to find contextually relevant information)

      • Chunk Size & Overlap: Adjust based on your document structure (e.g., 512 characters with 50 overlap for policy documents).

      • Re-ranking: Enable for better relevance.

  8. Step 7: Test and Publish

    • Thoroughly test the agent with various queries:

      • Example Query 1: "What is the policy for sick leave?"

      • Example Query 2: "Can I expense client entertainment?"

      • Example Query 3: "What is the company's policy on remote work? (if not in documents)"

    • Review agent details and publish.