Quick Start: Knowledge Table
1. Introduction
This guide demonstrates how to use JamAI Base TypeScript SDK to upload and embed files into Knowledge Tables for AI-powered document processing and retrieval.
What are Knowledge Tables?
Knowledge Tables are specialized tables in JamAI Base that provide hybrid-search capabilities through both full-text search (FTS) and vector embeddings:
Search Capabilities:
Full-Text Search (FTS): Traditional keyword-based search for exact and partial matches
Semantic Search: Vector embedding-based search for meaning and context
Document Processing:
Automatically chunks documents into manageable segments
Generates vector embeddings for semantic understanding
Indexes content for full-text search
Preserves document structure (tables, layouts, etc) and metadata
Use Cases:
Document retrieval using both keywords and semantic meaning
Question-answering agent
Content recommendation
Knowledge base search and discovery
Supported File Types
The following file formats are supported:
Text files:
.txt,.md,.csv,.tsvDocuments:
.doc,.docx,.pdfPresentations:
.ppt,.pptxSpreadsheets:
.xls,.xlsxMarkup/Data:
.xml,.html,.json,.jsonl
Prerequisites
Before starting, you'll need:
Node.js 16.x or higher
Project ID and Personal Access Token (PAT)
Documents to process
2. Installation and Setup
Installing Required Packages
Basic Configuration
3. Creating Your Knowledge Table
4. Implementation
4.1 Complete Document Uploader Class
5. Complete Standalone Script
Save this as knowledge_uploader.ts:
6. Usage Examples
6.1 Single File Upload
6.2 Batch Folder Upload
6.3 Custom Chunk Settings
7. Best Practices
7.1 Chunking Strategy
Recommended Settings by Document Type:
PDFs
1500
300
Preserves paragraph context
Text Files
1000
200
Balanced for general text
Spreadsheets
800
150
Smaller for structured data
JSON/JSONL
800
150
Maintains object boundaries
7.2 Error Handling
7.3 Batch Processing with Rate Limiting
8. Running the Script
Using Environment Variables
Create
.envfile:Run the script:
Using Command Line (modify script to accept args)
9. Troubleshooting
Common Issues
File not found error
Verify file path is correct
Use absolute paths for reliability
Unsupported file format
Check file extension against supported types
Verify file is not corrupted
Upload timeout
Check internet connection
For large files, consider increasing timeout settings
Verify file size is reasonable
Chunk size errors
Ensure chunk size > chunk overlap
Try default settings first
Adjust based on document structure
10. Next Steps
Was this helpful?