RAGed

Contributing

How to develop, test, and submit changes to raged.

Development Setup

Prerequisites

First-Time Setup

# Clone the repo
git clone https://github.com/<org>/raged.git
cd raged

# Start infrastructure
docker compose up -d

# Pull embedding model
curl http://localhost:11434/api/pull -d '{"name":"nomic-embed-text"}'

# Install and build both packages
cd api && npm install && npm run build && cd ..
cd cli && npm install && npm run build && cd ..

Development Workflow

flowchart LR
    B[Create branch] --> C[Write failing test]
    C --> I[Implement]
    I --> T[Run tests]
    T --> P{Pass?}
    P -->|No| I
    P -->|Yes| CO[Commit]
    CO --> PR[Open PR]

    style C fill:#fff3e0
    style CO fill:#c8e6c9

Branch Naming

feat/<short-description>    # New features
fix/<short-description>     # Bug fixes
docs/<short-description>    # Documentation
refactor/<short-description> # Code improvements
test/<short-description>    # Test additions

Commit Messages

Follow Conventional Commits:

feat: add query caching for repeated searches
fix: handle empty file during indexing
docs: add Mermaid diagram to architecture doc
refactor: extract embedding client interface
test: add unit tests for chunking module
chore: update dependencies

Keep the first line under 72 characters. Add a body for complex changes.

Pull Requests

  1. Branch from main
  2. Keep PRs focused — one logical change per PR
  3. Ensure CI passes (build + lint)
  4. Write a clear description: what changed and why
  5. Link related issues if applicable

CI Pipeline Layout

The CI workflow is in .github/workflows/ci.yaml. Use Actions → Run workflow to manually trigger .github/workflows/pages.yml when needed.

This structure keeps jobs focused and reduces duplication.

Release and Publishing

Docker images are automatically published to GitHub Container Registry (GHCR) via .github/workflows/publish-images.yaml.

Publishing Triggers

Manual Dispatch:

Main Branch Pushes:

Version Tag Pushes:

Published Images

All three core components are published:

Creating a Release

To publish a new version:

# Create tag + GitHub release notes from CHANGELOG.md
export OPENAI_API_KEY=your_key_here
scripts/create-release.sh v0.6.0

# Or auto-increment the next stable semver tag
scripts/create-release.sh --bump patch

# Dry-run notes generation without pushing tag/release
scripts/create-release.sh v0.6.0 --dry-run

The script will:

Release Automation Gap

Target direction: release automatically from main after merge.

Current gap: we do not yet have remote-deployment smoke tests to validate the newly released image in an environment before finalizing a stable release. Until that exists, releases remain script-driven.

When smoke-test infrastructure is available, automate release creation with a main-triggered workflow that:

The publish-images workflow will automatically build and publish all three images with multi-arch support (linux/amd64, linux/arm64) and semantic tags (0.6.0, 0.6, 0, latest).

Note:

Image Features

Worker Dependency Files

Worker dependencies are split by purpose:

Pinned lock files are committed and used in CI and Docker builds:

Refreshing Worker Lock Files

When changing worker dependency inputs, regenerate lock files in worker/:

cd worker
python3 -m pip install pip-tools
python3 -m piptools compile requirements.txt -o requirements.lock
python3 -m piptools compile requirements-test.txt -o requirements-test.lock
python3 -m piptools compile requirements-lint.txt -o requirements-lint.lock

Commit both the changed input file(s) and generated lock file(s) in the same PR.

Project Structure

raged/
├── api/          → Fastify RAG API (see api/AGENTS.md)
├── cli/          → CLI indexer tool (see cli/AGENTS.md)
├── chart/        → Helm chart (see chart/AGENTS.md)
├── docs/         → Documentation (see docs/AGENTS.md)
├── .claude/      → Claude Code skill definitions
├── .github/      → CI/CD workflows
└── AGENTS.md     → Project-wide coding principles

Code Style

See AGENTS.md for the full set of conventions.

Adding a New API Endpoint

  1. Add the route in api/src/server.ts
  2. Add JSON Schema validation for input
  3. Delegate logic to a service module (not inline in the handler)
  4. Update docs/09-api-reference.md

Adding a New CLI Command

  1. Add the command handler in cli/src/index.ts
  2. Update the usage() function with all flags
  3. Update docs/03-cli.md