Skip to content

Commit 3899bf9

Browse files
committed
feat: Establish initial project structure for TreeRAG, including MCTS engine, PDF processing, LLM integration, and core application components.
1 parent 0b40eb7 commit 3899bf9

28 files changed

Lines changed: 5058 additions & 0 deletions

.env.example

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Required
2+
OPENAI_API_KEY=sk-your-api-key-here
3+
4+
# Models
5+
INDEXING_MODEL=gpt-4o
6+
SEARCH_MODEL=gpt-4o-mini
7+
ANSWER_MODEL=gpt-4o
8+
9+
# MCTS — Phase 2 (per-document)
10+
MCTS_ITERATIONS=25
11+
UCB_EXPLORATION_CONSTANT=1.414
12+
CONFIDENCE_THRESHOLD=0.7
13+
14+
# MCTS — Phase 1 (document selection)
15+
MCTS_META_ITERATIONS=15
16+
TOP_K_DOCUMENTS=3
17+
18+
# Parallel
19+
PARALLEL_PHASE2=true
20+
21+
# Indexing
22+
BATCH_SIZE=15
23+
MAX_PAGES=5000
24+
25+
# Storage
26+
TREERAG_DATA_DIR=.treerag_data
27+
AUTO_REINDEX=true

.github/workflows/test.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
28+
pip install pytest pytest-cov
29+
30+
- name: Run tests
31+
run: pytest --cov=treerag --cov-report=term-missing -v

.gitignore

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Environment
2+
.env
3+
.env.local
4+
5+
# Data
6+
.treerag_data/
7+
8+
# Python
9+
__pycache__/
10+
*.py[cod]
11+
*$py.class
12+
*.egg-info/
13+
dist/
14+
build/
15+
.eggs/
16+
*.egg
17+
.pytest_cache/
18+
.coverage
19+
htmlcov/
20+
venv/
21+
.venv/
22+
env/
23+
24+
# IDE
25+
.vscode/
26+
.idea/
27+
*.swp
28+
*.swo
29+
*~
30+
31+
# Claude Code
32+
.claude/
33+
34+
# OS
35+
.DS_Store
36+
Thumbs.db
37+
38+
# Logs
39+
*.log
40+
41+
# Firebase
42+
firebase-debug.log
43+
.firebase/

CODE_OF_CONDUCT.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to a positive environment:
15+
16+
* Using welcoming and inclusive language
17+
* Being respectful of differing viewpoints and experiences
18+
* Gracefully accepting constructive criticism
19+
* Focusing on what is best for the community
20+
* Showing empathy towards other community members
21+
22+
Examples of unacceptable behavior:
23+
24+
* Trolling, insulting or derogatory comments, and personal or political attacks
25+
* Public or private harassment
26+
* Publishing others' private information without explicit permission
27+
* Other conduct which could reasonably be considered inappropriate in a
28+
professional setting
29+
30+
## Enforcement
31+
32+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
33+
reported by opening an issue or contacting the project maintainer. All
34+
complaints will be reviewed and investigated and will result in a response that
35+
is deemed necessary and appropriate to the circumstances.
36+
37+
## Attribution
38+
39+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
40+
version 2.0.

CONTRIBUTING.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Contributing to AlphaSearch
2+
3+
Thanks for your interest in contributing! Here's how to get started.
4+
5+
## Development Setup
6+
7+
```bash
8+
git clone https://github.com/CyberGhost007/alphasearch.git
9+
cd alphasearch
10+
python -m venv venv
11+
source venv/bin/activate # Windows: venv\Scripts\activate
12+
pip install -r requirements.txt
13+
cp .env.example .env
14+
# Edit .env with your OpenAI API key
15+
```
16+
17+
## Making Changes
18+
19+
1. Fork the repository
20+
2. Create a feature branch: `git checkout -b feature/your-feature`
21+
3. Make your changes
22+
4. Test your changes locally with `python server.py`
23+
5. Commit with a clear message: `git commit -m "feat: add your feature"`
24+
6. Push to your fork: `git push origin feature/your-feature`
25+
7. Open a Pull Request
26+
27+
## Commit Messages
28+
29+
Use conventional commits:
30+
- `feat:` new feature
31+
- `fix:` bug fix
32+
- `docs:` documentation only
33+
- `refactor:` code change that neither fixes a bug nor adds a feature
34+
- `test:` adding or updating tests
35+
36+
## Code Style
37+
38+
- Follow existing patterns in the codebase
39+
- Use type hints for function signatures
40+
- Add docstrings to public functions and classes
41+
- Keep functions focused and small
42+
43+
## Reporting Issues
44+
45+
- Use GitHub Issues
46+
- Include steps to reproduce
47+
- Include Python version and OS
48+
- Include relevant error messages/logs (redact any API keys)
49+
50+
## Questions?
51+
52+
Open a Discussion or Issue on GitHub.

0 commit comments

Comments
 (0)