munjimon822
MCP Servermunjimon822public

real code gpt

파이썬 코드 지식베이스 기반 RAG

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

About This Server

파이썬 코드 지식베이스 기반 RAG

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

RealCodeGPT: 파이썬 코드 기반 RAG

빠르게 업데이트되는 파이썬 라이브러리에 대한 프롬프트의 경우,
LLM이 업데이트 이전의 소스코드와 웹사이트 정보들을 참조해
응답의 예시 코드가 실제로 동작하지 않는 문제가 있습니다.

본 프로젝트는 사용자가 로컬에 설치된 파이썬 패키지가 궁금하면 직접 코드 관련 지식베이스를 구축해 개선된 LLM 응답을 경험할 수 있도록 개발되었습니다.

주요 기능

  1. 로컬에 설치된 파이썬 라이브러리의 소스코드에서 정보를 추출해 neo4j 그래프 데이터베이스를 구축합니다.
  2. Open AI 모델에게 패키지에 대해 질의하면, 그래프 데이터베이스 쿼리를 생성해 관련된 소스코드 정보를 검색합니다
  3. 검색 결과를 바탕으로 사용자 질의에 대해 응답을 생성합니다.

한계
영어로 된 프롬프트를 가정합니다.
사용자 프롬프트에서 데이터베이스 쿼리를 생성하는 과정을 MCP 서버로 구현하기 어려움이 있어, MCP는 지원하지 않습니다.
임베딩에 비용이 발생합니다
(참고: 1500만자 기준 약 12달러, 2025.05, open ai api)

사용 방법

1. Neo4j 실행

본 프로젝트는 도커 컨테이너로 Neo4j를 실행합니다.
docker-compose.yml 을 환경에 맞춰 적절히 수정한 후,
컨테이너를 띄웁니다.

docker-compose up -d

2. 파이썬 가상 환경 세팅

가상 환경을 세팅합니다.
다음은 예시입니다.

uv venv --python 3.10.6
uv pip install -r requirements.txt
source .venv/bin/activate

3. 패키지 기반 지식베이스 구축

원하는 파이썬 라이브러리에 대한 neo4j 데이터베이스를 구축합니다.

python -m graph_builder yourpackagename

명령어를 실행하면 다음과 같은 과정이 이루어집니다.

  1. 로컬에서 라이브러리의 소스코드를 읽어서 정보를 추출함
  2. 추출한 정보를 그래프 데이터베이스에 추가
  3. 추가된 데이터에 대한 임베딩 진행

라이브러리의 크기에 따라 3의 과정에 시간과 비용이 소요됩니다. 3을 실행하다 실패한 경우엔 graph_embedding.py 를 실행해 임베딩만 추가합니다.

구축된 그래프 데이터베이스를 브라우저로 접속해 확인합니다.

// 전체 데이터 확인
match (n)-[r]->(m) return n,r,m 

// 임베딩 결과 확인. 아래 두 결과 값이 같아야함
match (n:Module) where size(n.content) > 0 return count(n);
match (n:Module) where size(n.content) > 0 and n.code_embedding is not null return count(n);

// 임베딩 결과 확인. 아래 두 결과 값이 같아야함
match (n:Module) return count(n);
match (n:Module) where n.meta_embedding is not null return count(n);

4. LLM 질의

지식베이스로 구축한 패키지에 대해 질의합니다.

python -m query_handler

사용자 프롬프트 예시는 다음과 같습니다.

"I want to make conversation with oepn ai model using langchain. how can i do that?"
"Which class do i need to use if i want to do this task ? making chat template with open ai chat model"
"I have a proplem to using this function: Client.request(). Find the reason and solution for me. response = Client.request('https://google.com', 'POST')"

Quick Start

1

Clone the repository

git clone https://github.com/munjimon822/real-code-gpt
2

Install dependencies

cd real-code-gpt
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownermunjimon822
Reporeal-code-gpt
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation