Skip to content

Commit 8a35105

Browse files
committed
feat: Implement DocsContext application for AI-powered document analysis, LLM integration, API, and UI.
1 parent 1e4478f commit 8a35105

30 files changed

Lines changed: 142 additions & 121 deletions

.github/workflows/publish.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,25 @@ jobs:
3939
```bash
4040
git clone https://github.com/{repo}.git
4141
cd {repo.split('/')[-1]}
42-
CGO_ENABLED=0 go build -o docsgraph .
42+
CGO_ENABLED=0 go build -o DocsContext .
4343
```
4444
4545
## Quick start
4646
4747
```bash
4848
# Copy sample config
49-
mkdir -p ~/.docsgraph
49+
mkdir -p ~/.DocsContext
5050
curl -sSL https://raw.githubusercontent.com/{repo}/{tag}/config.example.yaml \\
51-
-o ~/.docsgraph/config.yaml
51+
-o ~/.DocsContext/config.yaml
5252
5353
# Index documents
54-
docsgraph index ./your-docs/
54+
DocsContext index ./your-docs/
5555
5656
# Build knowledge graph (community detection)
57-
docsgraph index --finalize
57+
DocsContext index --finalize
5858
5959
# Start server (Web UI + MCP + REST API)
60-
docsgraph serve --port 8080
60+
DocsContext serve --port 8080
6161
```
6262
6363
| Endpoint | URL |
@@ -75,3 +75,4 @@ jobs:
7575
check=True
7676
)
7777
PYEOF
78+

.gitignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Binaries
2-
docsgraph
3-
docsgraph.exe
4-
docsgraph-linux
5-
docsgraph-*
2+
DocsContext
3+
DocsContext.exe
4+
DocsContext-linux
5+
DocsContext-*
66

77
# Data
88
*.db
@@ -15,3 +15,4 @@ dist/
1515
# OS
1616
.DS_Store
1717
Thumbs.db
18+

README.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DocsGraphContext
1+
# DocsContext
22

33
A pure Go ([CGO_ENABLED=0](https://pkg.go.dev/cmd/cgo)) GraphRAG tool inspired by [Microsoft GraphRAG](https://github.com/microsoft/graphrag).
44
Ingests unstructured documents, builds a hierarchical knowledge graph with community detection, and exposes an **MCP server + embedded Web UI** on a single port.
@@ -16,46 +16,46 @@ Ingests unstructured documents, builds a hierarchical knowledge graph with commu
1616
## Install
1717

1818
```bash
19-
go install github.com/RandomCodeSpace/docsgraphcontext@latest
19+
go install github.com/RandomCodeSpace/docscontext@latest
2020
```
2121

2222
Or build from source:
2323

2424
```bash
25-
git clone https://github.com/RandomCodeSpace/docsgraphcontext.git
26-
cd docsgraphcontext
27-
CGO_ENABLED=0 go build -o docsgraph .
25+
git clone https://github.com/RandomCodeSpace/docscontext.git
26+
cd DocsContext
27+
CGO_ENABLED=0 go build -o docscontext .
2828
```
2929

3030
## Quick Start
3131

3232
```bash
3333
# 1. Create config
34-
mkdir -p ~/.docsgraph
35-
cp config.example.yaml ~/.docsgraph/config.yaml
36-
# Edit ~/.docsgraph/config.yaml — set your LLM provider
34+
mkdir -p ~/.docscontext
35+
cp config.example.yaml ~/.docscontext/config.yaml
36+
# Edit ~/.docscontext/config.yaml — set your LLM provider
3737

3838
# 2. Index documents (Phases 1-2: load, chunk, embed, extract entities)
39-
docsgraph index ./your-docs/ --workers 4
39+
docscontext index ./your-docs/ --workers 4
4040

4141
# 3. Build knowledge graph (Phases 3-4: community detection + summaries)
42-
docsgraph index --finalize
42+
docscontext index --finalize
4343

4444
# 4. Check stats
45-
docsgraph stats
45+
docscontext stats
4646

4747
# 5. Start server
48-
docsgraph serve --port 8080
48+
docscontext serve --port 8080
4949
```
5050

5151
Open **http://localhost:8080** for the Web UI.
5252

5353
## Configuration
5454

55-
Copy `config.example.yaml` to `~/.docsgraph/config.yaml` and edit:
55+
Copy `config.example.yaml` to `~/.docscontext/config.yaml` and edit:
5656

5757
```yaml
58-
data_dir: ~/.docsgraph/data
58+
data_dir: ~/.docscontext/data
5959

6060
llm:
6161
provider: ollama # azure | ollama | huggingface
@@ -82,29 +82,29 @@ server:
8282
port: 8080
8383
```
8484
85-
Environment variable overrides use the `DOCSGRAPH_` prefix:
85+
Environment variable overrides use the `docscontext_` prefix:
8686

8787
```bash
88-
DOCSGRAPH_LLM_PROVIDER=azure
89-
DOCSGRAPH_LLM_AZURE_API_KEY=sk-...
90-
DOCSGRAPH_SERVER_PORT=9090
88+
docscontext_LLM_PROVIDER=azure
89+
docscontext_LLM_AZURE_API_KEY=sk-...
90+
docscontext_SERVER_PORT=9090
9191
```
9292

9393
## CLI
9494

9595
```bash
9696
# Index a file or directory
97-
docsgraph index ./docs/ [--force] [--workers 4] [--verbose]
97+
docscontext index ./docs/ [--force] [--workers 4] [--verbose]
9898
9999
# Run community detection + LLM summaries
100-
docsgraph index --finalize
100+
docscontext index --finalize
101101
102102
# Show statistics
103-
docsgraph stats
104-
docsgraph stats --json
103+
docscontext stats
104+
docscontext stats --json
105105
106106
# Start MCP + Web UI server
107-
docsgraph serve [--port 8080] [--host 127.0.0.1]
107+
docscontext serve [--port 8080] [--host 127.0.0.1]
108108
```
109109

110110
## MCP Tools
@@ -161,7 +161,7 @@ Document In
161161
LLM → JSON summary → SQLite
162162
```
163163
164-
All data lives in a single SQLite file at `$DATA_DIR/docsgraph.db`.
164+
All data lives in a single SQLite file at `$DATA_DIR/docscontext.db`.
165165
166166
## Supported File Types
167167
@@ -177,3 +177,4 @@ All data lives in a single SQLite file at `$DATA_DIR/docsgraph.db`.
177177
## License
178178
179179
MIT
180+

cmd/index.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import (
44
"fmt"
55
"log/slog"
66

7-
"github.com/RandomCodeSpace/docsgraphcontext/internal/llm"
8-
"github.com/RandomCodeSpace/docsgraphcontext/internal/pipeline"
9-
"github.com/RandomCodeSpace/docsgraphcontext/internal/store"
7+
"github.com/RandomCodeSpace/docscontext/internal/llm"
8+
"github.com/RandomCodeSpace/docscontext/internal/pipeline"
9+
"github.com/RandomCodeSpace/docscontext/internal/store"
1010
"github.com/spf13/cobra"
1111
)
1212

@@ -99,3 +99,4 @@ func init() {
9999
indexCmd.Flags().IntVar(&indexMaxDepth, "max-depth", 0, "Maximum BFS link depth (0 = unlimited)")
100100
indexCmd.Flags().BoolVar(&indexSkipSitemap, "skip-sitemap", false, "Force BFS crawl even if sitemap.xml exists")
101101
}
102+

cmd/root.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log/slog"
66
"os"
77

8-
"github.com/RandomCodeSpace/docsgraphcontext/internal/config"
8+
"github.com/RandomCodeSpace/docscontext/internal/config"
99
"github.com/spf13/cobra"
1010
)
1111

@@ -16,9 +16,9 @@ var (
1616
)
1717

1818
var rootCmd = &cobra.Command{
19-
Use: "docsgraph",
20-
Short: "DocsGraphContext — Pure Go GraphRAG MCP server",
21-
Long: `DocsGraphContext ingests unstructured documents, builds a knowledge graph
19+
Use: "DocsContext",
20+
Short: "DocsContext — Pure Go GraphRAG MCP server",
21+
Long: `DocsContext ingests unstructured documents, builds a knowledge graph
2222
with community detection, and exposes an MCP server + embedded Web UI.`,
2323
SilenceUsage: true,
2424
SilenceErrors: true,
@@ -33,7 +33,7 @@ func Execute() {
3333

3434
func init() {
3535
cobra.OnInitialize(initConfig)
36-
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default ~/.docsgraph/config.yaml)")
36+
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default ~/.DocsContext/config.yaml)")
3737
rootCmd.PersistentFlags().StringVar(&logLevel, "log-level", "info", "Log level: debug, info, warn, error")
3838
}
3939

@@ -63,3 +63,6 @@ func initConfig() {
6363
os.Exit(1)
6464
}
6565
}
66+
67+
68+

cmd/serve.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"syscall"
1212
"time"
1313

14-
"github.com/RandomCodeSpace/docsgraphcontext/internal/api"
15-
"github.com/RandomCodeSpace/docsgraphcontext/internal/embedder"
16-
"github.com/RandomCodeSpace/docsgraphcontext/internal/llm"
17-
"github.com/RandomCodeSpace/docsgraphcontext/internal/store"
14+
"github.com/RandomCodeSpace/docscontext/internal/api"
15+
"github.com/RandomCodeSpace/docscontext/internal/embedder"
16+
"github.com/RandomCodeSpace/docscontext/internal/llm"
17+
"github.com/RandomCodeSpace/docscontext/internal/store"
1818
"github.com/spf13/cobra"
1919
)
2020

@@ -92,3 +92,4 @@ func init() {
9292
serveCmd.Flags().StringVar(&serveHost, "host", "", "Server host (overrides config)")
9393
serveCmd.Flags().IntVar(&servePort, "port", 0, "Server port (overrides config)")
9494
}
95+

cmd/stats.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"os"
77
"text/tabwriter"
88

9-
"github.com/RandomCodeSpace/docsgraphcontext/internal/store"
9+
"github.com/RandomCodeSpace/docscontext/internal/store"
1010
"github.com/spf13/cobra"
1111
)
1212

@@ -49,3 +49,4 @@ func init() {
4949
rootCmd.AddCommand(statsCmd)
5050
statsCmd.Flags().BoolVar(&statsJSON, "json", false, "Output as JSON")
5151
}
52+

config.example.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
data_dir: ~/.docsgraph/data # stores docsgraph.db
1+
data_dir: ~/.DocsContext/data # stores DocsContext.db
22

33
llm:
44
provider: ollama # azure | ollama | huggingface
@@ -36,3 +36,4 @@ community:
3636
server:
3737
host: 127.0.0.1
3838
port: 8080
39+

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/RandomCodeSpace/docsgraphcontext
1+
module github.com/RandomCodeSpace/docscontext
22

33
go 1.25.0
44

go.sum

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qq
7070
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
7171
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
7272
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
73-
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
74-
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
73+
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
74+
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
7575
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
7676
github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ=
7777
github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4=
@@ -111,40 +111,27 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE=
111111
go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
112112
go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI=
113113
go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ=
114-
golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
115-
golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
116114
golang.org/x/crypto v0.49.0 h1:+Ng2ULVvLHnJ/ZFEq4KdcDd/cfjrrjjNSXNzxg0Y4U4=
117115
golang.org/x/crypto v0.49.0/go.mod h1:ErX4dUh2UM+CFYiXZRTcMpEcN8b/1gxEuv3nODoYtCA=
118116
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8=
119117
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY=
120118
golang.org/x/image v0.26.0 h1:4XjIFEZWQmCZi6Wv8BoxsDhRU3RVnLX04dToTDAEPlY=
121119
golang.org/x/image v0.26.0/go.mod h1:lcxbMFAovzpnJxzXS3nyL83K27tmqtKzIJpctK8YO5c=
122-
golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8=
123-
golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
124120
golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8=
125-
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
126-
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
121+
golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w=
127122
golang.org/x/net v0.52.0 h1:He/TN1l0e4mmR3QqHMT2Xab3Aj3L9qjbhRm78/6jrW0=
128123
golang.org/x/net v0.52.0/go.mod h1:R1MAz7uMZxVMualyPXb+VaqGSa3LIaUqk0eEt3w36Sw=
129-
golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
130-
golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
131124
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
125+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
132126
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
133-
golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
134-
golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
135127
golang.org/x/sys v0.42.0 h1:omrd2nAlyT5ESRdCLYdm3+fMfNFE/+Rf4bDIQImRJeo=
136128
golang.org/x/sys v0.42.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
137-
golang.org/x/term v0.31.0 h1:erwDkOK1Msy6offm1mOgvspSkslFnIGsFnxOKoufg3o=
138-
golang.org/x/term v0.31.0/go.mod h1:R4BeIy7D95HzImkxGkTW1UQTtP54tio2RyHz7PwK0aw=
139129
golang.org/x/term v0.41.0 h1:QCgPso/Q3RTJx2Th4bDLqML4W6iJiaXFq2/ftQF13YU=
140130
golang.org/x/term v0.41.0/go.mod h1:3pfBgksrReYfZ5lvYM0kSO0LIkAl4Yl2bXOkKP7Ec2A=
141-
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
142-
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
143131
golang.org/x/text v0.35.0 h1:JOVx6vVDFokkpaq1AEptVzLTpDe9KGpj5tR4/X+ybL8=
144132
golang.org/x/text v0.35.0/go.mod h1:khi/HExzZJ2pGnjenulevKNX1W67CUy0AsXcNubPGCA=
145-
golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg=
146-
golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI=
147133
golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k=
134+
golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0=
148135
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
149136
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
150137
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
@@ -181,5 +168,3 @@ modernc.org/strutil v1.2.0 h1:agBi9dp1I+eOnxXeiZawM8F4LawKv4NzGWSaLfyeNZA=
181168
modernc.org/strutil v1.2.0/go.mod h1:/mdcBmfOibveCTBxUl5B5l6W+TTH1FXPLHZE6bTosX0=
182169
modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y=
183170
modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
184-
sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo=
185-
sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8=

0 commit comments

Comments
 (0)