Assistant0 an AI personal assistant that consolidates your digital life by dynamically accessing multiple tools to help you stay organized and efficient. Here’s some of the features that can be implemented:
- Gmail Integration: The assistant can scan your inbox to generate concise summaries. It can highlight urgent emails, categorizes conversations by importance, and even suggests drafts for quick replies.
- Calendar Management: By interfacing with your calendar, it can remind you of upcoming meetings, check for scheduling conflicts, and even propose the best time slots for new appointments based on your availability.
- User Information Retrieval: The assistant can retrieve information about the user from their authentication profile, including their name, email, and other relevant details.
- Online Shopping with Human-in-the-Loop Authorizations: The assistant can make purchases on your behalf (using a fake API for demo purposes), with the ability to ask for human confirmation before finalizing transactions.
- Document Upload and Retrieval: The assistant can upload PDF and text documents to the database and retrieve them for context during chat. The docs can be shared with other users.
With tool-calling capabilities, the possibilities are endless. In this conceptual scenario, the AI agent embodies a digital personal secretary—one that not only processes information but also proactively collates data from connected services to provide comprehensive task management. This level of integration not only enhances efficiency but also ushers in a new era of intelligent automation, where digital assistants serve as reliable, all-in-one solutions that tailor themselves to your personal and professional needs.
First, clone this repo and download it locally.
git clone https://github.com/auth0-samples/auth0-assistant0.git
cd auth0-assistant0/authenticate-users/langchain-next-jsNext, you'll need to set up environment variables in your repo's .env.local file. Copy the .env.example file to .env.local.
To start with the basic examples, you'll just need to add your OpenAI API key and Auth0 credentials.
- To start with the examples, you'll just need to add your OpenAI API key and Auth0 credentials for the Web app and Machine to Machine App.
Next, install the required packages using your preferred package manager and initialize the database.
npm install # or bun install
# Optional - start the postgres database
docker compose up -d
# Optional - create the database schema
npm run db:migrate # or bun db:migrateNow you're ready to run the development server:
npm run all:dev # or bun all:devThis will start an in-memory LangGraph server on port 54367 and a Next.js server on port 3000. Open http://localhost:3000 with your browser to see the result! Ask the bot something and you'll see a streamed response:
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
Agent configuration lives in src/lib/agent.ts. From here, you can change the prompt and model, or add other tools and logic.
Building such an assistant is not too difficult. Thanks to frameworks like LangChain, LlamaIndex, and Vercel AI, you can get started quickly. The difficult part is doing it securely so that you can protect the user's data and credentials.
Many current solutions involve storing credentials and secrets in the AI agent application’s environment or letting the agent impersonate the user. This is not a good idea, as it can lead to security vulnerabilities and excessive scope and access for the AI agent.
This is where Auth0 comes to the rescue. As the leading identity provider (IdP) for modern applications, our upcoming product, Auth for GenAI, provides standardized ways built on top of OAuth and OpenID Connect to call APIs of tools on behalf of the end user from your AI agent.
Auth0's Token Vault feature helps broker a secure and controlled handshake between the AI agents and the services you want the agent to interact with on your behalf – in the form of scoped access tokens. This way, the agent and LLM do not have access to the credentials and can only call the tools with the permissions you have defined in Auth0. This also means your AI agent only needs to talk to Auth0 for authentication and not the tools directly, making integrations easier.
- Tool Calling in AI Agents: Empowering Intelligent Automation Securely
- Build an AI Assistant with LangGraph, Vercel, and Next.js: Use Gmail as a Tool Securely
- Call Other's APIs on User's Behalf
This template scaffolds an Auth0 + LangChain.js + Next.js starter app. It mainly uses the following libraries:
- LangChain's JavaScript framework and LangGraph.js for building agentic workflows.
- The Auth0 AI SDK and Auth0 Next.js SDK to secure the application and call third-party APIs.
It's Vercel's free-tier friendly too! Check out the bundle size stats below.
This package has @next/bundle-analyzer set up by default - you can explore the bundle size interactively by running:
$ ANALYZE=true npm run build # or $ ANALYZE=true bun run buildThis project is open-sourced under the MIT License - see the LICENSE file for details.
This project is built by Deepu K Sasidharan.

