Skip to content

mcruz90/ai-need-help

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ai Need Help: AI Personal Assistant

image

=======

An AI assistant webapp using Cohere's LLM models through a Next.js frontend and a FastAPI backend. It implements a Router Agent that can route user requests to the appropriate agent based on the content of the user's message. The available agents are:

  1. a Calendar Agent that calls on tools to modify the user's calendar using Google Calendar API

image

  1. a Web Search Agent that can handle general information-seeking queries and uses Tavily Web Search APIs to ground its responses.

  2. a Tutor Agent that can assist students with their school work and provide responses based on the user's stated learning level.

Additionally, the app also uses Notion API to retrieve pages and databases from the user's Notion workspace and a rich-text editor using Tiptap to aid in creating and editing Notion pages, but this is still in the early stages of development.

The prompt template for the tutor agent is based (with some modification)on the Tutor prompt available on Microsoft's Prompts for Education repository.

This project extends the Cohere Calendar Agent example and the Cohere Tools on Langchain example for web search and general purpose interactions with Cohere's Command R+ model.

Please note that as with all AI models, outputs may not be completely accurate or reliable. Cohere's models were chosen for this project for their commitment to responsible AI development, but as this area is still undergoing a lot of research, the models may still unintentionally generate content that is not appropriate.

Getting Started

Prerequisites

  • Node.js (version 14 or later)
  • Python (version 3.7 or later)
  • Google Cloud Platform account
  • Cohere API key
  • Tavily API key
  • Notion API key

Setup

  1. Clone the repository

    git clone https://github.com/mcruz90/ai-need-help.git
  2. Set up the frontend

    cd frontend
    npm install
  3. Set up the backend

    cd backend
    pip install -r requirements.txt
  4. Configure environment variables:

    For the backend:

    cd ai-assistant-backend
    cp .env.example .env

    Edit the backend .env file and add the following information:

    • COHERE_API_KEY: Your Cohere API key
    • TAVILY_API_KEY: Your Tavily API key
    • CORS_ORIGINS: Comma-separated list of allowed origins for CORS (e.g., http://localhost:3000)

    For the frontend:

    cd ai-assistant
    cp .env.local.example .env.local

    Edit the frontend .env.local file and add the following information:

    • NEXT_PUBLIC_BACKEND_URL: URL of your backend server (e.g., http://localhost:8000)
    • NOTION_TOKEN: Your Notion API key
  5. Set up Google Calendar API:

    • Go to the Google Cloud Console
    • Create a new project/use existing project
    • Enable the Google Calendar API for your project
    • Create credentials (OAuth 2.0 Client ID) and download the credentials.json file
    • Place the credentials.json file in the ai-assistant-backend directory
  6. Run the development server:

    Frontend:

    cd ai-assistant
    npm run dev

    Backend:

    cd ai-assistant-backend
    uvicorn main:app --reload

Open http://localhost:3000 with your browser to see the result.

Features

  • AI-powered chat assistant
  • Google Calendar integration
  • Voice input feature
  • Copy functionality for AI responses
  • Web search integration using Tavily API
  • Notion integration for enhanced productivity

Development

For a list of planned features and improvements, see TODO.md.

Learn More

To learn more about the resources used in this project, check them out here:

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published