Contributing to Origin

May 24, 2026 · View on GitHub

Origin is a local-first personal AI memory layer. We welcome bug fixes, features, tests, docs, and design feedback.

This repo holds the daemon (origin-server), the CLI (origin), the MCP server (origin-mcp), and the shared types/core (origin-types, origin-core). The Tauri desktop app lives in 7xuanlu/origin-app. Bug reports for the local runtime, CLI, MCP server, and plugin are welcome here.

Development Setup

Requirements: macOS (arm64 + x64), Linux (x86_64 + arm64; glibc), or Windows (x86_64); platform build tools (Xcode Command Line Tools on macOS, MSVC Build Tools on Windows, gcc + make on Linux); Rust (stable).

git clone https://github.com/7xuanlu/origin.git
cd origin
cargo build -p origin-server

Run the daemon directly:

cargo run -p origin-server

Or install as a launchd service:

cargo build --release -p origin -p origin-server
./target/release/origin setup --basic
./target/release/origin install
./target/release/origin status

First build can take several minutes while llama.cpp compiles for Metal.

Running Tests

# Workspace tests
cargo test --workspace

# Per-crate
cargo test -p origin-types
cargo test -p origin-core --lib
cargo test -p origin-server
cargo test -p origin

Linting

cargo fmt --check --all
cargo clippy --workspace --all-targets -- -D warnings

Architecture Overview

  • Shared types: crates/origin-types (Apache-2.0). Lightweight wire types shared with origin-mcp and origin-app via crates.io.
  • Core logic: crates/origin-core (Apache-2.0). DB, embeddings, LLM engine, search, knowledge graph, distill cycles, eval. No tauri / no axum dependencies.
  • HTTP daemon: crates/origin-server (Apache-2.0), serves 127.0.0.1:7878.
  • CLI binary: crates/origin-cli (Apache-2.0). The origin command for setup, service management, search, recall, etc.
  • MCP server: crates/origin-mcp (Apache-2.0). The connector spawned by Claude Code, Cursor, Codex, and other MCP clients.
  • Desktop app (separate repo): 7xuanlu/origin-app, AGPL-3.0-only.
  • Database: libSQL (vectors + knowledge graph + FTS).

See CLAUDE.md for a full module-by-module breakdown.

Finding Work

Look for issues labeled good first issue or help wanted.

Pull Request Process

  1. Fork the repo and create a branch from main
  2. Make your changes — keep PRs small and focused (one logical change per PR)
  3. Ensure all tests pass and linting is clean
  4. Open a PR using the template — describe what and how to test

CI runs cargo fmt --check --all, cargo clippy --workspace --all-targets, and cargo test across all daemon crates.

Code Conventions

These conventions keep the codebase consistent. See CLAUDE.md for the full list.

  • SQL safety: Always use parameterized queries — never interpolate user input into SQL strings
  • NULL semantics: Store Option<T> as SQL NULL, not empty string
  • UTF-8 safety: Never byte-index Rust strings (&s[..n]) — use chars().take(n) instead
  • Batch SQL: Wrap multi-row insert/delete loops in BEGIN/COMMIT transactions
  • License headers: The workspace is still normalizing SPDX headers after the package split. For new files, use the header that matches the package/file license even if nearby legacy files have not been cleaned up yet.

Docs Layout

  • In-repo docs live under docs/ (especially docs/plans/ for historical implementation context).
  • Some personal/internal notes may exist outside the repository and are not required for contributors.

License

This repo is Apache-2.0: crates/origin-types, crates/origin-core, crates/origin-server, crates/origin-cli, crates/origin-mcp, and the Claude Code plugin files. The desktop app in origin-app is AGPL-3.0-only.

By contributing, you agree that your changes will be licensed under the license that applies to the files you modify.