Skip to content

Commit b543580

Browse files
author
hah23255
committed
Initial commit: AEC RAG System with GraphRAG
- Add comprehensive project structure following FSH 3.0 and ISO 8000 standards - Implement FastAPI REST API for document management - Add GraphRAG integration with nano-graphrag - Include CAD (DWG/DXF) and PDF parsing capabilities - Set up Docker Compose orchestration with Ollama - Add complete documentation (README, INDEX, PROJECT_JOURNAL, CONTRIBUTING) - Configure code quality tools (black, ruff, mypy) - Format and lint all Python files - Add MIT License and Code of Conduct
1 parent f2b3feb commit b543580

File tree

14 files changed

+508
-108
lines changed

14 files changed

+508
-108
lines changed

.gitignore

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
share/python-wheels/
20+
*.egg-info/
21+
.installed.cfg
22+
*.egg
23+
MANIFEST
24+
pip-log.txt
25+
pip-delete-this-directory.txt
26+
27+
# Virtual Environment
28+
venv/
29+
ENV/
30+
env/
31+
.venv
32+
.env
33+
34+
# IDEs
35+
.vscode/
36+
.idea/
37+
*.swp
38+
*.swo
39+
*~
40+
.DS_Store
41+
42+
# Testing
43+
.tox/
44+
.nox/
45+
.coverage
46+
.coverage.*
47+
.cache
48+
nosetests.xml
49+
coverage.xml
50+
*.cover
51+
*.log
52+
.pytest_cache/
53+
htmlcov/
54+
55+
# Type checking
56+
.mypy_cache/
57+
.dmypy.json
58+
dmypy.json
59+
.pytype/
60+
61+
# Jupyter Notebook
62+
.ipynb_checkpoints
63+
*.ipynb
64+
65+
# Environment variables
66+
.env
67+
.env.local
68+
.env.*.local
69+
70+
# Docker
71+
*.log
72+
73+
# Data & Models
74+
data/
75+
*.db
76+
*.sqlite
77+
*.sqlite3
78+
chromadb/
79+
chroma_db/
80+
graphrag/
81+
models/
82+
*.bin
83+
*.safetensors
84+
*.gguf
85+
86+
# Logs
87+
logs/
88+
*.log
89+
90+
# OS
91+
.DS_Store
92+
Thumbs.db
93+
94+
# Ollama models (too large)
95+
.ollama/
96+
97+
# Temporary files
98+
tmp/
99+
temp/
100+
*.tmp
101+
*.bak
102+
*.swp
103+
104+
# IDE specific
105+
.vscode/settings.json
106+
.vscode/launch.json
107+
!.vscode/extensions.json
108+
!.vscode/tasks.json

CODE_OF_CONDUCT.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes
17+
* Focusing on what is best for the overall community
18+
19+
Examples of unacceptable behavior:
20+
21+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
* Trolling, insulting or derogatory comments, and personal or political attacks
23+
* Public or private harassment
24+
* Publishing others' private information without explicit permission
25+
* Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
## Scope
32+
33+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the project team. All complaints will be reviewed and investigated promptly and fairly.
38+
39+
## Attribution
40+
41+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.0.

CONTRIBUTING.md

Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
# Contributing to AEC RAG System
2+
3+
Thank you for your interest in contributing to the AEC RAG System! This document provides guidelines and instructions for contributing.
4+
5+
## Code of Conduct
6+
7+
Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).
8+
9+
## How to Contribute
10+
11+
### Reporting Bugs
12+
13+
1. Check if the bug has already been reported in [Issues](https://github.com/hah23255/aec-rag-system/issues)
14+
2. If not, create a new issue with:
15+
- Clear title and description
16+
- Steps to reproduce
17+
- Expected vs actual behavior
18+
- Environment details (OS, Python version, etc.)
19+
- Code samples or error messages
20+
21+
### Suggesting Features
22+
23+
1. Check existing feature requests
24+
2. Create a new issue with:
25+
- Clear use case description
26+
- Proposed solution
27+
- Alternative approaches considered
28+
- Impact on existing functionality
29+
30+
### Pull Requests
31+
32+
1. **Fork and Clone**
33+
```bash
34+
git clone https://github.com/hah23255/aec-rag-system.git
35+
cd aec-rag-system
36+
```
37+
38+
2. **Create a Branch**
39+
```bash
40+
git checkout -b feature/your-feature-name
41+
# or
42+
git checkout -b fix/your-bug-fix
43+
```
44+
45+
3. **Setup Development Environment**
46+
```bash
47+
python -m venv venv
48+
source venv/bin/activate
49+
pip install -r requirements.txt
50+
pip install -r requirements-dev.txt # if exists
51+
pre-commit install
52+
```
53+
54+
4. **Make Changes**
55+
- Follow coding standards (see below)
56+
- Add tests for new features
57+
- Update documentation as needed
58+
59+
5. **Test Your Changes**
60+
```bash
61+
pytest tests/ -v --cov
62+
black src/ tests/
63+
ruff check src/ tests/
64+
mypy src/
65+
```
66+
67+
6. **Commit**
68+
- Use conventional commits format:
69+
```
70+
feat: add CAD layer extraction
71+
fix: resolve PDF parsing memory leak
72+
docs: update API documentation
73+
test: add GraphRAG integration tests
74+
```
75+
76+
7. **Push and Create PR**
77+
```bash
78+
git push origin feature/your-feature-name
79+
```
80+
- Open PR on GitHub
81+
- Fill out the PR template
82+
- Link related issues
83+
84+
## Development Standards
85+
86+
### Code Style
87+
88+
- **Python Version:** 3.9+
89+
- **Formatter:** Black (100 character line length)
90+
- **Linter:** Ruff
91+
- **Type Hints:** Required for all functions
92+
- **Docstrings:** Google style for all public functions/classes
93+
94+
Example:
95+
```python
96+
def process_document(file_path: str, max_pages: int = 100) -> dict[str, Any]:
97+
"""Process a document and extract structured data.
98+
99+
Args:
100+
file_path: Path to the document file
101+
max_pages: Maximum number of pages to process
102+
103+
Returns:
104+
Dictionary containing extracted data and metadata
105+
106+
Raises:
107+
FileNotFoundError: If file_path does not exist
108+
ValueError: If file format is not supported
109+
"""
110+
pass
111+
```
112+
113+
### Testing
114+
115+
- **Framework:** pytest
116+
- **Coverage:** Maintain >80% coverage
117+
- **Types:**
118+
- Unit tests: `tests/unit/`
119+
- Integration tests: `tests/integration/`
120+
- Fixtures: `tests/fixtures/`
121+
122+
### File Naming
123+
124+
- **Python files:** `lowercase_with_underscores.py`
125+
- **Test files:** `test_module_name.py`
126+
- **Config files:** `kebab-case.yaml`
127+
128+
### Directory Structure (FSH 3.0)
129+
130+
- `src/` - Source code
131+
- `tests/` - Test suite
132+
- `docs/` - Documentation
133+
- `config/` - Configuration files
134+
- `scripts/` - Utility scripts
135+
- `deployment/` - Deployment configs
136+
137+
## Review Process
138+
139+
1. **Automated Checks**
140+
- All CI/CD tests must pass
141+
- Code coverage must not decrease
142+
- Linting must pass
143+
144+
2. **Code Review**
145+
- At least one maintainer approval required
146+
- Address all review comments
147+
- Keep PR scope focused
148+
149+
3. **Merge**
150+
- Squash and merge for feature branches
151+
- Rebase for hotfixes
152+
153+
## Development Workflow
154+
155+
### Local Development
156+
157+
```bash
158+
# Start services
159+
docker-compose up -d
160+
161+
# Run API in development mode
162+
uvicorn src.api.main:app --reload
163+
164+
# Run tests
165+
pytest tests/ -v
166+
167+
# Format code
168+
black src/ tests/
169+
170+
# Lint
171+
ruff check src/ tests/
172+
173+
# Type check
174+
mypy src/
175+
```
176+
177+
### Pre-commit Hooks
178+
179+
The project uses pre-commit hooks to ensure code quality:
180+
181+
```bash
182+
# Install hooks
183+
pre-commit install
184+
185+
# Run manually
186+
pre-commit run --all-files
187+
```
188+
189+
## Questions?
190+
191+
- Open a [Discussion](https://github.com/hah23255/aec-rag-system/discussions)
192+
- Join our community chat (if available)
193+
- Email: your.email@example.com
194+
195+
## License
196+
197+
By contributing, you agree that your contributions will be licensed under the MIT License.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 AEC RAG System Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)