983 B
983 B
Letta Files and Streaming Demo
This demo shows how to work with Letta's file upload and streaming capabilities.
Features
- Upload files from disk to a Letta data source
- Create files from strings and upload them
- Download and upload PDF files
- Create an agent and attach data sources
- Stream agent responses in real-time
- Interactive chat with file-aware agent
Files
main.py- Main demo script showing file upload and streamingexample-on-disk.txt- Sample text file for upload demonstrationmemgpt.pdf- MemGPT paper (downloaded automatically)
Setup
- Set your Letta API key:
export LETTA_API_KEY=your_key_here - Install dependencies:
pip install letta-client requests rich - Run the demo:
python main.py
Usage
The demo will:
- Create a data source called "Example Source"
- Upload the example text file and PDF
- Create an agent named "Clippy"
- Start an interactive chat session
Type 'quit' or 'exit' to end the conversation.