File size: 9,368 Bytes
1f2d50a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
---
title: Frequently Asked Questions
description: Common questions and answers about KGraph-MCP project
---

# Frequently Asked Questions

Common questions and detailed answers about the KGraph-MCP project.

## πŸ”§ **General Questions**

### **What is KGraph-MCP?**
KGraph-MCP is a knowledge graph-powered Model Context Protocol implementation that enables intelligent tool management and orchestration. It combines semantic knowledge representation with MCP server capabilities to provide context-aware tool recommendations and execution.

### **What are the system requirements?**
- **Python**: 3.11.8 or higher
- **Node.js**: 16.0 or higher (for certain tooling)
- **Git**: 2.0 or higher
- **Operating System**: Linux, macOS, or Windows (with WSL2)
- **Memory**: 4GB RAM minimum, 8GB recommended
- **Storage**: 2GB free space

### **How do I get started quickly?**
```bash
# Clone and setup in one go
git clone https://github.com/BasalGanglia/kgraph-mcp-hackathon.git
cd kgraph-mcp-hackathon
just setup
just dev
```

## πŸ“¦ **Installation & Setup**

### **Why am I getting Python version errors?**
KGraph-MCP requires Python 3.11.8+. The `just setup` command automatically installs the correct version using `uv`. If you're still having issues:

```bash
# Check your Python version
python --version

# Force reinstall with uv
uv python install 3.11.8
uv venv .venv --python 3.11.8
```

### **What if `just` command is not found?**
Install Just using one of these methods:

```bash
# Using cargo (recommended)
cargo install just

# Using homebrew (macOS)
brew install just

# Using apt (Ubuntu/Debian)
sudo apt install just
```

### **How do I reset my development environment?**
```bash
# Complete reset
just clean-all
just setup

# Partial reset (keep dependencies)
just clean
just install
```

## πŸ”¨ **Development**

### **What's the recommended development workflow?**
1. **Start a task**: `just task-start <id>`
2. **Create feature branch**: `just branch-create <id> <name>`
3. **Develop with live reload**: `just dev`
4. **Run quality checks**: `just check`
5. **Submit changes**: Standard git workflow

### **How do I run tests?**
```bash
# All tests
just test

# With coverage
just test-cov

# Fast tests only
just test-fast

# Specific test file
just test-file tests/test_specific.py
```

### **What linting and formatting tools are used?**
- **Linting**: Ruff (replaces flake8, isort, and more)
- **Formatting**: Black with line length 88
- **Type Checking**: MyPy
- **Security**: Bandit and Safety

```bash
# Run all quality checks
just check

# Individual tools
just lint        # Ruff with auto-fix
just format      # Black formatting
just type-check  # MyPy type checking
just security    # Security scans
```

## 🌐 **Application & API**

### **What ports does the application use?**
- **FastAPI + Gradio**: Port 7860 (default)
- **FastAPI only**: Port 8000 (with `just run-api`)
- **Documentation**: Port 8001 (with `just docs-serve`)

### **How do I access the different interfaces?**
```bash
# Start full application (FastAPI + Gradio)
just run-app
# Access at: http://localhost:7860

# Start development mode with auto-reload
just dev
# Access at: http://localhost:7860

# Start API server only
just run-api  
# Access at: http://localhost:8000/docs
```

### **Can I change the default ports?**
Yes, set environment variables:
```bash
export GRADIO_PORT=7861
export API_PORT=8001
just dev
```

## πŸ“Š **Knowledge Graph & Data**

### **What knowledge graph technologies are used?**
- **In-Memory Store**: Custom Python implementation
- **Query Language**: SPARQL-like interface
- **Embeddings**: Hugging Face Transformers
- **Schema**: JSON Schema with RDF-like semantics

### **How is tool metadata stored?**
Tool metadata is stored in a knowledge graph structure with:
- **Nodes**: Tools, parameters, categories
- **Edges**: Relationships, dependencies, compatibility
- **Properties**: Metadata, descriptions, constraints

### **Can I add custom tools?**
Yes! Tools are defined in JSON schema format:

```json
{
  "name": "my_custom_tool",
  "description": "Custom tool description",
  "parameters": {...},
  "category": "utility",
  "tags": ["custom", "utility"]
}
```

Add to the appropriate schema file and restart the application.

## πŸ€– **MCP Integration**

### **What is the Model Context Protocol (MCP)?**
MCP is an open protocol that enables AI models to securely access external tools and data sources. KGraph-MCP implements MCP to provide structured tool access with semantic understanding.

### **How do I connect to MCP clients?**
KGraph-MCP runs as an MCP server. Connect from MCP-compatible clients:

```bash
# Server endpoint
ws://localhost:7860/mcp

# Or use the HTTP API
http://localhost:7860/api/v1/mcp
```

### **What MCP features are supported?**
- βœ… Tool discovery and execution
- βœ… Resource access (files, data)
- βœ… Structured prompts
- βœ… Logging and observability
- πŸ”„ Streaming (in development)
- πŸ”„ Authentication (in development)

## πŸ“š **Documentation**

### **How do I build the documentation locally?**
```bash
# Build documentation
just docs

# Serve locally with live reload
just docs-serve
# Access at: http://localhost:8001

# Watch for changes during development
just docs-watch
```

### **How do I deploy documentation to GitHub Pages?**
```bash
# Deploy to GitHub Pages
just docs-deploy

# Or let GitHub Actions handle it
git push origin main  # Triggers automatic deployment
```

### **Where can I find API documentation?**
- **Online**: [API Reference](../api/index.md)
- **Local**: `just docs-serve` then visit `/api/`
- **Interactive**: `just run-api` then visit `/docs`

## πŸ”§ **Task Management**

### **How does the task management system work?**
KGraph-MCP includes a comprehensive task management system:

- **Local Database**: SQLite-based task storage
- **GitHub Integration**: Sync with GitHub Issues and Projects
- **Just Commands**: CLI interface for task operations

### **How do I create and manage tasks?**
```bash
# List all tasks
just tasks

# Create new task
just task-create "Task title" "Description"

# Start working on a task
just task-start <id>

# Complete a task
just task-done <id>

# View GitHub project status
just tasks-github
```

### **Can I sync tasks with GitHub?**
Yes! The system provides bidirectional sync:

```bash
# Sync completed tasks to GitHub
just gh-sync-completed

# Create structured GitHub issues
just gh-create-structured-task <id>

# Full GitHub integration
just gh-sync-all
```

## πŸ› **Troubleshooting**

### **The application won't start. What should I check?**
1. **Python environment**: `source .venv/bin/activate`
2. **Dependencies**: `just install`
3. **Ports**: Check if ports 7860/8000 are available
4. **Environment variables**: Create `.env` from `.env.example`
5. **Logs**: Check console output for specific errors

### **Tests are failing. How do I debug?**
```bash
# Run tests with verbose output
just test -v

# Run specific failing test
just test-file tests/test_failing.py -v -s

# Check test coverage
just test-cov
```

### **Where can I get help?**
1. **Documentation**: [Troubleshooting Guide](troubleshooting.md)
2. **GitHub Issues**: [Report problems](https://github.com/BasalGanglia/kgraph-mcp-hackathon/issues)
3. **Developer Guide**: [Development setup](../developer-guide/index.md)

## πŸ“ˆ **Performance & Scaling**

### **How do I monitor performance?**
```bash
# System statistics
just stats

# Memory profiling
just profile-memory

# Process monitoring
just monitor
```

### **What are the performance characteristics?**
- **Startup Time**: ~2-5 seconds
- **Memory Usage**: ~100-200MB base
- **Request Latency**: <100ms for simple operations
- **Concurrent Users**: 10-50 (depending on operations)

### **How can I improve performance?**
- Use SSD storage for better I/O
- Increase available RAM
- Enable response caching
- Use production ASGI server (Gunicorn + Uvicorn)

## πŸ”— **Integration & Deployment**

### **Can I deploy to production?**
Yes! See the [Deployment Guide](../user-guide/deployment.md) for:
- Docker deployment
- Cloud platform setup
- Environment configuration
- Security considerations

### **What about CI/CD?**
GitHub Actions workflows are included for:
- **Testing**: Automated test runs
- **Quality**: Linting and type checking  
- **Documentation**: Automatic deployment to GitHub Pages
- **Releases**: Automated versioning and releases

### **How do I integrate with other systems?**
KGraph-MCP provides multiple integration points:
- **REST API**: HTTP endpoints for all functionality
- **WebSocket**: Real-time communication
- **MCP Protocol**: Standard protocol for AI model integration
- **CLI Tools**: Command-line automation

---

## πŸ’‘ **Can't find your question?**

- Check the [Troubleshooting Guide](troubleshooting.md) for technical issues
- Browse the [User Guide](../user-guide/index.md) for usage instructions  
- Review the [Developer Guide](../developer-guide/index.md) for development topics
- Search [GitHub Issues](https://github.com/BasalGanglia/kgraph-mcp-hackathon/issues) for similar questions
- [Create a new issue](https://github.com/BasalGanglia/kgraph-mcp-hackathon/issues/new) if you need help

---

*Last updated: Documentation generated from KGraph-MCP project*

---

*This page is part of the [Resources](index.md) documentation section.*