Knowledge Base
Index

Knowledge Base

Store and manage documents, files, and reference materials for your AI agents and applications.

Overview

The Knowledge Base is a document storage system that holds reference materials your AI agents can access. Upload documents, code files, PDFs, images, and other resources that provide context for AI operations.

Use Cases

  • AI Context - Provide documents for agents to reference when answering questions
  • Reference Materials - Store company policies, product docs, FAQs
  • Code Snippets - Keep reusable code templates
  • Data Files - Store JSON, CSV, configuration files
  • Media - Images, PDFs, and other assets

Supported File Types

TypeExtensionsNotes
Text.txt, .md, .json, .yamlDirectly viewable and editable
Code.js, .ts, .py, .html, .cssSyntax highlighting in editor
Documents.pdf, .doc, .docxPDF preview, text extraction
Images.png, .jpg, .gif, .svgImage preview
Spreadsheets.csv, .xlsxData parsing support

Organization

Folders

Organize files into folders for better management:

knowledge/
├── company/
│   ├── policies.md
│   ├── faq.md
│   └── product-guide.pdf
├── templates/
│   ├── email-templates.json
│   └── response-templates.md
└── data/
    ├── pricing.csv
    └── config.json

Creating Folders

  1. Navigate to Knowledge in Lux Studio
  2. Click New Folder
  3. Enter folder name
  4. Drag files into folder or upload directly

Uploading Files

Via Lux Studio

  1. Navigate to Knowledge
  2. Click Upload or drag files into the window
  3. Select destination folder (optional)
  4. Files upload automatically

Via CLI

# Upload a single file
lux kb upload ./document.pdf
 
# Upload to a specific folder
lux kb upload ./image.png folder_xyz

Managing Files

View File

Click on any file to view it:

  • Text files - Edit in Monaco editor
  • Images - Preview with zoom
  • PDFs - Page-by-page viewer

Get File URL

Files have public URLs for access:

lux kb url doc_123

Delete File

lux kb delete doc_123

Using Knowledge in Agents

Reference knowledge base content in agent prompts:

You are a customer support agent. Reference the following documents
when answering questions:
- Company FAQ: @knowledge/company/faq.md
- Product Guide: @knowledge/company/product-guide.pdf

Answer based on these materials. If you can't find the answer,
say "I don't have that information."

Using Knowledge in Flows

Fetch knowledge base content in flows:

// In a Code node
const document = await knowledge.get('company/faq.md');
const content = document.content;
 
// Use content in AI transform or other operations
return { faqContent: content };

Best Practices

Organization

  • Use clear folder structures
  • Name files descriptively
  • Group related documents together

For AI Usage

  • Keep documents focused and concise
  • Update regularly to maintain accuracy
  • Structure content with clear headings
  • Use markdown for better parsing

File Management

  • Remove outdated documents
  • Version important files (v1, v2, etc.)
  • Use consistent naming conventions

CLI Commands

# List all documents and folders
lux kb list
 
# Get document details
lux kb get doc_123
 
# List folders
lux kb folders list
 
# Create folder
lux kb folders create "templates"
 
# Delete folder
lux kb folders delete folder_xyz

See Also: