# 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="/files/ikR2AL5octrVSvEocI7Z">/files/ikR2AL5octrVSvEocI7Z</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="/files/X7MpGP1nVARHAWPFype1">/files/X7MpGP1nVARHAWPFype1</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="/files/B0YSrfJEsajkJAOrGyLx" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/7B1iYHNz9yAvSvOSb5bH" 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blockbrain.ai/for-admins/agents/onenote-agent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
