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

# Internal Knowledge Base

> Private Q&A over scattered company files.

## The problem

Company knowledge lives in PDFs, spreadsheets, decks, wikis, and policy folders. People cannot search across it, and new hires ask the same questions for months.

## Why Ragrails fits

Ragrails parses mixed documents, chunks them, embeds them, and stores them in the vector database you choose. Your app controls the vector store, history persistence, permissions, and refresh schedule.

| Need                              | Ragrails capability                                                |
| --------------------------------- | ------------------------------------------------------------------ |
| Parse folders of internal files   | [Extraction](/features/extraction)                                 |
| Store in your own vector database | [Storing](/features/storing)                                       |
| Ask private questions over files  | [Chat](/features/chat)                                             |
| Keep answers cautious             | [Chat Tuning](/capabilities/chat-tuning)                           |
| Refresh changed documents         | [Knowledge Base Maintenance](/features/knowledge-base-maintenance) |

## Sample

<CodeGroup>
  ```python SDK theme={null}
  from ragrails import ChatRetrievalQualityConfig, RagRails

  rag = RagRails(
      collection="company_kb",
      vector_store={"provider": "qdrant", "url": "http://localhost:6333"},
      embedding={"provider": "voyage", "model": "voyage-3"},
      llm={"provider": "openai", "model": "gpt-4o-mini"},
  )

  rag.ingest(
      docs={"folder": "files/company/"},
      chunking={"chunk_size": 900, "chunk_overlap": 120},
      storage={"collection": "company_kb"},
  )

  result = rag.chat(
      "How many vacation days do new hires get?",
      history=[],
      retrieval_quality=ChatRetrievalQualityConfig(low_confidence_mode="answer_with_caution"),
  )

  print(result.answer)
  print(result.sources)
  ```

  ```bash CLI theme={null}
  ragrails ingest \
    --folder files/company/ \
    --vector-db qdrant \
    --collection company_kb \
    --url http://localhost:6333 \
    --provider voyage \
    --model voyage-3

  ragrails chat "How many vacation days do new hires get?" \
    --vector-db qdrant \
    --collection company_kb \
    --url http://localhost:6333 \
    --embedder-provider voyage \
    --embedder-model voyage-3 \
    --llm-provider openai \
    --llm-model gpt-4o-mini
  ```

  ```bash REST API theme={null}
  curl -X POST http://127.0.0.1:8000/v1/pipelines/ingest \
    -H "Content-Type: application/json" \
    -d '{
      "docs": {"folder": "files/company/"},
      "chunking": {"chunk_size": 900, "chunk_overlap": 120},
      "embedding": {"provider": "voyage", "model": "voyage-3"},
      "storage": {"vector_db": "qdrant", "collection": "company_kb", "url": "http://localhost:6333"}
    }'

  curl -X POST http://127.0.0.1:8000/v1/chat \
    -H "Content-Type: application/json" \
    -d '{
      "query": "How many vacation days do new hires get?",
      "llm_provider": "openai",
      "llm_model": "gpt-4o-mini",
      "embedder_provider": "voyage",
      "embedder_model": "voyage-3",
      "vector_db": "qdrant",
      "collection": "company_kb",
      "url": "http://localhost:6333",
      "history": []
    }'
  ```
</CodeGroup>

## Production notes

* Apply authorization in your application before calling chat or retrieval.
* Keep separate collections for teams or permission boundaries when needed.
* Keep a source-to-chunk manifest so removed files can be deleted cleanly.
