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 - randalmurphal/graphrag: graphrag tools

BranchesTags
Open more actions menu

Latest commit

 

History

52 Commits
52 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.spec
.spec
 
 
cmd
cmd
 
 
docs
docs
 
 
examples/basic
examples/basic
 
 
internal/testutil
internal/testutil
 
 
pkg/graphrag
pkg/graphrag
 
 
scripts
scripts
 
 
sidecar
sidecar
 
 
.gitignore
.gitignore
 
 
CLAUDE.md
CLAUDE.md
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
compose.yaml
compose.yaml
 
 
docker-compose.test.yml
docker-compose.test.yml
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 

Repository files navigation

GraphRAG

Go library for graph-augmented retrieval with pluggable backends.

Features

  • Pluggable storage: Neo4j (graph), Qdrant (vectors), Redis/SQL (cache)
  • Multi-provider embeddings: Voyage AI, OpenAI, local models via sidecar
  • Multi-provider reranking: Voyage AI, Cohere, local models via sidecar
  • Configurable retrieval pipeline: Combine semantic, graph, temporal, and reranking stages
  • Code-based configuration: Functional options, no YAML files
  • Production-ready: Context support, retries with backoff, connection pooling

Installation

go get github.com/randalmurphal/graphrag

Quick Start

package main

import (
    "context"
    "fmt"
    "log"
    "os"
    "time"

    "github.com/randalmurphal/graphrag/pkg/graphrag"
    "github.com/randalmurphal/graphrag/pkg/graphrag/embedding/voyage"
    "github.com/randalmurphal/graphrag/pkg/graphrag/retrieval"
    "github.com/randalmurphal/graphrag/pkg/graphrag/retrieval/stages"
    "github.com/randalmurphal/graphrag/pkg/graphrag/store/neo4j"
    "github.com/randalmurphal/graphrag/pkg/graphrag/store/qdrant"
)

func main() {
    ctx := context.Background()

    // Initialize backends
    graphStore, _ := neo4j.New(
        neo4j.WithURI("bolt://localhost:7687"),
        neo4j.WithAuth("neo4j", "password"),
    )
    defer graphStore.Close()

    vectorStore, _ := qdrant.New(
        qdrant.WithHost("localhost", 6334),
        qdrant.WithCollection("documents"),
    )
    defer vectorStore.Close()

    embedder, err := voyage.New(
        voyage.WithAPIKey(os.Getenv("VOYAGE_API_KEY")),
        voyage.WithModel("voyage-3.5"),
    )
    if err != nil {
        log.Fatal(err)
    }

    // Build retrieval pipeline
    pipeline, err := retrieval.NewPipeline().
        AddStage(stages.Semantic(vectorStore, embedder, 50)).
        AddStage(stages.Hydrate(graphStore)).
        AddStage(stages.GraphExpansion(graphStore, 2)).
        AddStage(stages.TemporalDecay(90 * 24 * time.Hour)).
        Build()
    if err != nil {
        log.Fatal(err)
    }

    // Execute query
    results, err := pipeline.Execute(ctx, "How does authentication work?", 10)
    if err != nil {
        panic(err)
    }

    for _, r := range results {
        fmt.Printf("%.3f: %s\n", r.Score, r.Document.Content[:100])
    }
}

Architecture

GraphRAG is designed as infrastructure, not a product. It provides:

Layer Purpose
Interfaces GraphStore, VectorStore, Embedder, Reranker
Implementations Neo4j, Qdrant, Redis, Voyage, OpenAI, Cohere, Sidecar
Pipeline Composable retrieval stages with scoring
Server Optional HTTP API (cmd/graphrag-server)

Business logic (memory tiers, scope isolation, multi-tenancy) belongs in consumers.

Backends

Storage

Backend Interface Port Use Case
Neo4j GraphStore 7687 Graph relationships, PageRank
Qdrant VectorStore 6334 (gRPC) Vector similarity search
Redis CacheStore 6379 Distributed caching (optional)
SQL CacheStore - Embedded caching with PostgreSQL/SQLite

Embedding Providers

Provider Models Dimensions
Voyage AI voyage-3.5, voyage-3.5-lite, voyage-3-large, voyage-code-3 1024
OpenAI text-embedding-3-small, text-embedding-3-large 1536/3072
Sidecar all-MiniLM-L6-v2, BAAI/bge-large-en-v1.5, etc. varies

Reranking

Provider Models
Voyage AI rerank-2.5, rerank-2
Cohere rerank-english-v3.0, rerank-multilingual-v3.0
Sidecar cross-encoder/ms-marco-MiniLM-L-6-v2, etc.

Pipeline Stages

Build custom pipelines or use presets:

// Custom pipeline
pipeline := retrieval.NewPipeline().
    AddStage(stages.Semantic(vectorStore, embedder, 50)).
    AddStage(stages.Hydrate(graphStore)).
    AddStage(stages.GraphExpansion(graphStore, 2)).
    AddStage(stages.Rerank(reranker, 20)).
    WithScoring(retrieval.WeightedScorer{
        Semantic: 0.4, Graph: 0.3, Rerank: 0.3,
    }).
    Build()

// Or use a preset
pipeline := presets.Standard(graphStore, vectorStore, embedder, reranker)

Development

# Start dev containers
docker compose up -d

# Run tests
go test ./...

# Run with race detector
go test -race ./...

# Integration tests (requires containers)
go test -tags=integration ./...

# Start HTTP server
go run ./cmd/graphrag-server

Documentation

  • CLAUDE.md - AI agent guide
  • docs/ARCHITECTURE.md - System design
  • docs/PIPELINE.md - Retrieval pipeline details
  • docs/BACKENDS.md - Backend configuration
  • docs/TESTING.md - Testing strategy

License

MIT

About

graphrag tools

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

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.