Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/deploy-landing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy landing

on:
push:
branches: [main, develop]
paths:
- "packages/mimir-landing/**"
- ".github/workflows/deploy-landing.yml"
workflow_dispatch:

permissions:
contents: read

concurrency:
group: deploy-landing-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: Build and deploy landing
runs-on: ubuntu-latest
environment:
name: ${{ github.ref == 'refs/heads/main' && 'landing-production' || 'landing-staging' }}
url: ${{ github.ref == 'refs/heads/main' && 'https://mimir.jcode.works' || 'https://staging.mimir.jcode.works' }}
defaults:
run:
working-directory: packages/mimir-landing
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Install mise
run: |
curl https://mise.run | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "$HOME/.local/share/mise/shims" >> "$GITHUB_PATH"

- name: Install pinned Node via mise
run: mise install
working-directory: .

- name: Set up pnpm
run: |
corepack enable
corepack prepare pnpm@11.9.0 --activate

- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: .

- name: Build (production)
if: github.ref == 'refs/heads/main'
run: pnpm build
env:
PUBLIC_MIMIR_LANDING_URL: https://mimir.jcode.works

- name: Deploy (production)
if: github.ref == 'refs/heads/main'
run: pnpm exec wrangler deploy
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

- name: Build (staging, not indexed)
if: github.ref == 'refs/heads/develop'
run: pnpm build
env:
PUBLIC_MIMIR_LANDING_URL: https://staging.mimir.jcode.works

- name: Deploy (staging)
if: github.ref == 'refs/heads/develop'
run: pnpm exec wrangler deploy --env staging
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
15 changes: 10 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@
`excludeFolders`/`excludeFiles` in sync with new generated-output or private-data directories.
Registering the repo on context7.com (so it resolves through `resolve-library-id`) is a manual
step on their site; these files only prepare the repo for that step.
- The bundled `mimir` skill is directly installable from this monorepo's nested path with the
[skills.sh](https://skills.sh) CLI (`npx skills add <repo-url>/tree/main/packages/mimir-core/skills/mimir`),
since that CLI supports a direct subdirectory path. If `packages/mimir-core/skills/` moves, update
the command documented in the README's "Agent Skills And MCP" section.
- `packages/mimir-ui` is the shared UI/style foundation adapted from the WorkoutGen landing/UI
approach. It provides the common Tailwind theme and React primitives for both the landing and the
Tauri app; do not import WorkoutGen product copy, assets, analytics, or secrets.
Expand Down Expand Up @@ -179,12 +175,21 @@
with `mise.toml` by hand. pnpm stays pinned via Corepack through `packageManager` in
`package.json`, not duplicated in `mise.toml`. Keep mise scoped to toolchain-version pinning —
it is not a package manager or task runner here, so don't mirror `package.json` scripts as mise
tasks; that would just create a second source of truth for no benefit.
tasks and don't wrap launch scripts (`dev:app`, `dev:landing`, `example`) in `mise exec`; that
would create a second source of truth and break the "plain pnpm works without mise" onboarding
path. For local dev, contributors activate mise in their shell (`mise activate`) so the pinned
Node/Rust land on `PATH` via shims and every `pnpm` script uses the CI toolchain automatically.
- Keep Mimir core free of Ollama. `embeddingProvider: "local-hash"` supports ingestion, search, MCP,
and cited retrieval without a model server, but it must not be described as equivalent to semantic
retrieval. `embeddingProvider: "transformers"` is the optional semantic embedding path.
- Keep `packages/mimir-core/examples/sovereign-rag-demo` synthetic and safe to commit. It exists for
package/user testing only; never place real confidential documents there.
- `packages/mimir-core/examples/library-api-demo` is the local library-API smoke (`pnpm example`). It
`import`s `@jcode.labs/mimir` via Node self-referencing so it always exercises the local
`packages/mimir-core/dist` build, never the npm-published package, and it reuses the
`sovereign-rag-demo` synthetic corpus rather than adding a second one. Testing local changes must
use this local build (or `node packages/mimir-core/dist/cli.js`), not `npx mimir`, which would
resolve the released npm version.
- Use Context7 before changing dependencies or public APIs that rely on external libraries.
- Run `pnpm validate` before opening a release pull request or publishing. It covers
Biome, dependency security audit, TypeScript, Vitest, build output, production CLI/MCP smoke
Expand Down
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pnpm build # builds UI, app frontend, landing, TTS, then Mimir Core
pnpm check # typecheck UI/app/landing/TTS/core
pnpm dev:app # run the Vite frontend for the Tauri shell
pnpm dev:landing # run the Astro landing locally
pnpm example # build core + run the library-API smoke against the local build (examples/library-api-demo)
pnpm lint # Biome CI (format + lint check, no writes)
pnpm lint:fix # Biome auto-fix
pnpm format # Biome format --write
Expand Down
133 changes: 133 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Contributor Covenant Code of Conduct

## Our Pledge

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, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders 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.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official email address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
contact@jcode.works.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][mozilla coc].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][faq]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[mozilla coc]: https://github.com/mozilla/diversity
[faq]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@ pnpm validate
`pnpm bootstrap` runs `mise install && pnpm install`. Without mise, any Node.js 20+ and pnpm install
works too — just run `pnpm install` directly.

Activate mise in your shell (`mise activate`, per the
[mise docs](https://mise.jdx.dev/getting-started.html)) so that entering this repository puts the
pinned Node (and Rust) on your `PATH` automatically. Then `pnpm dev:app`, `pnpm dev:landing`, and
`pnpm example` run on the same toolchain as CI without any per-script wiring — mise stays a
version pinner, not a task runner (see `AGENTS.md`).

`pnpm validate` runs Biome, a dependency security audit, TypeScript, Vitest, the production CLI/MCP
smoke test, and npm package metadata checks.

To smoke-test the library API against your local build while developing Mimir Core, run
`pnpm example` (see
[`packages/mimir-core/examples/library-api-demo`](./packages/mimir-core/examples/library-api-demo)).

Run the security audit alone with:

```bash
Expand Down
61 changes: 36 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@
[![npm downloads](https://img.shields.io/npm/dm/@jcode.labs/mimir?label=downloads%2Fmonth)](https://www.npmjs.com/package/@jcode.labs/mimir)
[![license: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jcode-works/jcode-mimir/blob/main/LICENSE)

Open-source, sovereign local RAG for confidential datasets and AI agents.
Open-source local RAG library, CLI, and MCP server. Mimir indexes your specs, docs, and code
locally and gives your AI agents only the useful cited passages, over MCP, without burning tokens on
your whole repo.

Mimir provides a TypeScript CLI, library, MCP server, and portable agent skills that can be
installed in any Node.js repository. It indexes local files from the target repository, stores
vectors locally with LanceDB, and can use either built-in local-hash retrieval or optional
Transformers.js semantic embeddings.
Build from your requirements, keep everything on your machine, and let Claude, Codex, Kimi,
OpenCode, Cline, or any MCP client answer from your real sources. Mimir installs into any Node.js
repository, stores vectors locally with LanceDB, and runs fully offline by default, with built-in
local-hash retrieval or optional Transformers.js semantic embeddings.

Mimir Core returns cited retrieval context. Answer synthesis belongs to the AI agent, LLM, or local
model runtime you choose around it.
model runtime you choose around it, so every answer stays grounded in your real evidence.

Created by Jean-Baptiste Thery and published under the JCode Labs npm scope.

Built by Jean-Baptiste Thery, freelance full-stack/AI tooling engineer at JCode Labs.

## Developer Use Cases

Mimir is designed for agent-assisted development when the useful context is local, private, and
Expand Down Expand Up @@ -207,8 +207,8 @@ site, but public deployment remains a separate release action.

- Build a local RAG knowledge base inside any repository.
- Analyze confidential datasets while keeping raw files and generated indexes local.
- Give Claude, Codex, Cursor, internal assistants, or other MCP-compatible tools the same private
retrieval layer.
- Give Claude, Codex, Kimi, OpenCode, Cline, internal assistants, or other MCP-compatible tools the
same private retrieval layer.
- Retrieve grounded local evidence through CLI, library calls, MCP tools, or bundled agent skills.
- Optionally create listenable MP3/WAV summaries or cited Markdown reports with bundled skills.
- Prepare legal-dossier summaries, chronologies, clause reviews, and professional-review handoffs
Expand Down Expand Up @@ -572,13 +572,6 @@ npx mimir install-skill --agents claude,codex --mcp-command ./scripts/serve-mcp.
npx mimir install-agent --agents claude,codex,kimi,opencode,cline
```

The bundled skill is also directly installable from this repository with the
[skills.sh](https://skills.sh) CLI, without adding Mimir as a dependency first:

```bash
npx skills add https://github.com/jcode-works/jcode-mimir/tree/main/packages/mimir-core/skills/mimir
```

Main agent examples:

```bash
Expand Down Expand Up @@ -993,14 +986,21 @@ Removing more dependencies is possible only by dropping features or replacing th
internal implementations. The current low-friction path is dependency-light at runtime for users who
choose `local-hash`, while preserving richer parsing, MCP support, and optional semantic embeddings.

## Example Test Workspace
## Example Test Workspaces

This repository ships two synthetic examples under
[`packages/mimir-core/examples`](./packages/mimir-core/examples). Both use the default local-hash
retrieval mode, so they run without downloading an embedding or chat model, and neither uses private
documents.

This repository includes a synthetic example under
[`packages/mimir-core/examples/sovereign-rag-demo`](./packages/mimir-core/examples/sovereign-rag-demo). It can
be used to test ingestion, retrieval, `security-audit`, and custom text extensions without using
private documents.
> Testing local changes: use the repository's own build, not `npx`. Inside this repo `npx mimir`
> resolves to the **published** npm package, not your working copy — so it would not exercise your
> local edits. The examples below run the local `dist/` build instead.

From a local checkout:
### CLI workspace (`sovereign-rag-demo`)

[`sovereign-rag-demo`](./packages/mimir-core/examples/sovereign-rag-demo) drives the **CLI** to test
ingestion, retrieval, `security-audit`, and custom text extensions.

```bash
pnpm build
Expand All @@ -1013,8 +1013,19 @@ node ../../dist/cli.js evaluate --golden golden-queries.json --fail-under 1
node ../../dist/cli.js audit
```

The example uses the default local-hash retrieval mode, so it can run without downloading an
embedding or chat model.
### Library API demo (`library-api-demo`)

[`library-api-demo`](./packages/mimir-core/examples/library-api-demo) exercises the **library** API
the way an external consumer would `import` it, but Node self-referencing resolves
`@jcode.labs/mimir` to the local build, never npm. It is the fast inner loop when developing Mimir
Core itself:

```bash
pnpm example
```

That builds Mimir Core, then runs `ingest -> search -> ask -> audit` through the public API against
the reused synthetic corpus.

## Development And Release

Expand Down
7 changes: 4 additions & 3 deletions llms.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Mimir

> Open-source, sovereign local RAG for confidential datasets and AI agents: a TypeScript CLI,
> library, MCP server, and portable agent skills that index local files, store vectors with
> LanceDB, and return cited retrieval context to the calling coding agent.
> Open-source local RAG library, CLI, and MCP server. Mimir indexes your specs, docs, and code
> locally and gives your AI agents only the useful cited passages, over MCP, without burning tokens
> on your whole repo. It stays sovereign and offline by default, storing vectors locally with
> LanceDB; answer synthesis stays with the calling agent or model.

Mimir Core (`@jcode.labs/mimir`, npm) ingests local files from the target repository, redacts
secrets and PII before anything is embedded, and serves cited passages through a CLI (`mimir ...`),
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"commitlint": "commitlint --from=HEAD~1 --to=HEAD --verbose",
"dev:app": "pnpm --filter @jcode.labs/mimir-app dev",
"dev:landing": "pnpm --filter @jcode.labs/mimir-landing dev",
"example": "pnpm --filter @jcode.labs/mimir build && node packages/mimir-core/examples/library-api-demo/run.mjs",
"format": "biome format --write .",
"lint": "biome ci .",
"lint:fix": "biome check --write .",
Expand Down
Loading