{"id":26045150,"url":"https://github.com/tfpickard/grueblergeist","last_synced_at":"2026-04-13T06:35:38.957Z","repository":{"id":279858848,"uuid":"939846933","full_name":"tfpickard/grueblergeist","owner":"tfpickard","description":"Grüblergeist: A self-evolving AI assistant that rewrites itself, adapts to you, and occasionally answers in a voice from a life you haven't lived yet.","archived":false,"fork":false,"pushed_at":"2025-03-01T08:12:23.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-07T19:36:22.915Z","etag":null,"topics":["chatbot","flask","gpt","latent-iterations","llm","llm-training","machine-learning","natural-language-processing","openai","postgresql","recursive-philosophy","self-evolving","self-improving"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tfpickard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-27T07:51:21.000Z","updated_at":"2025-03-01T08:12:30.000Z","dependencies_parsed_at":"2025-02-28T05:35:39.767Z","dependency_job_id":"f3799e50-a0e5-4150-a1c3-d189f12cff90","html_url":"https://github.com/tfpickard/grueblergeist","commit_stats":null,"previous_names":["tfpickard/grueblergeist"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tfpickard/grueblergeist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfpickard%2Fgrueblergeist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfpickard%2Fgrueblergeist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfpickard%2Fgrueblergeist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfpickard%2Fgrueblergeist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tfpickard","download_url":"https://codeload.github.com/tfpickard/grueblergeist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tfpickard%2Fgrueblergeist/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268297291,"owners_count":24228123,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["chatbot","flask","gpt","latent-iterations","llm","llm-training","machine-learning","natural-language-processing","openai","postgresql","recursive-philosophy","self-evolving","self-improving"],"created_at":"2025-03-07T19:32:04.973Z","updated_at":"2026-04-13T06:35:38.916Z","avatar_url":"https://github.com/tfpickard.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grüblergeist: A Self-Evolving AI Assistant\n\n**Grüblergeist** is an advanced, self-evolving chat assistant designed to mimic user behavior, improve its own code, and provide intelligent, engaging conversations. It is built with **Python 3.10+ (future-ready for 3.13)** and integrates **OpenAI's GPT models or local models like Ollama**.\n\nThis project was born from the idea of creating a **\"Virtual You\"**—a chatbot that not only chats but also **evolves its own personality, response style, and even refines its own code** over time.\n\n---\n\n## **Core Features**\n✅ **Mimics Your Personality \u0026 Writing Style** (Extracted from past conversations)  \n✅ **Self-Evolves via OpenAI API** (Refactors its own source code using GPT-4)  \n✅ **CLI + Web UI** (Rich CLI for terminal users, Flask-based Web Interface)  \n✅ **PostgreSQL for Memory** (Stores past chats, user preferences, and system evolution history)  \n✅ **Dynamic Prompts** (No static lists! AI generates its own variation each time)  \n✅ **Supports OpenAI \u0026 Local Models** (Choose between API-based GPT or local Ollama models)  \n✅ **Configurable \u0026 Extendable** (JSON-based configuration, modular structure)\n\n---\n\n## **Project Structure**\n```\ngrueblergeist/\n├── assistant/\n│   ├── __init__.py\n│   ├── config.py          # Configuration settings\n│   ├── db.py              # PostgreSQL ORM and conversation storage\n│   ├── llm_client.py      # OpenAI \u0026 Ollama API interface\n│   ├── chat_assistant.py  # Main chat engine, now with personality emulation\n│   ├── cli.py             # Rich-based command-line interface\n│   ├── web.py             # Flask-based web UI\n│   ├── evolve.py          # Self-modifying AI logic\n├── main.py                # Entry point for CLI/Web modes\n├── config.json            # Configuration file\n├── requirements.txt       # Dependencies\n├── setup.sh               # Install script (virtualenv, Docker, PostgreSQL)\n├── analyze_chat.py        # Extracts user language patterns from past chats\n├── convert_chatgpt_export.py  # Converts exported ChatGPT data to training format\n├── README.md              # (This file)\n```\n\n---\n\n## **Making Grüblergeist Mimic You**\n### **1. Extract Your Writing Style**\nTo make Grüblergeist sound like you, we **analyze your past conversations** for:\n- **Tone** (Casual? Technical? Witty?)\n- **Common Phrases** (Signature expressions)\n- **Response Structure** (Concise vs. Detailed)\n- **Topic Preferences** (IoT, AI, Sci-Fi, Humor, etc.)\n- **Decision-Making Style** (Pragmatic? Theoretical?)\n\nRun:\n```bash\npython3 analyze_chat.py --file /mnt/data/user_chat_history.md\n```\nThis will generate a **`user_style_profile.json`** that Grüblergeist will use.\n\n### **2. Integrate Your Style into the AI**\nGrüblergeist will now **load your response style** and use it in every conversation. The `chat_assistant.py` module was updated to:\n- Load your **`user_style_profile.json`**.\n- Adjust responses dynamically to **mimic your phrasing, tone, and common phrases**.\n\n---\n\n## **How Grüblergeist Evolves Itself**\nGrüblergeist can **rewrite its own source code** using **GPT-4**. This means:\n- It can **refactor functions** for better performance.\n- It can **add new features** based on instructions.\n- It can **keep logs of all past versions** for rollback.\n\n### **Example: Self-Evolving Command**\n```bash\n./main.py --mode evolve --source assistant/cli.py --output assistant/cli_v2.py   --instructions \"Refactor the CLI to support interactive help commands.\"\n```\n\nTo **let the AI evolve itself**:\n```bash\n./main.py --mode evolve-self --source assistant/evolve.py --output assistant/evolve_v2.py\n```\n\n---\n\n## **Installation \u0026 Setup**\n### **1. Clone the Repository**\n```bash\ngit clone https://github.com/yourusername/grueblergeist.git\ncd grueblergeist\n```\n\n### **2. Run Setup**\n```bash\nchmod +x setup.sh\n./setup.sh\n```\nThis will:\n- Install dependencies (`pip install -r requirements.txt`)\n- Start a **PostgreSQL Docker container**\n- Set up your Python environment\n\n### **3. Configure OpenAI API Key**\nIf using OpenAI:\n```bash\nexport OPENAI_API_KEY=\"your-openai-api-key\"\n```\n\n### **4. Start Grüblergeist**\n#### **CLI Mode**\n```bash\n./main.py --mode cli\n```\n#### **Web Mode**\n```bash\n./main.py --mode web\n```\nVisit **http://127.0.0.1:5000** to chat in the browser.\n\n---\n\n## **Debugging \u0026 Fixes**\n### **Docker Issues**\nIf PostgreSQL doesn’t start, try:\n```bash\nsudo systemctl restart docker\n```\nIf you see **kernel module mismatches**, check:\n```bash\nls /usr/lib/modules/\"$(uname -r)\"\n```\n\n### **Fix OpenAI API Errors**\nIf you see:\n```\nYou tried to access openai.ChatCompletion, but this is no longer supported.\n```\nUpdate your `llm_client.py`:\n```python\nclient = openai.OpenAI()\nresponse = client.chat.completions.create(model=\"gpt-4\", messages=messages)\n```\nAnd upgrade OpenAI:\n```bash\npip install --upgrade openai\n```\n\n---\n\n## **Future Enhancements**\n🔹 **Train a Fine-Tuned GPT Model** with user-specific data  \n🔹 **Vector Memory for Context Awareness**  \n🔹 **Real-time Evolution Monitoring** (Graphing improvements over time)  \n🔹 **Multi-Agent Mode** (Multiple AI personalities)  \n\n---\n\n## **Final Thoughts**\nGrüblergeist is an **AI that writes itself**, designed to become **more like you** with each conversation. It is:\n- **Extensible** 🚀 – Modify prompts, train models, and add new logic.  \n- **Self-Improving** 🔁 – Uses GPT to rewrite and optimize itself.  \n- **Personalized** 🤖 – Mimics your writing style, humor, and decision-making.\n\n### **Want to Make it Even More You?**\nTrain a **fine-tuned model** with your chat history. This will make Grüblergeist **even more precise** in its mimicry.\n\n---\n\n## **License**\n[MIT License](https://opensource.org/licenses/MIT)  \nFeel free to contribute, modify, and make Grüblergeist **your own.**\n\n---\n\n**Welcome to the next level of AI self-improvement. Enjoy Grüblergeist!** 🚀👻\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfpickard%2Fgrueblergeist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftfpickard%2Fgrueblergeist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftfpickard%2Fgrueblergeist/lists"}