OpenAI-Redis Conversation System

by Gaya56
MIT License

Integrations

  • Uses .env files to manage environment variables and credentials for API keys and configuration settings

  • Integrates with OpenAI's chat models to process and respond to user messages, with support for function calling via MCP tools

  • Utilizes Redis for persistent conversation storage and session management with configurable time-to-live functionality

AI 세션 MCP

세션 저장을 위해 OpenAI의 API와 Upstash Redis를 통합하고, Machine Conversation Protocol(MCP) 아키텍처를 활용하는 대화형 AI 시스템입니다.

특징

  • 세션 관리 : Redis를 사용한 지속적인 대화 저장
  • 세션 TTL : 세션의 구성 가능한 수명
  • 대화 기록 : 메시지 기록을 추적하고 관리합니다.
  • OpenAI 통합 : OpenAI 채팅 모델과의 원활한 통합
  • 도구 실행 : MCP 도구를 통한 OpenAI 함수 호출 지원

건축학

이 시스템은 다음과 같은 주요 구성 요소로 구성되어 있습니다.

  • SessionManager : Redis에서 대화 저장을 처리합니다.
  • OpenAIClient : OpenAI에 대한 API 요청을 관리합니다.
  • ConversationController : 사용자 메시지를 처리하고 대화 흐름을 관리합니다.
  • MCPToolManager : 도구 등록 및 실행을 처리합니다.

세션 관리자

SessionManager 클래스는 Upstash Redis에서 대화 세션을 저장, 검색, 관리하는 방법을 제공합니다.

특징

  • 고유 ID로 세션 생성
  • 사용 가능한 모든 세션 나열
  • 세션 세부 정보 및 대화 내역을 확인하세요
  • 기존 세션에 메시지 추가
  • TTL을 사용한 세션 만료

사용 예

지엑스피1

설정

  1. 프로젝트 루트에 자격 증명을 사용하여 .env 파일을 만듭니다.
UPSTASH_REDIS_URL=your_upstash_redis_url UPSTASH_REDIS_TOKEN=your_upstash_redis_token OPENAI_API_KEY=your_openai_api_key OPENAI_MODEL=gpt-4o SESSION_TTL_DAYS=30
  1. 요구 사항을 설치하세요:
pip install -r requirements.txt
  1. 애플리케이션을 실행합니다.
python main.py
-
security - not tested
A
license - permissive license
-
quality - not tested

Upstash Redis와 통합된 OpenAI API를 사용하여 세션을 저장하는 지속적인 AI 대화 시스템으로, MCP 아키텍처를 통한 도구 통합을 지원하여 사용자가 여러 대화의 맥락을 유지할 수 있습니다.

  1. 특징
    1. 건축학
      1. 세션 관리자
        1. 특징
        2. 사용 예
      2. 설정

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          This server provides access to the Perplexity AI API, enabling interaction through chatting, searching, and documentation retrieval within MCP-based systems.
          Last updated -
          5
          2
          JavaScript
        • -
          security
          F
          license
          -
          quality
          Manages AI conversation context and personal knowledge bases through the Model Context Protocol (MCP), providing tools for user data, conversation content, and knowledge management.
          Last updated -
          1
          TypeScript
        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.
          Last updated -
          1
          TypeScript
        • -
          security
          A
          license
          -
          quality
          An MCP server that extends AI agents' context window by providing tools to store, retrieve, and search memories, allowing agents to maintain history and context across long interactions.
          Last updated -
          5
          TypeScript
          MIT License

        View all related MCP servers

        ID: zj6ammmwzq