Skip to main content

Overview

RAG (Retrieval-Augmented Generation) allows your AI agents to access custom knowledge bases. Upload documents and let agents search through your organization’s proprietary information.
RAG Knowledge requires Admin access. Contact your organization admin to upload documents.
Model Restriction: RAG tools use Google Vertex AI Search (VertexAiSearchTool), which is only compatible with Gemini models. Agents using Anthropic Claude or other models cannot use RAG tools. Ensure your agent is configured with a Gemini model (e.g., gemini/gemini-2.5-flash) when assigning RAG tools.

Supported File Types

FormatExtensionMax Size
Plain Text.txt10MB
PDF.pdf50MB
HTML.html, .htm10MB
JSON.json10MB
JSONL.jsonl, .ndjson10MB
Markdown.md, .markdown10MB
Word.docx50MB
PowerPoint.pptx10MB

Uploading Documents

Step 1: Access RAG Knowledge

  1. Navigate to Team > RAG Knowledge
  2. You must have Admin access to upload documents

Step 2: Create a DataStore

  1. Click Create DataStore
  2. Enter a name for your knowledge base
  3. Select files to upload

Step 3: Wait for Indexing

After upload, documents are processed and indexed:
StatusDescription
pendingWaiting to start processing
uploadingFiles being uploaded to cloud storage
indexingDocuments being processed and indexed
processingProcessing in progress
completedKnowledge base ready to use
failedProcessing error (can be retried)
Indexing typically takes 1-5 minutes depending on document size and quantity.

Using RAG with Agents

Once documents are indexed, they can be assigned to AI agents.

Admin Configuration

  1. Go to Admin > Agents
  2. Edit an agent
  3. In the RAG Tools section, select the DataStore
  4. Save changes

How It Works

When a user asks a question:
  1. The agent searches the knowledge base
  2. Relevant document sections are retrieved
  3. The agent uses this context to provide accurate answers

Agent-Generated Documents

Junis agents can create their own knowledge base entries using the upload_rag_document tool. This enables powerful workflows where agents research, synthesize, and store knowledge for future use.
Requires Configuration: The upload_rag_document tool is not auto-injected. An admin must explicitly assign this tool to agents via Admin > Agents > Tools. Agent-generated documents are always saved as Markdown (.md) files — this is distinct from manual uploads which support PDF, DOCX, PPTX, and other formats.

How It Works

  1. Agent generates content (research summaries, analysis reports, processed data)
  2. Agent calls upload_rag_document with the content
  3. Document is automatically uploaded and indexed
  4. All agents with access to that DataStore can search the new content

Example Workflow

User: "Research the top 5 competitors in our market and save it
to our knowledge base."

Agent:
1. Searches the web for competitor information
2. Compiles findings into a structured Markdown document
3. Calls upload_rag_document:
   - datastore_name: "Market Research"
   - file_name: "competitor-analysis-march-2026"
   - content: "# Competitor Analysis\n\n## Company A..."
4. Document is indexed and searchable

Next conversation:
User: "What do we know about our competitors?"
Agent: Searches "Market Research" DataStore and retrieves the analysis

Key Features

  • Auto-Create DataStore: If the named DataStore doesn’t exist, it’s created automatically
  • Markdown Format: Content is stored as .md files for clean indexing
  • Immediate Indexing: Documents begin indexing as soon as they’re uploaded
  • Cumulative Knowledge: Agents build an ever-growing knowledge base over time
Pro Tip: Combine upload_rag_document with scheduled tasks to automatically research and store information on a recurring basis.

Best Practices

  • Group related documents together
  • Use clear, descriptive filenames
  • Remove duplicate content
  • Use clear headings and structure
  • Break long documents into sections
  • Include context in document titles
  • Update documents when information changes
  • Remove outdated content
  • Re-index after major updates

Troubleshooting

Possible causes:
  • File type not supported
  • File exceeds size limit
  • Network connection issue
Solution:
  • Check file format and size
  • Try uploading again
  • Contact support if issue persists
Possible causes:
  • DataStore not assigned to agent
  • Documents not fully indexed
  • Query doesn’t match document content
Solution:
  • Verify DataStore is linked to the agent
  • Check indexing status is “ready”
  • Try rephrasing your question