Notion Conversational Agent
The Notion Conversational Agent is an AI-powered assistant that interacts with your Notion workspace through natural language conversations. This flow performs Notion-related tasks like creating pages, searching for information, and managing content, all through a chat interface.
Prerequisites
- Notion App
- Notion account and API key
- OpenAI API key
- Download Flow Conversation Agent Flow(Download link)
Flow Components
Input and Output
- Chat Input: Accepts user queries and commands
- Chat Output: Displays the agent's responses
Language Model
- OpenAI Model: Processes user input and generates responses
Agent and Tools
- Tool Calling Agent: Coordinates the use of various Notion tools based on user input
- Toolkit: Combines multiple Notion-specific tools into a single toolkit
- Notion Tools: Various components for interacting with Notion, including:
- List Users
- List Database Properties
- List Pages
- Page Content Viewer
- Create Page
- Update Page Property
- Add Content to Page
- Search
Memory and Prompt
- Chat Memory: Stores conversation history
- Prompt: Provides system instructions and context for the agent
- Current Date: Supplies the current date and time for context
Run the Conversational Notion Agent
- Open Langflow and create a new project.
- Add the components listed above to your flow canvas, or Download the Conversation Agent Flow(Download link) and Import the JSON file into Langflow.
- Connect the components as shown in the flow diagram.
- Input the Notion and OpenAI API keys in their respective components.
- To start the flow, click the "Play" button in Langflow.
- In the chat interface, enter a Notion-related request or question. For example:
- "Create a new page in my task database"
- "Search for pages about project management"
- "List all users in my Notion workspace"
- The agent will process your request, use the appropriate Notion tools, and provide a response.
- Continue the conversation, asking follow-up questions or giving new commands as needed.
Example Interactions
_46User: List all the users in my Notion workspace._46_46Agent: Certainly! I'll use the Notion User List tool to retrieve that information for you. One moment please._46_46[Agent uses the Notion User List tool]_46_46Here's a list of users in your Notion workspace:_46_461. John Doe (john@example.com)_462. Jane Smith (jane@example.com)_463. Alex Johnson (alex@example.com)_46_46Is there anything specific you'd like to know about these users or any other Notion-related task I can help you with?_46_46User: Create a new page in my Projects database with the title "Website Redesign"._46_46Agent: Certainly! I'd be happy to create a new page in your Projects database with the title "Website Redesign". I'll use the Notion Page Creator tool to do this. First, let me check the properties of your Projects database to ensure we include all necessary information._46_46[Agent uses the Notion Database Properties tool]_46_46I've retrieved the properties for your Projects database. Now, I'll create the new page with the title "Website Redesign". One moment please._46_46[Agent uses the Notion Page Creator tool]_46_46Great news! I've successfully created a new page in your Projects database with the title "Website Redesign". Here are the details:_46_46- Title: Website Redesign_46- Page ID: [page_id_here]_46- URL: [page_url_here]_46_46Is there any additional information you'd like me to add to this new project page, such as a description, due date, or assigned team members?_46_46User: Yes, please add a description: "Redesign company website to improve user experience and modernize the look."_46_46Agent: Certainly! I'd be happy to add that description to the "Website Redesign" project page. I'll use the Add Content to Page tool to update the page with this information._46_46[Agent uses the Add Content to Page tool]_46_46I've successfully added the description to your "Website Redesign" project page. Here's a summary of what I've done:_46_461. Located the "Website Redesign" page using the page ID from our previous interaction._462. Added the following content to the page:_46_46 Description: Redesign company website to improve user experience and modernize the look._46_46The description has been added as a new text block on the page. Is there anything else you'd like me to add or modify on this project page?
Customization
The flow can be customized to meet your team's specific needs.
Customize this flow by:
- Adjusting the system prompt to change the agent's behavior or knowledge base.
- Adding or removing Notion tools based on your specific needs.
- Modifying the OpenAI model parameters (e.g., temperature) to adjust the agent's response style.
Troubleshooting
If you encounter issues:
- Ensure all API keys are correctly set and have the necessary permissions.
- Check that your Notion integration has access to the relevant pages and databases.
- Verify that all components are properly connected in the flow.
- Review the Langflow logs for any error messages.
For more advanced usage and integration options, refer to the Notion API documentation and Langflow documentation.