GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - JKLeGend/graphrag-api: api service for self host microsoft graphrag.

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
graphrag
graphrag
 
 
indexing
indexing
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
api.py
api.py
 
 
indexing.py
indexing.py
 
 
query.py
query.py
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

graphrag-api

graphrag-api provides api service for microsoft graphrag.

Overview

This project packages microsoft graphrag into api service, provides indexing api and query api, which is more effective to integrate into other project; Localizes the promotes, which performs better for chinese;

Query

  1. Local Search

    • Utilizes GraphRAG technology for efficient retrieval in local knowledge bases
    • Suitable for quick access to pre-defined structured information
    • Leverages graph structures to improve retrieval accuracy and relevance
  2. Global Search

    • Searches for information in a broader scope, beyond local knowledge bases
    • Suitable for queries requiring more comprehensive information
    • Utilizes GraphRAG's global context understanding capabilities to provide richer search results

Local LLM

Supports various open-source LLMs run through Ollama

  • Config in ./indexing/settings.yaml

Installation

Ensure that you have Python 3.8 or higher installed on your system:

  1. Install the GraphRAG dir from this repo under ./graphrag (0.3.0, with an bug fixed, see latest commit in ./graphrag, you can upgrade it accordingly):

    pip install -e ./graphrag
  2. Install dependencies:

    pip install -r requirements.txt
  3. Launch the API server:

    python api.py --host 0.0.0.0 --port 8012 --reload

Usage

  1. API Endpoints:

    • /v1/index: POST request for performing indexing
    • /v1/index/{resume}: GET request for checking indexing status
    • /v1/chat/completions: POST request for performing searches
    • /v1/models: GET request to retrieve the list of available models
  2. Example:

    • indexing:
    curl http://localhost:8012/v1/index \
     -X POST \
     -d '{
            "resume": "ragtest"
         }' \
     -H "Content-Type: application/json"
    
    curl http://localhost:8012/v1/index/ragtest \
     -X GET
    
    • query:
    curl http://localhost:8012/v1/chat/completions \
     -X POST \
     -d '{
            "resume": "ragtest",
            "model": "graphrag-local-search:latest",
            "messages": [{"role": "user", "content": "who are you?"}],
            "temperature": 0.7   
         }' \
     -H "Content-Type: application/json"
    

Available Models

  • graphrag-local-search:latest: Local search
  • graphrag-global-search:latest: Global search

Notes

  • Ensure that you have origin input files in ./indexing/input directory.
  • Ensure that you have launched and configured llm service api, embeddings service api.

License

Apache-2.0 License

About

api service for self host microsoft graphrag.

Resources

Readme
Apache-2.0 license
Activity

Stars

3 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.