{"id":28417311,"url":"https://github.com/waheed444/chainlit-memory-stream-agent","last_synced_at":"2025-09-12T12:36:13.370Z","repository":{"id":295110655,"uuid":"989142348","full_name":"waheed444/chainlit-memory-stream-agent","owner":"waheed444","description":"This project is an AI assistant built using Chainlit and the OpenAI Agent SDK, powered by Google Gemini models. It supports real-time streaming responses (just like ChatGPT) and remembers previous messages(history/memory) to keep the conversation flowing naturally. ","archived":false,"fork":false,"pushed_at":"2025-05-25T15:43:19.000Z","size":118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-26T00:36:19.895Z","etag":null,"topics":["ai-agents-framework","chainlit","google-gemini-api","openai-agents-sdk","python","uv"],"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/waheed444.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,"zenodo":null}},"created_at":"2025-05-23T16:12:12.000Z","updated_at":"2025-05-25T15:43:23.000Z","dependencies_parsed_at":"2025-05-23T18:08:21.356Z","dependency_job_id":null,"html_url":"https://github.com/waheed444/chainlit-memory-stream-agent","commit_stats":null,"previous_names":["waheed444/chainlit-memory-stream-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/waheed444/chainlit-memory-stream-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed444%2Fchainlit-memory-stream-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed444%2Fchainlit-memory-stream-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed444%2Fchainlit-memory-stream-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed444%2Fchainlit-memory-stream-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/waheed444","download_url":"https://codeload.github.com/waheed444/chainlit-memory-stream-agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/waheed444%2Fchainlit-memory-stream-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274814484,"owners_count":25355079,"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-09-12T02:00:09.324Z","response_time":60,"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":["ai-agents-framework","chainlit","google-gemini-api","openai-agents-sdk","python","uv"],"created_at":"2025-06-04T04:42:56.147Z","updated_at":"2025-09-12T12:36:13.361Z","avatar_url":"https://github.com/waheed444.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chainlit Powered Memory Streaming Agent 🤖\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://github.com/waheed444/chainlit-memory-stream-agent\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/waheed444/chainlit-memory-stream-agent?style=social\" alt=\"GitHub stars\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/waheed444/chainlit-memory-stream-agent\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/forks/waheed444/chainlit-memory-stream-agent?style=social\" alt=\"GitHub forks\"\u003e\n  \u003ca href=\"https://www.python.org/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/python-3.9%2B-blue.svg\" alt=\"Python Version\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://docs.chainlit.io\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Built%20with-Chainlit-764abc.svg\" alt=\"Chainlit\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/waheed444/chainlit-memory-stream-agent/fork\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Contribute-Fork%20repo-blue.svg\" alt=\"Fork\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/waheed444/chainlit-memory-stream-agent/stargazers\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Support-Give%20a%20Star-yellow.svg\" alt=\"Star\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\n\nThis project is an **AI assistant** built using **Chainlit** and the **OpenAI Agent SDK**, powered by **Google Gemini models**. It supports real-time **streaming** responses (just like ChatGPT) and remembers previous messages(history/memory) to keep the conversation flowing naturally. You can use it to build your own smart and responsive chatbot.\n\n##  Prerequisites ✅\n\nBefore running this project, ensure you have the following tools, libraries, and API keys properly configured:\n\n| Tool / Library          | Description                                                                 \n|--------------------------|-----------------------------------------------------------------------------\n| 🐍 Python 3.9+           | Required for running the application and libraries                         \n| 🧬 Chainlit              | Framework for building conversational UIs with LLMs                         \n| 🧠 OpenAI Agent SDK      | Enables agent orchestration and streaming capabilities                     \n| 🌐 Git                   | Version control for cloning and managing the project repository            \n| 🔑 Google Gemini API     | [Get API Key](https://makersuite.google.com/app/apikey) for Gemini models  \n| 🔑 OpenAI API Key        | [Get API Key](https://platform.openai.com/account/api-keys) for streaming  \n| 📦 dotenv                | For managing environment variables securely                                \n| 🧪  VS Code   | Recommended code editor for development                                    \n\n---\n\n\n## Features ✨\n\n* 🔄 **Real-time Token Streaming:** Experience the fluidity of ChatGPT-like responses.\n* 🧠 **Persistent Memory:**  Maintain context across your conversations, ensuring your AI assistant remembers previous interactions.\n* 🔗 **Chainlit Integration:**  Leverage Chainlit's ease of use for rapid UI development and deployment.\n* 🤖 **Gemini Power:**  Utilize the cutting-edge capabilities of the `gemini-2.0-flash` model.\n* 🧰 **OpenAI Agent SDK Integration:**  Benefit from the robust features and flexibility of the OpenAI Agent SDK.\n* 🔐 **Secure API Key Management:**  Safely manage your API keys using a `.env` file.\n* 🚀 **Developer-Friendly Codebase:**  A modular and well-structured Python codebase, making it easy to extend and customize.\n\n\n## ⚙️ Installation Instructions\n\n1. **Clone the Repository:**\n\n   ```bash\n   git clone https://github.com/waheed444/chainlit-memory-stream-agent.git\n   cd chainlit-memory-stream-agent\n   ```\n\n2. **Create and Activate a Virtual Environment:**\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate   # On Windows: venv\\Scripts\\activate\n   ```\n\n3. **Install dependencies:**\n\n```bash\npip install openai-agents chainlit\n       # for UV User's\nuv add openai-agents chainlit\n```\n\n4. **Configure API keys:** Create a `.env` file in the root directory and add your API keys:\n\n - \u003e 📌 Make sure to store your API keys securely in a `.env` file in the root directory:\n\n\n```bash\nGEMINI_API_KEY = paste_your_gemini_api_key_here\n               # OR\nOPENAI_API_KEY = paste_your_openai_api_key_here\n```\n\n5. **Run the App:**\n\n   ```bash\n   chainlit run agent.py\n   ```\n\n   **(Note: You need to have `chainlit` installed.  Install it via `pip install chainlit` if not already present.)**\n\n\n## Usage Instructions 🗣️\n\n### Usage Examples\n\nStart the Chat UI: Once Chainlit is running, open the local URL provided in your terminal and start chatting with your AI assistant.\n\n\nAsk questions like:\n\n```bash\nWho was the founder of Pakistan?\nSummarize the history of Python in 3 lines.\nWhat’s the latest in AI this year?\n```\n\nEnjoy token-by-token responses with context-aware answers based on your memory/previous messages.\n\n\n💡 You can customize the agent's behavior, memory strategy, or switch between Gemini and OpenAI models by modifying the `app.py` and `stream.py` files.\n\n## Contributing\n\n\nWe welcome contributions to improve this project! Please follow these steps:\n\n1. **Fork** the repository.\n2. **Create a new branch:** `git checkout -b feature-name`\n3. **Make your changes** and ensure they adhere to the project's coding style and best practices.\n4. **Commit your changes:** `git commit -m \"Add feature\"`\n5. **Push to the branch:** `git push origin feature-name`\n6. **Submit a pull request** with a clear description of your changes and their benefits.\nIf you find any issues or want to improve this project, feel free to open a [GitHub issue]([![License](https://img.shields.io/badge/License-MIT-blue.svg)https://github.com/waheed444/Chainlit-AiAgent/issues) or submit a pull request.\n\nThis repo is only for learning and exploring new things, feel free to fork it, explore, or give suggestions!\n\n**Star ⭐ the repo if it helps you!**\n\n---\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🙌 Let's Connect\n\n\u003cp align=\"left\"\u003e\n  \u003ca href=\"https://www.linkedin.com/in/waheed444/?originalSubdomain=pk)\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/LinkedIn-blue?style=flat-square\u0026logo=linkedin\" alt=\"LinkedIn\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/waheed444\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/GitHub-181717?style=flat-square\u0026logo=github\u0026logoColor=white\" alt=\"GitHub\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"waheedahmad5519@gmail.com\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Gmail-D14836?style=flat-square\u0026logo=gmail\u0026logoColor=white\" alt=\"Gmail\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaheed444%2Fchainlit-memory-stream-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwaheed444%2Fchainlit-memory-stream-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwaheed444%2Fchainlit-memory-stream-agent/lists"}