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
| Type | Extensions | Notes |
|---|---|---|
| Text | .txt, .md, .json, .yaml | Directly viewable and editable |
| Code | .js, .ts, .py, .html, .css | Syntax highlighting in editor |
| Documents | .pdf, .doc, .docx | PDF preview, text extraction |
| Images | .png, .jpg, .gif, .svg | Image preview |
| Spreadsheets | .csv, .xlsx | Data 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.jsonCreating Folders
- Navigate to Knowledge in Lux Studio
- Click New Folder
- Enter folder name
- Drag files into folder or upload directly
Uploading Files
Via Lux Studio
- Navigate to Knowledge
- Click Upload or drag files into the window
- Select destination folder (optional)
- 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_xyzManaging 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_123Delete File
lux kb delete doc_123Using 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_xyzSee Also:
- Agents - Using knowledge with AI agents
- CLI Knowledge Commands