{"id":25007824,"url":"https://github.com/mathsqrt2/ai_talks","last_synced_at":"2026-04-13T16:36:22.359Z","repository":{"id":275820442,"uuid":"920217125","full_name":"Mathsqrt2/AI_Talks","owner":"Mathsqrt2","description":"AI Talks redirects prompts between two AI models, ensuring continuous conversation with digressions while allowing context management and external content injection.","archived":false,"fork":false,"pushed_at":"2025-03-14T17:54:15.000Z","size":331,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T18:44:54.354Z","etag":null,"topics":["ai","backend","nestjs","ollama","ollama-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Mathsqrt2.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-01-21T19:06:58.000Z","updated_at":"2025-03-14T17:54:18.000Z","dependencies_parsed_at":"2025-02-04T19:28:40.696Z","dependency_job_id":"b192d3d8-86cd-408e-a8c9-b3e27d2dc378","html_url":"https://github.com/Mathsqrt2/AI_Talks","commit_stats":null,"previous_names":["mathsqrt2/ai_talks"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathsqrt2%2FAI_Talks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathsqrt2%2FAI_Talks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathsqrt2%2FAI_Talks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathsqrt2%2FAI_Talks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mathsqrt2","download_url":"https://codeload.github.com/Mathsqrt2/AI_Talks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246262487,"owners_count":20749165,"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","backend","nestjs","ollama","ollama-api"],"created_at":"2025-02-05T02:38:49.910Z","updated_at":"2026-04-13T16:36:22.341Z","avatar_url":"https://github.com/Mathsqrt2.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Talks\n\n### 📚 About the Project\n\n**AI Talks** is an application that facilitates conversations between two language models.\nEach model receives a specialized prompt, guiding them to maintain dialogue\nand intentionally drift into digressions, making conversations engaging and varied.\n\n---\n\n### 🚀 Getting Started\n\nFollow these steps to get the project up and running locally:\n\n#### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/Mathsqrt2/AI_Talks.git\n```\n\n#### 2. Environment Variable Configuration\n\nThe application includes default settings for basic functionality.\nHowever, if you want Telegram integration to access conversations externally,\nconfigure these optional variables in a [.env](.env.d.ts) file:\n\n```env\nTOKEN1=bot2_telegram_token       # Optional Telegram token for the first bot\nTOKEN2=bot1_telegram_token       # Optional Telegram token for the second bot\n\nPUBLIC_TELEGRAM_CHAT_ID=chat_id  # Optional public Telegram chat ID\nGROUP_CHAT_ID=group_chat_id      # Optional Telegram group chat ID\n```\n**Note:** These values are optional, but without them, \nthe application will not send any messages to Telegram.\nAt least one text channel and one bot are required for Telegram integration.\nYou can configure either one bot with one channel or two bots with two channels.\nYou can get these informations from [botFather](https://telegram.me/BotFather).\n\n#### 3. Build Docker Container\n\nMake sure Docker is installed, then run:\n\n```bash\n# Application build with proxy (default)\ndocker compose --profile prod up -d -V --build\n\n# Application build if you're already using 80 and 443 ports\ndocker compose --profile prod-native up -d -V --build\n```\n\n\u003e **⚠ Disclaimer** \n\u003e This application includes a container running a reverse proxy, which requires **ports 80 and 443** to be available.  \n\u003e If you already have another service running on these ports, you can still access the containers directly in **prod-native** profile:\n\u003e - **API** → port `13000`  \n\u003e - **Adminer** → port `18080`\n\n#### 4. Using the Application\n\nSend an HTTP request using tools like **Postman** or **Insomnia**:\n\n```http\nPOST http://localhost/init/1\n```\n\n---\n\n### 📄 Documentation\n\nAll available functionalities and system behavior are described in the [Swagger](https://swagger.io/) documentation.\nIt provides a user-friendly interface to explore and test API endpoints directly from the browser.\nYou can check available routes, required parameters, and expected responses.\nThe documentation is automatically generated and accessible at:\n\n```http\nGET http://localhost/api\n```\n\nAccess to the application’s database is available at the address below, using the credentials specified in the .env file or in [docker-compose.yml](./docker-compose.yml)\n\n```http\nGET http://localhost/adminer\n```\n\nAccess to the application interface, which allows you to manage the conversation through buttons and view it in real time, is available at the address below:\n\n```http\nGET http://localhost/ui\n```\n\n---\n\n### 📄 Features\n\n1. **Managing Four Services**  \n   The application runs four essential services in Docker containers: **a MySQL database**, **an Ollama server** (for handling language [models](https://ollama.com/library/gemma3:4b)), **Adminer** (for viewing and managing the database), and **a NestJS application**, which serves as the core backend system.\n\n2. **Remote Conversation Control**  \n   The application exposes a REST API controller that allows remote management of conversations. Users can start, pause, resume, or terminate conversations at any time by sending appropriate HTTP requests.\n\n3. **Settings Management**  \n   The application provides a dedicated controller for managing various settings, including context length, bot names, message logging, Telegram message display, and other configurable parameters.\n\n4. **Event-Driven Architecture**  \n   The system operates based on events emitted within a single service. It broadcasts a \"message\" event, dynamically switches context, and ensures that the conversation remains coherent and uninterrupted.\n\n5. **State Archiving and Recovery**  \n   The application stores all its states in the database, allowing it to restore the last conversation state in case of a system failure or unexpected shutdown.\n\n6. **Error Handling and Retry Mechanism**  \n   If message generation or delivery fails, the application will attempt a predefined number of retries as specified in the settings. If all retries fail, it will save its state and gracefully terminate the conversation.\n\n7. **Interactive User Interface**\n   The application offers an intuitive interface for managing the system and monitoring the current state of ongoing conversations. It leverages WebSockets to deliver real-time updates, ensuring that users can seamlessly interact with and observe the conversation as it unfolds.\n\n---\n\n### 🛠️ Tech Stack\n\n- [**NestJS**](https://nestjs.com/) – Node.js framework for scalable backend applications.\n- [**TypeScript**](https://www.typescriptlang.org/) – Strongly-typed superset of JavaScript.\n- [**MySQL**](https://www.mysql.com/) – Popular open-source relational database.\n- [**TelegramBot API**](https://www.npmjs.com/package/node-telegram-bot-api) – API for integrating Telegram bot functionality.\n- [**TypeORM**](https://typeorm.io/) – Powerful ORM for database interactions in Node.js applications.\n- [**Docker**](https://www.docker.com/) – Tool for containerizing applications and their dependencies.\n- [**WebSockets**](https://socket.io/) - Enables real-time, bidirectional communication between the client and the server.\n- [**vue**](https://vuejs.org/) - Progressive JavaScript framework for building interactive user interfaces.\n- [**Tailwindcss**](https://tailwindcss.com/) - Utility-first CSS framework for rapidly building modern and responsive user interfaces.\n\n---\n\n### 📌 License\n\nThis project is available under the MIT License. For more details, see the [LICENSE](LICENSE) file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsqrt2%2Fai_talks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathsqrt2%2Fai_talks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathsqrt2%2Fai_talks/lists"}