{"id":23454860,"url":"https://github.com/ericmaddox/neurollama-ai","last_synced_at":"2026-05-09T15:05:28.601Z","repository":{"id":269375959,"uuid":"907134195","full_name":"ericmaddox/neurollama-ai","owner":"ericmaddox","description":"Interactive AI Chat with Memory and Sentiment Analysis. Features text-to-speech, conversation history retention, and customizable sentiment-aware responses using Llama 3.2 and TextBlob.","archived":false,"fork":false,"pushed_at":"2024-12-28T01:10:12.000Z","size":10297,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T01:54:31.394Z","etag":null,"topics":["ai","artificial-intelligence","artificial-intelligence-projects","artificialintelligence","json","ollama","ollama-api","pyttsx3","text-to-speech","textblob","textblob-sentiment-analysis"],"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/ericmaddox.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-22T22:40:01.000Z","updated_at":"2025-02-17T15:45:00.000Z","dependencies_parsed_at":"2024-12-23T06:33:58.398Z","dependency_job_id":null,"html_url":"https://github.com/ericmaddox/neurollama-ai","commit_stats":null,"previous_names":["ericmaddox/neurollama-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmaddox%2Fneurollama-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmaddox%2Fneurollama-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmaddox%2Fneurollama-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ericmaddox%2Fneurollama-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ericmaddox","download_url":"https://codeload.github.com/ericmaddox/neurollama-ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248328108,"owners_count":21085258,"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":["ai","artificial-intelligence","artificial-intelligence-projects","artificialintelligence","json","ollama","ollama-api","pyttsx3","text-to-speech","textblob","textblob-sentiment-analysis"],"created_at":"2024-12-24T03:14:51.674Z","updated_at":"2026-05-09T15:05:23.573Z","avatar_url":"https://github.com/ericmaddox.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# NeurOllama AI\n\n## Ollama 3.2 - AI Chat with Memories and Sentiment Analysis\n[![Powered by Ollama](https://img.shields.io/badge/Powered%20by-Ollama-blue)](https://ollama.com)\n![License](https://img.shields.io/badge/license-MIT-green)\n![GitHub Issues](https://img.shields.io/github/issues/ericmaddox/neurollama-ai)\n![GitHub Last Commit](https://img.shields.io/github/last-commit/ericmaddox/neurollama-ai)\n![GitHub Forks](https://img.shields.io/github/forks/ericmaddox/neurollama-ai?style=social)\n![GitHub Stars](https://img.shields.io/github/stars/ericmaddox/neurollama-ai?style=social)\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ericmaddox/neurollama-ai\"\u003e\n    \u003cimg src=\"https://github.com/ericmaddox/neurollama-ai/blob/main/media/neurollama_ai.JPEG\" alt=\"NeuroLlama AI\" width=\"200\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis Python script enables an interactive chat with an AI that adjusts its responses based on the sentiment of the user's input. It uses text-to-speech (TTS) to speak the AI's responses and maintains conversation history in a file for continuity. The conversation history is saved, allowing the AI to recall memories from previous sessions and maintain context across interactions. The AI's responses are generated using **Ollama 3.2**, and sentiment analysis is performed with **TextBlob** to gauge the emotional tone of user input, allowing the AI to respond appropriately to frustration or positivity.\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Features](#features)\n- [Requirements](#requirements)\n- [Configuration](#configuration)\n- [How It Works](#how-it-works)\n- [Example](#example)\n- [Notes](#notes)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- **Text-to-Speech**: The AI's responses are read aloud using `pyttsx3`.\n- **Conversation History**: The script keeps track of the last few exchanges for more context in responses.\n- **Sentiment Analysis**: User input is analyzed for sentiment to guide the AI's tone in replies.\n- **File Persistence**: Conversation history is saved to and loaded from a JSON file (`conversation_history.json`).\n- **Customizable Configuration**: Configuration options like voice selection, interaction memory size, and timeout duration can be set in a `config.json` file.\n\n## Requirements\n\n- Python 3.x\n- Required Python libraries:\n  - `pyttsx3`\n  - `subprocess`\n  - `json`\n  - `textblob`\n\nYou can install the necessary dependencies by running:\n\n```bash\npip install pyttsx3 textblob\n```\n\n## Configuration\n\nThe script loads configuration from a `config.json` file. If the file is not found, default settings are used. The configuration file can specify the following settings:\n\n```json\n{\n    \"voice\": \"com.apple.voice.compact.en-US.Samantha\",\n    \"history_file\": \"conversation_history.json\",\n    \"interaction_memory\": 10,\n    \"timeout\": 30\n}\n```\n\n- **voice**: The voice to use for text-to-speech (default: `com.apple.voice.compact.en-US.Samantha`).\n- **history_file**: The file where conversation history is saved (default: `conversation_history.json`).\n- **interaction_memory**: The number of past exchanges the AI remembers to use as context (default: `10`).\n- **timeout**: Time in seconds to wait before considering the conversation as timed out (default: `30`).\n\n## How It Works\n1. **Initialization**: The script initializes the TTS engine (`pyttsx3`) and loads the configuration and conversation history.\n2. **Chat Loop**:\n   - The script prompts the user for input.\n   - It analyzes the sentiment of the input using TextBlob.\n   - If the sentiment is negative, the AI offers a reassuring response. If positive, the AI responds with encouragement. Otherwise, it generates a normal response using Ollama 3.2.\n   - The conversation history is updated and saved after every interaction.\n   - The AI’s response is printed to the console and spoken aloud using TTS.\n3. **Exit**: The conversation can be ended by typing `exit`.\n\n## Example\n\nChat with AI. Type 'exit' to end the conversation.\n\n```plaintext\nYou: Hello, AI!\nAI: I'm glad to hear your positivity! Let's continue.\nYou: I'm frustrated with this project.\nAI: I sense some frustration. I'm here to assist you.\nYou: exit\n```\n\n## Notes\n- **Ollama**: This script assumes you have the ollama CLI tool installed and accessible from the terminal. The AI’s responses are generated by running `ollama run llama3.2`. You can download Ollama from [here](https://ollama.com/download).\n- **TextBlob**: The sentiment analysis uses TextBlob’s polarity, with values ranging from -1 (negative) to 1 (positive).\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request.\n\n## License\n\nThis script is open-source and has an MIT license. Feel free to use and modify it for your personal or professional projects.\n\u003cdiv align=\"right\"\u003e\n  \u003cimg src=\"https://hits.dwyl.com/ericmaddox/neurollama-ai.svg?style=for-the-badge\u0026color=2d343c\u0026labelColor=81c7ff\u0026label=Visitors\" alt=\"GitHub Repository Visit Counter\" /\u003e\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmaddox%2Fneurollama-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fericmaddox%2Fneurollama-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fericmaddox%2Fneurollama-ai/lists"}