> ## Documentation Index
> Fetch the complete documentation index at: https://developer.box.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Turn an enterprise document repository into an access-controlled AI knowledge base

> Build an access-controlled AI knowledge base with Box Hubs and Box AI Ask. Answers inherit Box permissions. No vector database needed.

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

export const Link = ({href, children, className, ...props}) => {
  const localizedHref = localizeLink(href);
  return <a href={localizedHref} className={className} {...props}>
      {children}
    </a>;
};

Curate approved content into a <Link href="/guides/hubs-api">Box Hub</Link> and query it with <Link href="/guides/box-ai/ai-tutorials/ask-questions#ask-questions-about-a-hub">Box AI Ask</Link>. Box indexes hub items and checks the requesting user's permissions on every request. Answers only reference content the caller can already open in Box. No vector database needed.

## Why this pattern

A shared knowledge base must answer four questions a personal folder does not:

* Who can read a given file, and who can change it?
* Which version is current?
* Which content is approved for AI, and which is draft or stale?
* Can an answer cite the source document?

Box already stores versions, collaborations, and audit history. A hub is a curated view over that content. Box AI Ask searches the hub's index and returns answers with citations, filtered by the caller's permissions.

## Build the knowledge base

<Steps>
  <Step title="Keep the repository in Box">
    Store the source files in Box folders. Do not grant an AI system access to the entire enterprise by default. Start with the smallest set of folders that supports the use case.
  </Step>

  <Step title="Separate staging from approved content">
    New or updated files land in a staging area. Only reviewed content moves into the folders you add to the hub. Metadata such as owner, domain, and approval status tracks review state. See <Link href="/guides/metadata">metadata</Link> and, when values live inside the document, <Link href="/guides/box-ai/ai-tutorials/extract-metadata-structured">Box AI Extract</Link>.
  </Step>

  <Step title="Publish approved files to a hub">
    Create a hub with the <Link href="/guides/hubs-api/hubs/create-hub">Hubs API</Link>, then add the approved folders or files as <Link href="/guides/hubs-api/hubs-items/hub-items">hub items</Link>. Invite people or groups with <Link href="/guides/hubs-api/hubs-collaborations/hub-collaborations">hub collaborations</Link>. Hub access does not replace file permissions. A collaborator still cannot see a file they are not allowed to open.
  </Step>

  <Step title="Query the hub with Box AI Ask">
    Enable AI on the hub (`is_ai_enabled`). See <Link href="/guides/hubs-api/hubs/update-hub">Update a hub</Link>. Then call <Link href="/reference/post-ai-ask">`POST /2.0/ai/ask`</Link> and pass the hub as an item with `"type": "hubs"`. Box searches the hub index and returns answers grounded in documents the requesting identity can access. Enable citations so the response points back to source files. See <Link href="/guides/box-ai/ai-tutorials/ask-questions#ask-questions-about-a-hub">Ask questions about a hub</Link>.
  </Step>
</Steps>

## Permissions

Box Hubs and Box AI do not have their own permission system. They inherit waterfall permissions, collaborations, and scopes from the authenticated user or application.

* Connecting an agent or calling Ask does not expose every file in the enterprise.
* If a user has no access to a file in Box, Box AI does not include that file in their answer.
* Use a dedicated service account only when that account is an intentional, audited identity with collaborations on the approved content. Do not use a service account to bypass user permissions.

For agent connections, see <Link href="/guides/box-mcp/permission-aware-access">secure, permission-aware agent access</Link>.

## When to use a vector database instead

Use hubs + Ask when the content is already in Box and you need permission-aware answers.

Build your own RAG pipeline only when you need a retrieval engine Box AI does not provide, an index that mixes Box with other sources, or custom chunking and ranking. If you export content, your pipeline must enforce Box permissions and stay current as files, versions, and collaborations change. See <Link href="/ai/rag">Build RAG over enterprise documents stored in Box</Link>.

## Worked examples

<CardGroup cols={2}>
  <Card title="Build your company brain" href={localizeLink("/tutorials/company-brain")} icon="brain" arrow="true">
    A shared knowledge layer for people and agents. Includes folders, Box AI review, governance metadata, hubs, and Ask.
  </Card>

  <Card title="Sales RFP answer bank" href={localizeLink("/tutorials/sales-rfp-answer-bank")} icon="magnifying-glass" arrow="true">
    Provision a hub, add curated RFP content, embed the hub, and answer sales questions with Box AI.
  </Card>
</CardGroup>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Box Hubs overview"), href: "/guides/hubs-api", badge: "GUIDE" },
{ label: translate("Ask questions to Box AI"), href: "/guides/box-ai/ai-tutorials/ask-questions", badge: "GUIDE" },
{ label: translate("Why Box for developers"), href: "/guides/getting-started/why-box", badge: "GUIDE" },
{ label: translate("Build RAG over enterprise documents"), href: "/ai/rag", badge: "GUIDE" }
]}
/>
