{"id":31970652,"url":"https://github.com/box-community/box-ai-api-masterclass","last_synced_at":"2025-10-14T19:17:52.239Z","repository":{"id":313383810,"uuid":"1047097458","full_name":"box-community/box-ai-api-masterclass","owner":"box-community","description":"Workshop for BoxWorks 2025 developer masterclass on Box AI API","archived":false,"fork":false,"pushed_at":"2025-09-05T16:42:59.000Z","size":1272,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-05T18:40:08.747Z","etag":null,"topics":["ai","box","developer","developer-tutorials","workshop"],"latest_commit_sha":null,"homepage":"https://developer.box.com","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/box-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-29T18:28:00.000Z","updated_at":"2025-09-05T16:45:34.000Z","dependencies_parsed_at":"2025-09-05T18:40:15.762Z","dependency_job_id":"10227f67-c662-46ab-97ce-aa6cb3e5e9e7","html_url":"https://github.com/box-community/box-ai-api-masterclass","commit_stats":null,"previous_names":["box-community/box-ai-api-masterclass"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/box-community/box-ai-api-masterclass","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-community%2Fbox-ai-api-masterclass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-community%2Fbox-ai-api-masterclass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-community%2Fbox-ai-api-masterclass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-community%2Fbox-ai-api-masterclass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/box-community","download_url":"https://codeload.github.com/box-community/box-ai-api-masterclass/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/box-community%2Fbox-ai-api-masterclass/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020656,"owners_count":26086895,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","box","developer","developer-tutorials","workshop"],"created_at":"2025-10-14T19:17:50.095Z","updated_at":"2025-10-14T19:17:52.229Z","avatar_url":"https://github.com/box-community.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Box AI API Master Class\n\nA comprehensive workshop designed to teach developers how to leverage the Box AI API capabilities through hands-on Jupyter notebook exercises. This interactive learning experience covers the full spectrum of Box AI APIs, from basic document Q\u0026A to advanced structured data extraction and custom AI agents.\n\n## What You'll Learn\n\nThis workshop provides practical, hands-on experience with:\n\n- **Document Intelligence**: Ask questions and get answers from single documents or curated document collections\n- **Data Extraction**: Extract structured and unstructured data from various document types (PDFs, Word docs, etc.)\n- **Box Hubs**: Use Box's Retrieval Augmented Generation (RAG) capabilities across large document sets\n- **Custom AI Agents**: Create and deploy specialized AI agents through Box AI Studio\n- **Enterprise Integration**: Build production-ready workflows using the Box Python SDK\n\n## Prerequisites\n\n### Box Account Requirements\n\n- **Box Enterprise Account** with the following enabled:\n  - Box AI APIs\n  - Box AI Studio  \n  - Box Hubs\n- **Box Application** configured with:\n  - Client Credentials authentication\n  - `Manage AI` scope enabled\n  - Application enabled in Box admin console\n- **Box User ID** of the application creator\n\n### Technical Requirements\n\n- **Python 3.11+**\n- **Jupyter Notebook** or **JupyterLab**\n- Ability to create Python virtual environments\n- Basic familiarity with Python and REST APIs\n\n## Setup Instructions\n\n### 1. Environment Setup\n\nClone this repository and create a virtual environment:\n\n```bash\ngit clone https://github.com/box-community/box-ai-api-masterclass.git\ncd box-ai-api-master-class\n\n# Create and activate virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n```\n\n### 2. Install Dependencies\n\n```bash\npip install -r .requirements.txt\n```\n\nOr install manually:\n```bash\npip install box-sdk-gen python-dotenv jupyter\n```\n\n### 3. Launch Jupyter\n\n```bash\njupyter notebook\n# or\njupyter lab\n```\n\n### 4. Complete Setup\n\n**Important**: Start with `1-Setup.ipynb` first. This notebook will:\n\n- Guide you through entering your Box credentials\n- Create all necessary Box objects (folders, files, hubs, metadata templates, AI agents)\n- Generate a `.env` file with all required configuration\n- Upload sample documents to Box for the exercises\n\n**⚠️ Security Note**: This workshop uses a `.env` file for convenience. In production, use secure credential management solutions.\n\n## Workshop Structure\n\n### Exercise 1: Setup (`1-Setup.ipynb`)\n**Prerequisites Setup \u0026 Box Object Creation**\n- Configure authentication with Box APIs\n- Create folder structure and upload sample documents\n- Set up Box Hubs, metadata templates, and AI agents\n- Generate environment configuration for subsequent exercises\n\n### Exercise 2: Document Q\u0026A (`2-Document_QnA_with_ask.ipynb`)  \n**Single Document Question Answering**\n- Learn the `/ask` endpoint for document Q\u0026A\n- Implement conversation history for contextual follow-ups\n- Work with citations and document references\n- **Sample Document**: US Parole Commission policy guidelines\n\n### Exercise 3: Hub Q\u0026A (`3-Hub_QnA_with_ask.ipynb`)\n**Multi-Document RAG with Box Hubs**\n- Query across curated document collections\n- Understand Box's managed RAG implementation  \n- Analyze complex document relationships\n- **Sample Documents**: Clinical drug trial documentation\n\n### Exercise 4: Flexible Extraction (`4-Flexible_extraction_with_extract copy.ipynb`)\n**Unstructured Data Extraction**\n- Use the `/extract` endpoint with natural language prompts\n- Extract key-value pairs without predefined schemas\n- Handle various document formats and structures\n- **Sample Document**: W-2 tax form\n\n### Exercise 5: Structured Extraction (`5-Structured_extraction_with_extract_structured copy.ipynb`)\n**Metadata Template-Based Extraction**\n- Leverage Box Metadata Templates for consistent extraction\n- Process multiple documents with identical schemas\n- Understand enterprise data standardization\n- **Sample Documents**: Invoice collection\n\n### Exercise 6: AI Agents (`6-Box_agents_and_AI_APIs.ipynb`)\n**Advanced AI Agents \u0026 Custom Models**\n- Use Box's Enhanced Extract Agent for improved accuracy\n- Create and deploy custom Box AI Studio agents\n- Compare default vs. specialized agent performance\n- **Sample Documents**: Legal due diligence and purchase agreements\n\n## Generated Code Files\n\nEach exercise generates standalone Python scripts that you can use as:\n- **Starting points** for your own projects\n- **Reference implementations** for production workflows\n- **CLI tools** for testing and development\n\nGenerated files:\n- `box_ai_qna_single.py` - Interactive single document chat\n- `box_ai_qna_hub.py` - Interactive multi-document chat\n- `box_ai_flexible_extract.py` - Flexible data extraction\n- `box_ai_structured_extract.py` - Template-based extraction\n- `box_ai_enhanced_extract.py` - Enhanced extraction agent\n- `box_ai_studio_agent.py` - Custom AI Studio agent\n\n## Sample Documents\n\nThe workshop includes carefully selected sample documents that demonstrate real-world use cases:\n\n- **Government Policy Documents** (Exercise 2)\n- **Clinical Trial Data** (Exercise 3)  \n- **Tax Forms** (Exercise 4)\n- **Business Invoices** (Exercise 5)\n- **Legal Contracts** (Exercise 6)\n\n## Key Features Demonstrated\n\n- **Stateless Conversation Management**: Maintain context across API calls\n- **Citation Tracking**: Trace AI responses back to source documents\n- **Batch Processing**: Handle multiple documents efficiently  \n- **Custom Field Definitions**: Define extraction schemas programmatically\n- **Agent Customization**: Tailor AI behavior for specific use cases\n- **Error Handling**: Robust error management for production environments\n\n## Production Considerations\n\nWhile this workshop uses simplified authentication and storage for learning purposes, consider these factors for production deployments:\n\n- **Security**: Use secure credential management (AWS Secrets Manager, Azure Key Vault, etc.)\n- **Scalability**: Implement proper async/await patterns for concurrent processing\n- **Monitoring**: Add logging, metrics, and error tracking\n- **Rate Limiting**: Implement appropriate throttling for API calls\n- **Data Privacy**: Ensure compliance with your organization's data handling policies\n\n## Support \u0026 Resources\n\n- **Box Developer Documentation**: [developer.box.com](https://developer.box.com)\n- **Box AI APIs**: [Box AI Documentation](https://developer.box.com/guides/box-ai/)\n- **Box Python SDK**: [box-python-sdk](https://github.com/box/box-python-sdk-gen)\n- **Box Community**: [Box Developer Community](https://community.box.com/box-platform-5)\n\n## Getting Help\n\nIf you encounter issues:\n\n1. **Check Prerequisites**: Ensure all Box features are enabled in your account\n2. **Verify Setup**: Confirm the setup notebook completed successfully\n3. **Review Logs**: Check Jupyter output for detailed error messages\n4. **Community Support**: Post questions in the Box Developer Community\n\n---\n\n**Ready to get started?** Open `1-Setup.ipynb` and begin your Box AI journey!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox-community%2Fbox-ai-api-masterclass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbox-community%2Fbox-ai-api-masterclass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbox-community%2Fbox-ai-api-masterclass/lists"}