{"id":23408471,"url":"https://github.com/shaswata56/genericai","last_synced_at":"2026-02-12T22:33:07.368Z","repository":{"id":269085045,"uuid":"906356247","full_name":"shaswata56/GenericAI","owner":"shaswata56","description":"An intelligent assistant powered by the ReAct framework, leveraging LangChain for tool-based reasoning and Gradio for a user-friendly interface. Supports tasks like weather queries, PDF summarization, image descriptions, and more.","archived":false,"fork":false,"pushed_at":"2024-12-21T12:24:02.000Z","size":362,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-30T12:32:27.534Z","etag":null,"topics":["acting","agent","ai-assistant","chatbot-toolkit","cot","gradio","image-description","langchain","llm","mongodb","openai","pdf-summarization","python","react","reasoning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shaswata56.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-20T18:03:05.000Z","updated_at":"2024-12-27T15:01:39.000Z","dependencies_parsed_at":"2024-12-20T20:32:55.256Z","dependency_job_id":null,"html_url":"https://github.com/shaswata56/GenericAI","commit_stats":null,"previous_names":["shaswata56/genericai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaswata56%2FGenericAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaswata56%2FGenericAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaswata56%2FGenericAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shaswata56%2FGenericAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shaswata56","download_url":"https://codeload.github.com/shaswata56/GenericAI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239372251,"owners_count":19627778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acting","agent","ai-assistant","chatbot-toolkit","cot","gradio","image-description","langchain","llm","mongodb","openai","pdf-summarization","python","react","reasoning"],"created_at":"2024-12-22T15:11:57.323Z","updated_at":"2025-11-02T03:30:31.705Z","avatar_url":"https://github.com/shaswata56.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GenericAI: A ReAct-Based Intelligent Assistant\n\nGenericAI is a versatile AI assistant developed using the ReAct (Reasoning and Acting) framework. It leverages [LangChain](https://langchain.com/) for coordinating language model interactions and [Gradio](https://gradio.app/) for an intuitive interface. With a variety of integrated tools, GenericAI is capable of reasoning through complex queries and executing actions to deliver accurate and well-rounded responses.\n\n## Table of Contents\n\n- [Features](#features)\n- [Demo](#demo)\n- [Installation](#installation)\n  - [Prerequisites](#prerequisites)\n  - [Setup](#setup)\n- [Configuration](#configuration)\n- [Usage](#usage)\n  - [Running the Application](#running-the-application)\n  - [Interacting with GenericAI](#interacting-with-genericai)\n- [Tools](#tools)\n- [Contributing](#contributing)\n- [License](#license)\n- [Acknowledgements](#acknowledgements)\n\n## Features\n\n- **ReAct Framework**: Uses reasoning and acting to address complex queries.\n- **Integrated Tools**: Includes Python REPL, Terminal, Weather API, Web Browsing, PDF Summarization, Image Description, and more.\n- **Chat History Management**: Tracks conversations with MongoDB for contextual responses.\n- **User-Friendly Interface**: Built with Gradio for easy interaction.\n- **Extensible Architecture**: Add or modify tools with minimal effort.\n\n## Demo\n\n![GenericAI Demo](assets/demo.png) \u003c!-- Replace with a demo GIF or screenshot --\u003e\n\nRun the application locally to experience GenericAI in action. Submit questions, provide files, and see how it intelligently uses tools to respond.\n\n## Installation\n\n### Prerequisites\n\n- **Python 3.12**: Install from [python.org](https://www.python.org/downloads/).\n- **MongoDB**: Use [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) for cloud or install locally.\n- **Git**: Required to clone the repository.\n\n### Setup\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone https://github.com/shaswata56/GenericAI.git\n   cd GenericAI\n   ```\n\n2. **Create a Virtual Environment**\n\n   Use a virtual environment to manage dependencies.\n\n   ```bash\n   python3 -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install Dependencies**\n\n   ```bash\n   pip install --upgrade pip\n   pip install -r requirements.txt\n   ```\n\n## Configuration\n\n1. **Environment Variables**\n\n   This repository includes a pre-configured `.env` file. However, when you use it, ensure that you add `.env` to your `.gitignore` to avoid exposing sensitive information. Below is the default content of the `.env` file:\n\n   ```env\n   OPENROUTER_API_KEY=\"your-api-key\"\n   TOGETHER_API_KEY=\"your-api-key\"\n   OPENWEATHERMAP_API_KEY=\"your-api-key\"\n   TAVILY_API_KEY=\"your-api-key\"\n   MONGODB_URL=\"mongodb://localhost:27017/\"\n   LLM_PROVIDER=\"ollama\"\n   LLM_MODEL=\"llava:13b\"\n   VLM_PROVIDER=\"ollama\"\n   VLM_MODEL=\"llava:13b\"\n   ```\n\n   Update the values in the `.env` file with your actual API keys and configuration as needed.\n\n2. **API Keys**\n\n   Obtain API keys for tools like OpenWeatherMap, Tavily, and PubMed, and update the `.env` file accordingly.\n\n## Usage\n\n### Running the Application\n\nActivate the virtual environment if it isn't active:\n\n```bash\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\nStart the application:\n\n```bash\npython GenericAI.py\n```\n\nThe Gradio interface will provide a local URL (e.g., `http://127.0.0.1:8080`). Open the URL in your browser to interact with GenericAI.\n\n### Interacting with GenericAI\n\n1. **Ask a Question**: Enter your query in the text box.\n2. **Upload a File (Optional)**: Upload a file (e.g., PDF, image) for processing.\n3. **View Response**: The response will appear in the markdown output area.\n\n**Example Queries:**\n\n- \"Summarize the attached PDF.\"\n- \"What is the weather like in New York?\"\n- \"Describe the image in the uploaded file.\"\n- \"Count the number of vowels in the word 'OpenAI'.\"\n\n## Tools\n\nGenericAI includes various tools for enhanced functionality:\n\n### Core Tools\n\n- **Python REPL**: Execute Python commands.\n- **Terminal**: Run shell commands.\n- **Weather**: Fetch weather data using OpenWeatherMap.\n- **Search**: Perform web searches.\n- **Calculator**: Solve math problems.\n- **Wikipedia**: Access general knowledge.\n- **YouTube**: Retrieve YouTube video links.\n- **Arxiv**: Search for scientific articles on [arXiv](https://arxiv.org/).\n- **DateTimeNow**: Display the current date and time.\n\n### Specialized Tools\n\n- **LetterInWordCounter**: Count occurrences of a letter in a word.\n- **WebpageBrowser**: Summarize webpage content.\n- **PubMed**: Query medical information.\n- **RecallMemory**: Retrieve past conversations.\n- **VowelCounter**: Count vowels in a string.\n- **TotalLetterCounter**: Count letters in a string.\n- **PdfSummarizer**: Summarize PDF files.\n- **ImgDesc**: Describe images.\n- **ImgDescOnline**: Describe online images.\n- **TxtFileReader**: Read text files.\n- **TxtFileWriter**: Overwrite text files.\n- **TxtFileAppender**: Append to text files.\n- **PdfReader**: Read PDF files.\n- **PdfReaderOnline**: Read online PDFs.\n- **Notepad**: Simple notepad functionality.\n\n### Adding Custom Tools\n\nDefine new tools and register them in the `get_tools` function in `GenericAI.py`. Ensure each tool adheres to input-output standards for smooth integration.\n\n## Contributing\n\nContributions are welcome! Follow these steps to contribute:\n\n1. **Fork the Repository**\n\n   Click the \"Fork\" button at the top right of this page.\n\n2. **Clone the Forked Repository**\n\n   ```bash\n   git clone https://github.com/shaswata56/GenericAI.git\n   cd GenericAI\n   ```\n\n3. **Create a Feature Branch**\n\n   ```bash\n   git checkout -b feature/YourFeatureName\n   ```\n\n4. **Commit Your Changes**\n\n   ```bash\n   git commit -m \"Add Your Feature\"\n   ```\n\n5. **Push to the Branch**\n\n   ```bash\n   git push origin feature/YourFeatureName\n   ```\n\n6. **Open a Pull Request**\n\n   Navigate to your forked repository on GitHub and click \"Compare \u0026 pull request\".\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Acknowledgements\n\n- [ReAct: Synergizing Reasoning and Acting in Language Models](https://react-lm.github.io/) for enabling step-by-step reasoning and acting to solve complex problems.\n- [LangChain](https://langchain.com/) for its powerful framework for language model applications.\n- [Gradio](https://gradio.app/) for its user-friendly interface creation tools.\n- [MongoDB](https://www.mongodb.com/) for scalable storage of chat histories.\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaswata56%2Fgenericai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshaswata56%2Fgenericai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshaswata56%2Fgenericai/lists"}