# OneNote Agent

<table data-card-size="large" data-column-title-hidden data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><strong>Overview</strong></td><td><ul><li>Search and retrieve notebooks, sections, and pages from OneNote through Blockbrain</li><li>Create, read, and manage notes (pages) directly within Blockbrain</li><li>Access and update notebook and section organization for streamlined information management</li><li>Extract and summarize note content - including text and images - for reporting or AI analysis</li></ul></td><td><a href="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FUwHxKX9rpt3NC6yRBTXA%2FScreenshot%202025-12-04%20at%2013.51.34.png?alt=media&#x26;token=c5a58bce-5ede-4ad9-985e-556b4ebeed5e">Screenshot 2025-12-04 at 13.51.34.png</a></td></tr><tr><td><strong>Prerequisites</strong></td><td><ul><li>Complete the <a href="https://docs.en.theblockbrain.ai/for-users/agents">general setup steps</a> from the main AI Agents page</li><li>Ensure users have active Microsoft 365 accounts with OneNote enabled</li><li>Verify appropriate Microsoft 365 licensing for OneNote and related services</li></ul></td><td><a href="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2Fvi22Kf04WdMUhdg0dI0h%2FScreenshot%202025-12-04%20at%2013.51.48.png?alt=media&#x26;token=cc189408-a272-40e5-988b-b7486983d97e">Screenshot 2025-12-04 at 13.51.48.png</a></td></tr></tbody></table>

### Azure App Registration Configuration

#### Required API Permissions

Add the following Microsoft Graph permissions to your app registration:

| Permission            | Type      | Description                                                             |
| --------------------- | --------- | ----------------------------------------------------------------------- |
| `offline_access`      | Delegated | Maintain access to data you have given it access to                     |
| `openid`              | Delegated | Sign in and read user profile                                           |
| `Notes.Read.All`      | Delegated | Sign in and read the user profile                                       |
| `User.Read`           | Delegated | Read all OneNote notebooks that the signed-in user can access           |
| `Notes.ReadWrite.All` | Delegated | Read and write all OneNote notebooks that the signed-in user can access |

#### Permission Configuration Steps

1. In your Azure app registration, go to **API permissions**
2. Click **"Add a permission"** > **Microsoft Graph** > **Delegated permissions**
3. Search for and select each required permission
4. Click **"Add permissions"**
5. Click **"Grant admin consent"** (recommended for organization-wide deployment)

### Agent Configuration in Blockbrain

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2FZnTkikWMHndriltc9irv%2FScreenshot%202026-01-05%20at%2010.41.38.png?alt=media&#x26;token=5c9ec98c-4af1-4aa9-acf1-cf55ae4e98cf" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3232460952-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIabFtGTeQzwfWCzp8vd6%2Fuploads%2F8UHCmlcsdcyeTAi3Ehs8%2FScreenshot%202026-01-05%20at%2010.42.23.png?alt=media&#x26;token=6ab6d8f7-6df9-453e-95f3-02c66d77a2b3" alt=""><figcaption></figcaption></figure>

#### Configuration Steps

1. **Access Agent Settings**:
   * Navigate to your Blockbrain admin panel
   * Go to **Agents** > **OneNote Agent**
   * Click **"Configure"**
2. **Enter Azure Credentials**:
   * **Client ID**: Enter the Application ID from your Azure app registration
   * **Client Secret**: Paste the client secret you generated (use the eye icon to toggle visibility)
   * **Tenant**: Enter your Azure tenant ID
3. **Configure OAuth Scopes**:
   * Add each required scope individually using the **"Add"** button as mentioned [here](#required-api-permissions)
   * Each scope appears as a removable tag with visual indicators
   * Use the **"X"** button to remove any incorrect scopes
4. **Additional Configuration** (Optional):
   * Configure custom key-value pairs for specific organizational requirements
   * Set up any specialized email handling rules
5. **Save Configuration**:
   * Click **"Save"** to apply all settings
   * Wait for the confirmation message

### Alternative: Admin Consent Configuration

For streamlined deployment with pre-approved permissions:

1. In Azure, grant admin consent for all required Microsoft Graph permissions
2. In Blockbrain configuration, use `.default` scope instead of individual scopes
3. This approach simplifies user onboarding by eliminating individual consent prompts

### Testing the OneNote Agent

#### Verification Steps

1. **Authentication Test**:
   * Use Blockbrain's built-in connection testing tool
   * Verify successful OAuth flow with Microsoft Graph
2. **Notebook & Section Access**:
   * Test listing all notebooks and sections through the agent
   * Verify access to notebooks, sections, and their metadata
3. **Page (Note) Management**:
   * Create a test page in a notebook section
   * Verify reading, updating, and deleting page content
   * Check the ability to list and search for pages
4. **Content Extraction & Analysis**:
   * Test extracting and summarizing content from a sample note
   * Verify image extraction and analysis capabilities (if applicable)

### Common OneNote Integration Use Cases

#### Note & Knowledge Management

* **Automated Note Creation**: Instantly generate meeting notes, project logs, or brainstorming pages using AI prompts
* **Content Summarization**: Summarize lengthy notes or extract key points and action items from pages
* **Search & Retrieval**: Quickly find specific notebooks, sections, or pages based on keywords or topics

#### Organization & Collaboration

* **Notebook & Section Organization**: Create and structure notebooks and sections for projects, teams, or personal use
* **Shared Note Management**: Collaborate on shared notebooks, update content, and track changes
* **Cross-Referencing**: Link related notes and sections for easy navigation and context

#### Content Automation

* **Template Generation**: Automatically create pages with predefined templates for meetings, reports, or checklists
* **Bulk Updates**: Apply changes or add content to multiple pages or sections at once
* **Image & File Analysis**: Extract and analyze text or data from images embedded in notes

### Troubleshooting

#### Authentication Issues

**Problem**: OAuth authentication failures

* **Solution**: Verify the redirect URL is exactly `https://nango.theblockbrain.ai/oauth/callback`
* **Check**: Ensure admin consent is granted for all required permissions
* **Verify**: Client secret hasn't expired and is correctly entered

#### OneNote Permission Errors

**Problem**: Cannot access or modify notebooks, sections, or pages

* **Solution**: Confirm `Notes.Read.All` and `Notes.ReadWrite.All` permissions are granted
* **Check**: Verify the user has an active Microsoft 365 account with OneNote enabled
* **Validate**: Test with a different user account to isolate permission issues

#### Notebook or Page Access Issues

**Problem**: Notebooks, sections, or pages not accessible

* **Solution**: Ensure the user has access to the specific notebook or section in OneNote
* **Check**: Verify the user is signed in with the correct Microsoft account
* **Test**: Try accessing the content directly in OneNote to confirm permissions

#### Scope Configuration Problems

**Problem**: Scopes not being saved or recognized

* **Solution**: Add each scope individually using the interface
* **Check**: Remove any duplicate or malformed scopes
* **Verify**: Ensure all required scopes are present in the configuration

### Security and Compliance

#### Data Protection

* **Notebook Security**: All OneNote notebook data is handled according to Blockbrain's security policies
* **Note Privacy**: Access to notebooks, sections, and pages respects user permissions and privacy settings
* **Content Confidentiality**: Note content, including text and images, is processed with appropriate confidentiality measures

#### Compliance Considerations

* **GDPR Compliance**: OneNote data processing follows GDPR and other relevant data protection requirements
* **Data Retention**: Configure appropriate data retention policies for notes and user-generated content
* **Audit Logging**: All OneNote Agent activities are logged for compliance and reporting purposes

#### Access Control

* **User Permissions**: The agent inherits the authenticated user's OneNote permissions.
* **Notebook Access**: Respects access restrictions for shared and private notebooks and sections.
* **Security Groups**: Can be configured to work with Azure AD security groups and OneNote sharing settings.

### Performance Optimization

#### Post Processing

* **Batch Operations**: Configure batch processing for large post search and analysis operations
* **Rate Limiting**: Respect Microsoft Graph API rate limits for Viva Engage
* **Caching**: Implement appropriate caching for frequently accessed community data

#### Community Efficiency

* **Search Frequency**: Configure optimal search intervals for community monitoring
* **Content Filtering**: Set up filters to process only relevant posts and discussions
* **Timeline Handling**: Ensure proper timestamp handling for post chronology and feed management

### Next Steps

After successful MS Viva Engage Agent configuration:

* **User Training**: Provide training on community search and discussion analysis AI features
* **Integration Setup**: Configure integration with existing collaboration workflows
* **Monitoring**: Set up monitoring for agent performance and community engagement insights

### Support and Resources

For assistance with MS Viva Engage Agent configuration:

* **Blockbrain Support**: Contact your Customer Success Manager for feature-specific help
* **Microsoft Documentation**: Reference Microsoft Graph API documentation for detailed permission information
* **Azure AD Troubleshooting**: Use Azure AD sign-in logs for authentication diagnostics
