TodoAIAgent is a smart AI agent that can manage your tasks by adding, retrieving, updating, and deleting todos purely based on natural language processing. The AI assistant follows a structured approach with START, PLAN, ACTION, OBSERVATION, and OUTPUT states to interact with the user and manage tasks in a PostgreSQL database.
- Add new todos
- Retrieve all todos
- Update existing todos
- Delete todos by ID
- Search todos by keyword
-
Clone the repository:
git clone https://github.com/achhayapathak/TodoAIAgent.git cd TodoAIAgent -
Install dependencies:
pnpm install
-
Set up the PostgreSQL database using Docker:
docker-compose up -d
-
Generate the database schema:
pnpm run generate
-
Start the application:
pnpm start
-
Interact with the AI assistant through the command line:
>> Add a task for shopping groceries >> Show all tasks >> Update task with ID 1 >> Delete task with ID 2
getAllTodo(): Returns all the todos from the databasecreateTodo(): Creates a new todo in the database and returns the ID of the tododeleteTodoById(id: string): Deletes the todo by ID given in the databasesearchTodo(query: string): Searches for all todos matching the query usingilikein the databaseupdateTodo(): Updates the existing todo with the given ID in the input with the provided object
The project uses environment variables defined in the .env file. Make sure to configure the following variables in this file:
- DATABASE_URL: Postgres DB URL
- API_KEY: Google Gemini API Key
Feel free to open issues or submit pull requests for any improvements or bug fixes.
This project is licensed under the MIT License.