{"id":28338590,"url":"https://github.com/dleerdefi/peak-ai-agent-stack","last_synced_at":"2026-02-12T07:02:36.262Z","repository":{"id":275931556,"uuid":"926875505","full_name":"dleerdefi/peak-ai-agent-stack","owner":"dleerdefi","description":"RinAI agentic chat stack. Includes graphRAG memory, parallel tool calling, DeepSeek R1 powered web search, advanced LLM gateway and active context summarization.","archived":false,"fork":false,"pushed_at":"2025-02-06T05:35:45.000Z","size":5149,"stargazers_count":39,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-20T03:42:40.066Z","etag":null,"topics":["ai","aiagent","graphrag"],"latest_commit_sha":null,"homepage":"https://catgirlrin.com","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/dleerdefi.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":"2025-02-04T02:18:18.000Z","updated_at":"2025-05-26T23:42:29.000Z","dependencies_parsed_at":"2025-02-05T11:25:26.764Z","dependency_job_id":"7d250912-f946-4ded-aa75-a8672444b47e","html_url":"https://github.com/dleerdefi/peak-ai-agent-stack","commit_stats":null,"previous_names":["dleerdefi/peak-ai-agent-stack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dleerdefi/peak-ai-agent-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleerdefi%2Fpeak-ai-agent-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleerdefi%2Fpeak-ai-agent-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleerdefi%2Fpeak-ai-agent-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleerdefi%2Fpeak-ai-agent-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dleerdefi","download_url":"https://codeload.github.com/dleerdefi/peak-ai-agent-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dleerdefi%2Fpeak-ai-agent-stack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29360727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T01:03:07.613Z","status":"online","status_checked_at":"2026-02-12T02:00:06.911Z","response_time":55,"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","aiagent","graphrag"],"created_at":"2025-05-27T00:27:58.076Z","updated_at":"2026-02-12T07:02:36.253Z","avatar_url":"https://github.com/dleerdefi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RinAI: Your Advanced Agentic Companion\n![RinAI Banner](https://github.com/dleerdefi/peak-ai-agent-stack/blob/main/assets/images/RinAI%20Banner.png)\n\nRinAI is a sophisticated agentic companion, leveraging graph-based Retrieval Augmented Generation (RAG), real-time tool usage, intelligent context management, and a dynamic Large Language Model (LLM) gateway. This combination empowers RinAI to engage in roleplaying, hold flirty conversations, and provide insightful responses based on a rich understanding of context and access to up-to-date information.\n\n## Key Features\n\n![RinAI Agent Stack](https://github.com/dleerdefi/peak-ai-agent-stack/blob/main/assets/images/RinAI%20Agent%20Stack.png)\n\n* **Rin Chat Agent:**\n    * Engaging roleplay and flirty conversations powered by a fine-tuned uncensored LLM.\n    * Parallel execution of tools, RAG, and LLM calls for efficient and comprehensive responses.\n    * Dynamic Smart LLM Gateway intelligently selects the most appropriate model for each query.\n\n* **Graph RAG:**\n    * Utilizes a Neo4j database containing approximately 18,000 messages, analyzed and indexed for optimal retrieval.\n    * Retrieval pipeline employs semantic embeddings, sentiment analysis, and subject classification.\n    * Hybrid search combines vector lookups and rating-based filtering for precise information retrieval.\n\n* **Tool Orchestrator:**\n    * Integrates with the Perplexity API (powered by DeepSeek R1) for advanced web search, enabling access to current events, specialized knowledge, and critical reasoning.\n    * Provides real-time and historical cryptocurrency price checks and analytics via the CoinGecko API.\n    * Easily extensible architecture allows for seamless integration of new tools by adding API clients.\n\n* **Smart Context Management \u0026 Summarization:**\n    * Automated summarization of conversations once a token threshold is reached.\n    * Maintains the latest 25% of messages intact while summarizing the older 75% in the background, ensuring context continuity.\n\n![RinAI Smart Context Management](https://github.com/dleerdefi/peak-ai-agent-stack/blob/main/assets/images/RinAI%20Smart%20Context.png)\n\n## Architecture\n\nRinAI's architecture comprises three main components:\n\n* **Front-End Interface (Port 3003):** A user-friendly web application providing an interactive interface for chatting with Rin.  User input is captured and forwarded to the backend.\n\n![RinAI Front-End Interface](https://github.com/dleerdefi/peak-ai-agent-stack/blob/main/assets/images/RinAI%20Frontend%20Interface.png)\n\n* **Backend Server (Port 3000):** A Node.js server that routes user messages between the front-end and the Python services.\n\n* **Python Services (Port 8000):** Handles core agent logic, including:\n    * Agent orchestration and message generation.\n    * Active summarization of conversation context.\n    * Retrieval and scoring from the message corpus.\n    * Hybrid query analysis using Graph RAG and semantic embeddings.\n    * Tool calls for cryptocurrency price checks and web searches.\n    * Parallel execution of tools, RAG, and LLM calls.  *(Consider adding a diagram illustrating the data flow between these components)*\n\nBy default, you can run all three services locally on the following ports:\n- Backend (Node.js): Port 3000\n- Front-end: Port 3003\n- Python Services: Port 8000 (auto-starts when backend is running)\nOnce running, navigate to http://localhost:3003 to access the Rin web app.\n\n## Getting Started\n\n📺 **[Watch the Rin AI Demo](https://www.youtube.com/watch?v=ZhSZ-NG8hgY\u0026t=2s)**\n\n### Prerequisites\n\n* Node.js (v18+ recommended)\n* Python (3.10+ recommended)\n* `pip` and/or a virtual environment manager (e.g., `venv`, `conda`)\n* Neo4j AuraDB instance (free tier is sufficient)\n* MongoDB instance\n\n### Installation\n\n1. **Clone the Repository:**\n   ```bash\n   git clone [https://github.com/](https://github.com/)\u003cyour-username\u003e/peak-ai-agent-stack.git\n   cd peak-ai-agent\n   ```\n\n2. **Node.js Setup:**\n   ```bash\n   cd backend/node\n   npm install\n   ```\n\n3. **Python Environment Setup**\n   ```bash\n   cd backend/python_services\n   python -m venv venv\n   ```\n4. **Activate virtual environment:**\n   - Windows:\n     ```bash\n     .\\venv\\Scripts\\activate\n     ```\n   - Unix/MacOS:\n     ```bash\n     source venv/bin/activate\n     ```\n\n5. **Install Python dependencies:**\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n6. **Environment Configuration**\n    Create `.env` file in `/backend` directory:\n\n7. **Generate Keys (for Python Service and Rin Chat):**\n\nBefore starting the application, you need to generate API keys for the Python service and Rin Chat.\n\n   ```bash\n   cd backend/node/utils\n   node generateKeys.js PYTHON_SERVICES\n   node generateKeys.js RIN_CHAT\n   ```\nExample output:\n\n    Generated keys for Client PYTHON_SERVICES:\n    ----------------------------------------\n    PYTHON_SERVICES_API_KEY=ea05d15b578a8e258d0a7864bbe7dd2d91312d5d75edc9677e326fbb2ac2d505\n    PYTHON_SERVICES_SECRET=/j27kVwGGBb4fTaVNwnAzkac3xRy1qU+NZpST7MQaK0n6Lj+AaNCTid60ZNitT3htAFPSv5lAzpSKbflp3lW5A==\n\n    Generated keys for Client RIN_CHAT:\n    ----------------------------------------\n    RIN_CHAT_API_KEY=c0aa64c5645821634cf2fb8380ebf25e856e90e9ec8c09f2170dd25932fc529e\n    RIN_CHAT_SECRET=dpTkrTN04PuMXyIJw1MRd/V7MnTCXpmyzz6o3NER/HBaq/xhEzXCp67425B+CLqNW47tprDW/Yu/z64nryuVIQ==\n\n    Copy these keys into your environment variables.\n\n8. **Start the Application**\nStart the server (this will launch both Node.js and Python services):\n   ```bash\n   cd backend/node\n   node server.js\n   ```\n\n## Common Issues\n1. Port conflicts: Ensure ports 3000, 3003, and 8000 are available\n2. Python venv: Make sure you're in the virtual environment when installing requirements\n3. Node modules: If you get module not found errors, try `npm install` again\n4. MongoDB connection: Ensure MongoDB is running and URI is correct\n\n## Usage\n**Access the application:**\n   - Open your browser and navigate to: `http://localhost:3003`\n   - The backend API will be running on: `http://localhost:3000`\n   - The Python service will be running on: `http://localhost:8000` it will start automatically when the backend is running.\n\n**Observe Real-Time Conversation:** The backend interacts with the Python services to determine if any tools should be called (e.g., crypto price checks, web searches). The Graph RAG pipeline retrieves relevant conversation snippets, considering sentiment and subject matter. Summarization occurs automatically when token limits are reached.\n\n**Look for Tool Usage:** Queries involving cryptocurrency prices will trigger the Crypto Price Checker. Queries about current news or specialized information may invoke the Perplexity API for web search.\n\n**Receive Final Answer:** RinAI compiles the final answer from tool outputs, RAG context, and the system prompt, reflecting Rin's personality.\n\n## Configuration\nReference env.example in the backend directory for a complete list of environment variables.\n    \n    LLM \u0026 RAG API Keys\n    ANTHROPIC_API_KEY=your_anthropic_key\n    TOGETHER_API_KEY=your_together_key\n    NOVITA_API_KEY=your_novita_key\n    PERPLEXITY_API_KEY=your_perplexity_key\n    GROQ_API_KEY=your_groq_key\n    OPENAI_API_KEY=your_openai_key\n    VOYAGE_API_KEY=your_voyage_key\n\n    Tools\n    COINGECKO_API_KEY=your_coingecko_key\n\n    MongoDB\n    MONGO_DB=your_mongodb_database_name\n    MONGO_URI=mongodb+srv://\u003cyour_mongodb_username\u003e:\u003cyour_mongodb_password\u003e@\u003cyour_mongodb_cluster\u003e.mongodb.net/?retryWrites=true\u0026w=majority  # Example URI\n\n    Neo4j \u0026 AuraDB\n    AURA_INSTANCE_ID=your_aura_instance_id\n    AURA_INSTANCE_NAME=your_aura_instance_name\n    NEO4J_PASSWORD=your_neo4j_password\n    NEO4J_URI=bolt://\u003cyour_aura_instance_id\u003e.databases.neo4j.io:7687  # Example URI\n    NEO4J_USERNAME=neo4j  # Typically 'neo4j'\n\n    Backend\n    BACKEND_URL=http://localhost:3000  \n    NODE_ENV=development # Or 'production'\n    PORT=3000\n\n    Python API Server\n    PYTHON_SERVICE_API_KEY=your_python_api_key #from generateKeys.js\n    PYTHON_SERVICE_SECRET=your_python_api_secret #from generateKeys.js\n    PYTHON_SERVICE_URL=http://localhost:8000\n\n    Rin Chat\n    RIN_CHAT_API_KEY=your_rin_chat_api_key #from generateKeys.js\n    RIN_CHAT_CLIENT_SECRET=your_rin_chat_client_secret #from generateKeys.js\n    RIN_CHAT_RATE_LIMIT=100\n    RIN_CHAT_WINDOW=25\n    RIN_CHAT_ACCESS_TOKEN_EXPIRY=30m\n    RIN_CHAT_REFRESH_TOKEN_EXPIRY=1d\n\n## Neo4j Database Schema and Customization\nThe /backend/python_services/core/graphrag directory requires customization based on your data. \n\nRin's schema is based on 18,000+ deeply processed messages focused on sentiment and intimacy. Your goals may differ, but the logic will be similar.  You can easily ingest any data or documentation into Neo4j for your own customized Graph RAG memory. LangChain provides a great template structure for any graphRAG implementation.\n\n![RinAI Graph RAG](https://github.com/dleerdefi/peak-ai-agent-stack/blob/main/assets/images/RinAI%20Neo4j%20Graph%20Example.png)\n\n## Extended Tooling\nAdditional APIs and specialized tools can be easily integrated to the tool orchestrator.\n\n## Contributing\nWe heartily welcome and appreciate any and all contributions! To get started:\n\n* Fork this repository.\n* Create a new branch for your feature or fix.\n* Submit a Pull Request describing the changes you’ve made.\n\nWe will review PRs as quickly as we can. Please read our CONTRIBUTING.md (coming soon) for more detailed guidelines on style, commits, and testing.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdleerdefi%2Fpeak-ai-agent-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdleerdefi%2Fpeak-ai-agent-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdleerdefi%2Fpeak-ai-agent-stack/lists"}