-
Notifications
You must be signed in to change notification settings - Fork 10
docs: add contributor onboarding guide #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Ankit-Kotnala
wants to merge
1
commit into
XortexAI:main
Choose a base branch
from
Ankit-Kotnala:docs/add-contributing-guide
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| # Contributing to XMem | ||
|
|
||
| Thanks for helping improve XMem. This guide explains how to set up the project, | ||
| make changes safely, and open a pull request that maintainers can review quickly. | ||
|
|
||
| ## Before You Start | ||
|
|
||
| - Check the issue list and comment on the issue you want to work on. | ||
| - For larger changes, share your approach before opening a PR. | ||
| - Keep each PR focused on one bug, feature, or documentation task. | ||
| - Do not commit secrets, local `.env` files, generated caches, or API keys. | ||
|
|
||
| ## Project Areas | ||
|
|
||
| This repository contains the Python backend, agents, storage integrations, API | ||
| routes, scanner, and tests. | ||
|
|
||
| Common areas: | ||
|
|
||
| - `src/agents/` - classifier, memory extraction, judge, and domain agents. | ||
| - `src/pipelines/` - ingestion, retrieval, and weaver workflows. | ||
| - `src/api/` - FastAPI application, routes, dependencies, and middleware. | ||
| - `src/storage/` - vector store interface and Pinecone implementation. | ||
| - `src/graph/` - Neo4j clients and graph schemas. | ||
| - `src/scanner/` and `src/scanner_v1/` - repository indexing and AST parsing. | ||
| - `src/schemas/` - Pydantic models used across agents and APIs. | ||
| - `tests/` - unit and integration tests. | ||
| - `docs/` - user and developer documentation. | ||
|
|
||
| Related ecosystem pieces such as SDKs, MCP integrations, extensions, and landing | ||
| pages may live in separate repositories. Follow the README in that component | ||
| when working outside this backend repo. | ||
|
|
||
| ## Development Setup | ||
|
|
||
| Requirements: | ||
|
|
||
| - Python 3.11 or newer. | ||
| - Access to any external services needed by the area you are testing, such as | ||
| Pinecone, Neo4j, MongoDB, or an LLM provider. | ||
|
|
||
| Create and activate a virtual environment: | ||
|
|
||
| ```powershell | ||
| python -m venv .venv | ||
| .venv\Scripts\activate | ||
| ``` | ||
|
|
||
| On macOS or Linux, use: | ||
|
|
||
| ```bash | ||
| python -m venv .venv | ||
| source .venv/bin/activate | ||
| ``` | ||
|
|
||
| Install the project with development dependencies: | ||
|
|
||
| ```bash | ||
| pip install -e ".[dev]" | ||
| ``` | ||
|
|
||
| Create a local environment file: | ||
|
|
||
| ```powershell | ||
| copy .env.example .env | ||
| ``` | ||
|
|
||
| On macOS or Linux, use: | ||
|
|
||
| ```bash | ||
| cp .env.example .env | ||
| ``` | ||
|
|
||
| Fill in only the keys needed for your work. For unit tests that do not call real | ||
| services, dummy values are often enough. | ||
|
|
||
| ## Running Locally | ||
|
|
||
| Start the API server: | ||
|
|
||
| ```bash | ||
| uvicorn src.api.app:create_app --factory --host 0.0.0.0 --port 8000 | ||
| ``` | ||
|
|
||
| If you need the full local stack, use the Docker Compose files in `docker/`. | ||
|
|
||
| ## Testing | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lets leave this for now as we dont have a proper test suite |
||
|
|
||
| Run the test suite: | ||
|
|
||
| ```bash | ||
| pytest | ||
| ``` | ||
|
|
||
| Run a specific test file: | ||
|
|
||
| ```bash | ||
| pytest tests/test_deterministic_memory_layer.py | ||
| ``` | ||
|
|
||
| The project config enables coverage by default. If your local environment does | ||
| not have `pytest-cov`, install the dev dependencies again: | ||
|
|
||
| ```bash | ||
| pip install -e ".[dev]" | ||
| ``` | ||
|
|
||
| ## Linting and Formatting | ||
|
|
||
| Run Ruff before opening a PR: | ||
|
|
||
| ```bash | ||
| ruff check src tests | ||
| ``` | ||
|
|
||
| Use the existing project style: | ||
|
|
||
| - Prefer small, focused functions. | ||
| - Keep domain schemas in `src/schemas/`. | ||
| - Keep prompt text in `src/prompts/`. | ||
| - Keep storage writes inside the Weaver or store clients. | ||
| - Avoid broad refactors in bug-fix PRs. | ||
|
|
||
| ## Coding Standards | ||
|
|
||
| - Use Pydantic models for structured data crossing agent, API, or pipeline | ||
| boundaries. | ||
| - Keep agent outputs explicit and validated where possible. | ||
| - Make Judge logic deterministic when the domain has stable identity keys. | ||
| - Keep external service calls behind small wrappers so tests can use fakes. | ||
| - Add tests for new behavior, regressions, and failure paths. | ||
| - Preserve backward compatibility for existing stored records and API responses. | ||
|
|
||
| ## Documentation Standards | ||
|
|
||
| - Keep setup instructions copy-pasteable. | ||
| - Prefer short examples over long explanations. | ||
| - Update docs when changing public behavior, configuration, or setup steps. | ||
| - Do not include real credentials, private URLs, or personal tokens in docs. | ||
|
|
||
| ## Pull Request Checklist | ||
|
|
||
| Before submitting: | ||
|
|
||
| - Rebase or sync with the latest main branch. | ||
| - Keep the PR scoped to the issue. | ||
| - Add or update tests when behavior changes. | ||
| - Run relevant tests and lint checks locally. | ||
| - Update docs if setup, API behavior, or configuration changes. | ||
| - Describe what changed, why it changed, and how you verified it. | ||
|
|
||
| Suggested PR description: | ||
|
|
||
| ```md | ||
| ## Summary | ||
| - ... | ||
|
|
||
| ## Testing | ||
| - ... | ||
|
|
||
| ## Notes | ||
| - ... | ||
| ``` | ||
|
|
||
| ## Review Process | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can remove this section for now |
||
|
|
||
| Maintainers may ask for changes to scope, tests, naming, or compatibility. Please | ||
| respond in the PR thread and push follow-up commits to the same branch. | ||
|
|
||
| For security issues, do not open a public issue with exploit details. Contact the | ||
| maintainers privately first. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip install -e . is enough I think