Working With Documents and Knowledge Sources in Lega
This guide explains how to upload documents, manage them, and use Enhanced Knowledge Sources with RAG. It reflects the latest platform capabilities.
Supported File Types
Lega supports:
- PDF (.pdf)
- Word (.docx)
- Excel (.xlsx)
- Powerpoint (.pptx)
- Text (.txt)
- CSV (.csv)
- JSON (.json)
You can work with up to 10 documents at a time. The combined content must fit within the model’s context window. If you exceed the limit, Lega will warn you.
Document Manager
The Document Manager is your central hub for all documents you can access across Lega. It includes:
- Your uploaded documents
- Documents shared with you
- Knowledge sources you have permission to view
Inside the Document Manager you can:
- Upload, delete, and download documents
- View details such as upload date, file size, and type
- Search, filter, and sort
- Select documents for prompts
- Use documents inside knowledge sources for RAG
Any document you upload from your computer is added to the Document Manager and remains available for reuse.
Uploading Documents
You can upload or attach documents in three ways: inside an app, using parameters, or through knowledge sources.
1. Uploading Within an App
If an app supports document uploads, you will see a plus icon in the prompt box.
Selecting the icon gives you two options:
a. Select From Document Manager
Pick up to ten documents from:
- My Documents
- Shared repositories
- Knowledge sources you can access
Check the files you want, click Select, and they appear in your prompt.
b. Upload From Your Computer
Upload up to three documents directly. They will be stored in the Document Manager for future use.
2. Using Prompt Parameters
You can attach documents through prompt parameters. Create a parameter such as {{contract}} and set the parameter type to Document.
This works in:
- Apps
- Sandbox
- Prompt Library
Parameters make prompts reusable and let you standardize document inputs.
3. Using Knowledge Sources (RAG)
Enhanced Knowledge Sources with RAG let the model search inside your documents instead of loading them directly into the chat’s context window.
How RAG Works
- The documents in a knowledge source are indexed securely.
- When the model answers, it retrieves only the relevant sections.
- This gives you grounded responses without consuming the full context window.
- You also get citations pointing to the documents used.
RAG is enabled automatically when you assign a knowledge source to an app.
Limits and Capabilities
- Up to 50 documents per knowledge source
- Secure Azure-based indexing included in your Lega subscription
- Knowledge sources can be permissioned to specific users or groups
Documents inside a knowledge source can also be selected manually or used with document parameters.