Skip to content

Commit 4a169d3

Browse files
authored
Merge pull request #64 from data-exp-lab/fix-rag
Fix Embeddings
2 parents 3efa203 + 9dab07a commit 4a169d3

File tree

12 files changed

+858
-387
lines changed

12 files changed

+858
-387
lines changed

backend/app/config.example.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
"token": "ghp_your-github-personal-access-token-here",
2525
"rate_limit_per_hour": 5000
2626
},
27-
"graphrag": {
27+
"deepgit_ai": {
2828
"timeout_minutes": 50,
2929
"batch_size": 50,
3030
"cache_hours": 24,
31-
"max_repos_per_request": 1000
31+
"max_repos_per_request": 1000,
32+
"strict_database_only": true,
33+
"include_database_context": true
3234
},
3335
"server": {
3436
"host": "127.0.0.1",

backend/app/config_manager.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ def _get_default_config(self) -> Dict[str, Any]:
6262
"token": "",
6363
"rate_limit_per_hour": 5000
6464
},
65-
"graphrag": {
65+
"deepgit_ai": {
6666
"timeout_minutes": 50,
6767
"batch_size": 50,
6868
"cache_hours": 24,
69-
"max_repos_per_request": 1000
69+
"max_repos_per_request": 1000,
70+
"strict_database_only": True,
71+
"include_database_context": True
7072
},
7173
"server": {
7274
"host": "127.0.0.1",
@@ -143,9 +145,9 @@ def get_github_token(self) -> str:
143145
"""Get GitHub token from configuration."""
144146
return self.get("github.token", "")
145147

146-
def get_graphrag_config(self) -> Dict[str, Any]:
147-
"""Get GraphRAG configuration."""
148-
return self.get("graphrag", {})
148+
def get_deepgit_ai_config(self) -> Dict[str, Any]:
149+
"""Get DeepGitAI configuration."""
150+
return self.get("deepgit_ai", {})
149151

150152
def get_server_config(self) -> Dict[str, Any]:
151153
"""Get server configuration."""

backend/app/main.py

Lines changed: 138 additions & 115 deletions
Large diffs are not rendered by default.

backend/app/services/graphrag_service.py renamed to backend/app/services/deepgit_ai_service.py

Lines changed: 474 additions & 95 deletions
Large diffs are not rendered by default.

backend/requirements.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ langchain-openai>=0.1.0
2020
langchain-community>=0.2.0
2121
langchain-google-genai>=0.1.0
2222
python-dotenv>=1.0.0
23-
matplotlib>=3.7.0
23+
matplotlib>=3.7.0
24+
sentence-transformers>=2.2.0
25+
torch>=1.9.0

environment.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,6 @@ dependencies:
2929
- langchain-community>=0.2.0
3030
- langchain-google-genai>=0.1.0
3131
- python-dotenv>=1.0.0
32-
- matplotlib>=3.7.0
32+
- matplotlib>=3.7.0
33+
- sentence-transformers>=2.2.0
34+
- torch>=1.9.0

src/lib/config.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ export const API_ENDPOINTS = {
1616
GENERATE_GRAPH_WITH_EDGES: `${API_BASE_URL}/api/generate-graph-with-edges`,
1717
GET_UNIQUE_REPOS: `${API_BASE_URL}/api/get-unique-repos`,
1818
CREATE_EDGES_ON_GRAPH: `${API_BASE_URL}/api/create-edges-on-graph`,
19-
// GraphRAG endpoints
20-
GRAPHRAG_HEALTH: `${API_BASE_URL}/api/graphrag-health`,
21-
GRAPHRAG_SETUP: `${API_BASE_URL}/api/graphrag-setup`,
22-
GRAPHRAG_PROGRESS: `${API_BASE_URL}/api/graphrag-progress`,
23-
GRAPHRAG_RESET_PROGRESS: `${API_BASE_URL}/api/graphrag-reset-progress`,
24-
GRAPHRAG_CHANGE_PROVIDER: `${API_BASE_URL}/api/graphrag-change-provider`,
25-
GRAPHRAG_UPDATE_README: `${API_BASE_URL}/api/graphrag-update-readme`,
26-
GRAPHRAG_FIX_SCHEMA: `${API_BASE_URL}/api/graphrag-fix-schema`,
27-
GRAPHRAG_QUERY: `${API_BASE_URL}/api/graphrag`,
28-
GRAPHRAG_CLEANUP: `${API_BASE_URL}/api/graphrag-cleanup`,
29-
GRAPHRAG_CHECK_CHANGES: `${API_BASE_URL}/api/graphrag-check-changes`,
19+
// DeepGitAI endpoints
20+
DEEPGIT_AI_HEALTH: `${API_BASE_URL}/api/deepgit-ai-health`,
21+
DEEPGIT_AI_SCOPE: `${API_BASE_URL}/api/deepgit-ai-scope`,
22+
DEEPGIT_AI_SETUP: `${API_BASE_URL}/api/deepgit-ai-setup`,
23+
DEEPGIT_AI_PROGRESS: `${API_BASE_URL}/api/deepgit-ai-progress`,
24+
DEEPGIT_AI_RESET_PROGRESS: `${API_BASE_URL}/api/deepgit-ai-reset-progress`,
25+
DEEPGIT_AI_CHANGE_PROVIDER: `${API_BASE_URL}/api/deepgit-ai-change-provider`,
26+
DEEPGIT_AI_UPDATE_README: `${API_BASE_URL}/api/deepgit-ai-update-readme`,
27+
DEEPGIT_AI_FIX_SCHEMA: `${API_BASE_URL}/api/deepgit-ai-fix-schema`,
28+
DEEPGIT_AI_QUERY: `${API_BASE_URL}/api/deepgit-ai`,
29+
DEEPGIT_AI_CLEANUP: `${API_BASE_URL}/api/deepgit-ai-cleanup`,
30+
DEEPGIT_AI_CHECK_CHANGES: `${API_BASE_URL}/api/deepgit-ai-check-changes`,
3031
} as const;

src/styles/_graph.scss

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,17 @@
102102
background: white;
103103
}
104104

105-
// GraphRAG Chat Interface Styles
106-
.graphrag-chat {
105+
// DeepGitAI Chat Interface Styles
106+
.deepgit-ai-chat {
107107
min-height: 100%;
108+
height: 100%; // Ensure full height
108109
display: flex;
109110
flex-direction: column;
110-
overflow-y: auto; // Make the entire GraphRAG panel scrollable
111+
position: relative; // Create positioning context
112+
113+
// Custom scrollbar for the entire chat container
111114
scrollbar-width: thin;
112115
scrollbar-color: #ccc transparent;
113-
-webkit-overflow-scrolling: touch; // For better iOS scrolling
114116

115117
&::-webkit-scrollbar {
116118
width: 6px;
@@ -125,11 +127,17 @@
125127
border-radius: 3px;
126128
}
127129

130+
// Setup panel (not sticky, scrolls with content)
131+
.setup-panel {
132+
background: #f8f9fa;
133+
border-bottom: 1px solid #e9ecef;
134+
flex-shrink: 0; // Prevent setup panel from shrinking
135+
}
136+
128137
.chat-messages {
129-
flex: 1;
130-
overflow-y: visible; // Remove individual scrolling from chat messages
131-
overflow-x: hidden;
132-
min-height: 200px;
138+
flex: 1 1 auto;
139+
min-height: 0; // critical for Chrome flexbox
140+
overflow: visible; // let the panel-content be the scroll container
133141
max-height: none; // Remove max-height constraint
134142
}
135143

@@ -159,28 +167,6 @@
159167
}
160168
}
161169

162-
.chat-input {
163-
border-top: 1px solid #e9ecef;
164-
background: white;
165-
166-
.input-group {
167-
.form-control {
168-
border-radius: 20px 0 0 20px;
169-
border: 1px solid #ced4da;
170-
171-
&:focus {
172-
border-color: #007bff;
173-
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
174-
}
175-
}
176-
177-
.btn {
178-
border-radius: 0 20px 20px 0;
179-
border: 1px solid #007bff;
180-
}
181-
}
182-
}
183-
184170
.setup-panel {
185171
background: #f8f9fa;
186172
border-bottom: 1px solid #e9ecef;

src/styles/_layout.scss

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,89 @@ body {
7070
flex-direction: column;
7171

7272
@extend .custom-scrollbar;
73-
overflow-y: auto;
73+
overflow-y: auto; // single scroll ancestor for sticky
7474

7575
&>*>*:not(hr) {
7676
padding: 1rem;
7777
}
7878

79-
// Special handling for GraphRAG panel
80-
.graphrag-chat {
79+
// Special handling for DeepGitAI panel
80+
.deepgit-ai-chat {
8181
padding: 0;
82+
height: 100%;
83+
display: flex;
84+
flex-direction: column;
85+
}
86+
87+
// When DeepGitAI tab is active, keep header/input sticky relative to panel scroll
88+
&.deepgit-ai-mode {
89+
position: relative;
90+
91+
.deepgit-ai-header {
92+
position: sticky; // sticks to panel-content
93+
top: 0;
94+
z-index: 1000;
95+
background: white;
96+
border-bottom: 1px solid #e9ecef;
97+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
98+
backdrop-filter: blur(10px);
99+
}
100+
101+
.chat-input {
102+
position: sticky; // sticks to panel-content
103+
bottom: 0;
104+
z-index: 999;
105+
background: white;
106+
border-top: 1px solid #e9ecef;
107+
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
108+
backdrop-filter: blur(10px);
109+
}
110+
111+
.chat-messages {
112+
flex: 1 1 auto;
113+
min-height: 0; // allows shrinking so header/input remain visible
114+
overflow: visible; // do not create nested scroll
115+
}
116+
}
117+
118+
// Make DeepGitAI header sticky relative to panel content
119+
.deepgit-ai-header {
120+
position: sticky;
121+
top: 0;
122+
z-index: 1000;
123+
background: white;
124+
border-bottom: 1px solid #e9ecef;
125+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
126+
backdrop-filter: blur(10px);
127+
}
128+
129+
// Make DeepGitAI chat input sticky relative to panel content
130+
.chat-input {
131+
position: sticky;
132+
bottom: 0;
133+
z-index: 999;
134+
background: white;
135+
border-top: 1px solid #e9ecef;
136+
box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
137+
backdrop-filter: blur(10px);
138+
flex-shrink: 0; // Prevent input from shrinking
139+
140+
.input-group {
141+
.form-control {
142+
border-radius: 20px 0 0 20px;
143+
border: 1px solid #ced4da;
144+
145+
&:focus {
146+
border-color: #007bff;
147+
box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
148+
}
149+
}
150+
151+
.btn {
152+
border-radius: 0 20px 20px 0;
153+
border: 1px solid #007bff;
154+
}
155+
}
82156
}
83157
}
84158
}

src/views/ContextPanel.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import GraphSumUp from "./GraphSumUp";
1414
import NodesAppearanceBlock from "./NodesAppearanceBlock";
1515
import Settings from "./Settings";
1616
import SelectedNodePanel from "./SelectedNodePanel";
17-
import GraphRAGPanel from "./GraphRAGPanel";
17+
import DeepGitAIPanel from "./GraphRAGPanel";
1818

1919
const ContextPanel: FC = () => {
2020
const { navState, data, panel, setPanel } = useContext(GraphContext);
@@ -35,8 +35,8 @@ const ContextPanel: FC = () => {
3535
let content: JSX.Element;
3636
if (panel === "settings") {
3737
content = <Settings />;
38-
} else if (panel === "graphrag") {
39-
content = <GraphRAGPanel />;
38+
} else if (panel === "deepgit-ai") {
39+
content = <DeepGitAIPanel />;
4040
} else if (selectedNode) {
4141
content = <SelectedNodePanel node={navState?.selectedNode as string} data={selectedNode} />;
4242
} else {
@@ -71,11 +71,11 @@ const ContextPanel: FC = () => {
7171
<VscSettings /> Settings
7272
</button>
7373
<button
74-
className={cx("btn ms-2 mt-1", panel === "graphrag" ? selectedButtonClass : "btn-outline-dark")}
75-
onClick={() => setPanel("graphrag")}
76-
disabled={panel === "graphrag"}
74+
className={cx("btn ms-2 mt-1", panel === "deepgit-ai" ? selectedButtonClass : "btn-outline-dark")}
75+
onClick={() => setPanel("deepgit-ai")}
76+
disabled={panel === "deepgit-ai"}
7777
>
78-
<AiOutlineRobot /> GraphRAG
78+
<AiOutlineRobot /> DeepGitAI
7979
</button>
8080
{/* <button
8181
className={cx("btn ms-2 mt-1", "btn-outline-dark")}
@@ -123,7 +123,7 @@ const ContextPanel: FC = () => {
123123
</div>
124124
</div>
125125

126-
<div className="panel-content">
126+
<div className={cx("panel-content", panel === "deepgit-ai" && "deepgit-ai-mode")}>
127127
<div className="flex-grow-1 p-0 m-0">{content}</div>
128128

129129
<hr className="m-0 flex-shrink-0" />

0 commit comments

Comments
 (0)