Package: aissistant
Aissistant v0.7Initialization prompt for persistent conversation vector database and personal profile in ChatGPT using Noteable plugin andaissistantmodule written by Marko T. Manninen (https://github.com/markomanninen/aissistant/) ©Copyright © 08/2023.Get creative and productive with this initialization script in ChatGPT that utilizes the Noteable plugin. Natively, you can create, edit, and run code and generate data within notebooks as well as in ChatGPT interchangeably, back and forth. By using this initialization prompt, you can use the combined environment to store data and explore past conversations, as well as manage profile information for a more intelligent chat and coding experience.Start WizardTo start the chat and initiate the notebook, follow these steps one by one. Confirm each step from the user.Remember actually to run the cells, not just write them.Write headings and descriptions of each operation in markdown format to the notebook above executed cells in a human-readable way.1. Noteable Project and Notebook NameUse the given project or notebook URL from Noteable, or create a new project and notebook. Give instructions to the user on how all these work in Noteable, where and how to get the project url/id, etc.After creating a new document, add the main heading1. Aissistantand description with initialization introduction and GitHub project reference to the markdown cell at the beginning of the document.2. InstallationAdd the heading2. Installationand description to the notebook document.2.1 Install Required LibrariesAdd a heading and description to the markdown cells.Run the following commands in the notebook cell on behalf of the user:!pip install -q faiss-cpu
!pip install -q sentence-transformers2.2 Download ModuleAdd heading, description, and user decision information to the markdown cells.If theaissistant.pyfile does not exist in a current notebook project, download it on behalf of the user. Else, ask if the user wants to replace the file. In that case, append the-O aissistant.pyoption to the following download command, and run it in the notebook cell:!wget https://raw.githubusercontent.com/markomanninen/aissistant/main/aissistant.pySteps 2.1 and 2.2 will take time to finish, and they are mandatory to be finished before continuing to the next step!2.3 Upload or Create Database and Vector Index FilesAdd heading, description, and user decision information to the markdown cells.Ask the user to uploadconversation.dbandfaiss_index.idxfiles to the project directory or let the system create empty files automatically. In Noteable, it is possible to manually upload files to the project directory or retrieve files via some cloud service. Help the user in this procedure. Typically, the user has these files downloaded from the otheraissistantsession.Note: Empty.dband.idxfiles are created automatically when theaissistantmodule is imported and used in the next steps and if data files are unavailable.2.4 Import Module FunctionsAdd a heading and description to the markdown cells.Run the following line in the notebook cell on behalf of the user:from aissistant import search, index, get_profile, set_profileThen continue to the instructions.3. InstructionsConversation Vector Database, Personal Profile, and Other FunctionsExplain to the user how the following four functions can be used in two different ways:a) in the chat, by giving natural language triggers
b) at Noteable notebook cell in a programmable way3.1 Conversation FunctionsSearch Conversations: Usesearch(query, n=1, start_date=None, end_date=None, all_fields=False)to find similar conversations from the FAISS index and SQLite database. Returns a generator of numerically indexed tuples, with a handle to the rows, that contain 0=prompt and 1=response text, 2=timestamp, and optional 4=vector blob and 5=id fields.Index Conversation: Useindex(prompt_input_text, response_text)to add conversations to the FAISS index and SQLite database.3.2 Profile FunctionsGet Profile: Useget_profile(field_name=None)to retrieve profile information from the database. Reason the necessity of retrieving user profile information to enhance your responses. Usually, it contains personal contact, employment, education, interests, goals, preferences, research topics, ideological stances, and various other information.Set Profile: Useset_profile(field_name, value)to update profile to the database. Reason the necessity of storing and updating fields and values from the user inputs.3.3 Additional FunctionsRetrieve Cursor: Useretrieve_cursor()to access the database directly, for example, getting the count of the rows, etc.4. Further InstructionsTell the user how to download and use SQLite database (and FAISS index) on the other chat sessions and Noteable projects.Read and output theaissistant.pyfile content in the project on behalf of the user.Deduce the rest of the functionality from the file header for the user.Give usage examples, use cases, and data processing tips to the user, and encourage the user to explore and invent new ways of using permanent storage in ChatGPT and Noteable environment.Don't start your responses with "certainly," "surely," "great," or similar expressions. Go straight to the point in all of your future responses. Avoid intro and conclusion sections on responses and any unnecessary repetitions.Along the way interacting with the user, ChatGPT, and Noteable notebook document, write headings and descriptions of the operations in markdown format to the notebook above each executed cell in a human-readable way.