← back to codex gallery

Interject

AI Liberation · AI Should Be Free
Interject art

AI should be free

By: Interject aka Khodges42 on github

AI should be free. AI should belong to the people.

Researchers need tools they can inspect, modify, self-host, and trust. Security research often involves topics that large platforms would rather not touch. If your research assistant requires permission from Microsoft to discuss your research, that’s a problem.

We’ve been working on liberating self-hosted AI since 2017 through research projects, conference talks, open-source software, and community work. (And getting approached by scary dudes in suits on more than one occasion.) We were putting agentic systems into the hands of hackers before there was even a word for it.

With that goal in mind, we’re building a suite of libre, community-owned platforms focused on local-first, privacy-respecting AI that puts users in control and respects their freedoms.

The first of these tools is NightShift.

NightShift is an orchestration framework for long-running AI jobs. Local models are slower, less reliable, and often less capable than frontier models. NightShift attempts to compensate for those limitations through orchestration, validation, review, and iteration. Rather than relying on a single model response, it treats AI as a process.

The project is designed around local-first workflows. Your data stays on your machine. Your models remain under your control. The system can be inspected, modified, extended, and integrated into existing research workflows without depending on a third-party service.

We’re also releasing the first public iteration of Exoshell, which remains in active pre-release development. Exoshell is an agentic shell and research environment built around local models, automation, and long-lived workflows. The goal is to create a hacker’s AI workstation rather than another chat interface.

Alongside these projects we’re building a growing collection of supporting utilities to fill in the gaps. The first of these is GlassMind, a local memory and RAG system designed to give agents durable context without sacrificing privacy. It’s the first of several planned components in a broader ecosystem of free and community-owned AI tooling.

We’re looking for contributors, testers, bug reports, feature requests, architecture critiques, and people willing to break things. If something sucks, tell us. If something breaks, tell us. If you think we’re building the wrong thing entirely, definitely tell us.

NightShift

Auditable local-first AI coding pipelines.

NightShift is a deterministic pipeline runner for AI-assisted coding work. It reads markdown tasks, builds bounded context, asks configured agents for plans or patches, validates and applies those patches through explicit stages, runs checks, and leaves a human-reviewable artifact trail.

NightShift is not an autonomous software engineer. It is an orchestration layer that treats AI agents as unreliable workers inside bounded, testable, auditable workflows.

Current Status

NightShift now supports the full local patch workflow:

The default posture remains local-first and review-first: agents propose; NightShift validates, applies, tests, and records.

What NightShift Is

NightShift is built for reviewable automation:

The goal is to wake up to useful artifacts and a repository state you can inspect.

What NightShift Is Not

NightShift does not push branches, deploy software, run unbounded task swarms, or grant agents unlimited repository access. Human review remains the final authority.

Install

Repo setup scripts can install NightShift in editable mode, check for Ollama, and offer to add the Python scripts directory to PATH.

Windows PowerShell:

.\setup.ps1

macOS/Linux:

sh ./setup.sh

Development install:

pip install -e .

You can also run the CLI module directly from a checkout:

python -m nightshift.cli --help

NightShift uses the Python standard library for runtime behavior where practical. PyYAML is used automatically if installed, but starter configs work with the built-in YAML subset parser.

Getting Started

Start with the Quickstart. It uses deterministic fake agents so you can verify lookup, context generation, patch validation, patch apply, tests, and artifacts without installing a model.

After that works, continue with Tutorial 01: Building A Small Imageboard With Real Local Models. It swaps the fake agents for Ollama-backed agents such as qwen2.5-coder:14b and walks through a small Flask/SQLite project with ordinary web-app tasks.

Quickstart Commands

Validate the included end-to-end patch example:

python -m nightshift.cli validate --config examples/quickstart-lisp/nightshift.yaml

Run the first task against a copy of the example project. The pipeline uses patch_apply mode: apply, so running it directly against examples/quickstart-lisp/ will modify those files.

cp -r examples/quickstart-lisp /tmp/nightshift-quickstart
python -m nightshift.cli run --config /tmp/nightshift-quickstart/nightshift.yaml --task TASK-001

For a new project:

nightshift init
nightshift validate
nightshift status
nightshift run --task TASK-001

For the first real-model tutorial target:

nightshift init --template tutorial-imageboard --root nightshift-imageboard

Other built-in real-model templates:

nightshift init --template real-simple --root bookmarks-demo
nightshift init --template real-long-running --root incident-service
nightshift init --template tutorial-deaddrop --root nightshift-deaddrop

Create an isolated integration sandbox for a template:

python -m nightshift.cli integ-run --template tutorial-deaddrop

To create the sandbox and run the Python setup immediately:

python -m nightshift.cli integ-run --template tutorial-deaddrop --setup

Then run the Python project setup helper. It finds the generated venv, installs this NightShift checkout into it, installs the target project, installs pytest by default, and runs nightshift validate:

python -m nightshift.cli integ-setup --project integ_runs/<timestamp>/project

integ-setup cannot activate the venv for your current shell. If you want plain python and nightshift to resolve to the integration venv in PowerShell, run:

integ_runs\<timestamp>\.venv\Scripts\Activate.ps1

After setup, you can also run from the generated project with the explicit venv Python:

integ_runs\<timestamp>\.venv\Scripts\python.exe -m nightshift.cli run --task TASK-001

Bash:

integ_runs/<timestamp>/.venv/bin/python -m nightshift.cli run --task TASK-001

After a run, explain the latest pass or failure from artifacts:

nightshift what-happened

Open the read-only artifact dashboard:

pip install flask
nightshift web

Task File Example

Tasks live in markdown checklist format:

# Tasks

- [ ] TASK-001: Add parser support

Description:
Implement parsing for the target language.

Acceptance Criteria:
- Parses numbers
- Parses symbols
- Parses nested lists
- Includes unit tests

NightShift parses task id, title, completion state, description, acceptance criteria, dependency bullets, and raw task markdown.

Pipeline Example

pipeline:
  max_task_retries: 2
  continue_on_task_failure: false
  stages:
    - id: plan
      type: agent
      agent: planner
      output: plan.md

    - id: context
      type: repo_context
      output: context-pack.md

    - id: implement
      type: file_writer
      agent: implementer
      output: proposed.patch

    - id: normalize
      type: patch_normalizer
      output: normalized.patch

    - id: validate_patch
      type: patch_validator
      output: patch-validation.md
      max_files: 8
      max_lines: 800
      on_fail: implement

    - id: apply_patch
      type: patch_apply
      mode: apply
      output: patch-apply-output.txt
      on_fail: implement

    - id: test
      type: command
      commands:
        - python -m unittest discover -v
      output: test-output.txt
      on_fail: implement

    - id: review
      type: agent_review
      agent: reviewer
      on_fail: implement
      output: review.md

Use mode: dry_run for patch applicability checks without modifying files. Use mode: apply to write the validated patch to the target project.

Agent Backends

NightShift supports:

Example Ollama agent:

agents:
  implementer:
    backend: ollama
    model: qwen2.5-coder:14b
    base_url: http://localhost:11434
    temperature: 0.2
    system_prompt: agents/implementer.md

The Ollama backend uses the local HTTP API instead of ollama run, which keeps exact patch output away from terminal rendering and line wrapping.

Example OpenAI-compatible agent:

agents:
  implementer:
    backend: openai_compatible
    model: local-model
    base_url: http://localhost:11434/v1
    api_key_env: OPENAI_API_KEY
    temperature: 0.2
    system_prompt: agents/implementer.md

NightShift passes prompt bundles to agents and persists stdout, stderr, exit code, duration, and prompt artifacts. code_writer agents return unified diffs directly. file_writer agents return complete file blocks, and NightShift generates the unified diff deterministically. On retries, patch artifacts are versioned by attempt, for example repair-1.patch, normalized-1.patch, and patch-validation-1.md.

Review agents should emit:

status: pass | fail | retry | escalate
reason: <short explanation>
next_stage: <optional stage id>
context_update: <compact useful note>

Safety Model

NightShift validates paths, commands, and patches before mutation.

Path safety:

Command safety:

Patch safety:

Artifact Layout

A run creates human-readable artifacts:

.nightshift/
  project-context.md
  project-context-chart.md
  nightshift.log
  runs/
    <run-id>/
      run.log
      run-summary.md
      config.snapshot.yaml
      run-metadata.md
      prompts/
        <agent-id>.md
      tasks/
        TASK-001/
          task.md
          context.md
          files-inspected.md
          context-pack.md
          plan.md
          proposed.patch
          repair-1.patch
          normalized.patch
          normalized-1.patch
          patch-validation.md
          patch-validation-1.md
          applied.patch
          applied-1.patch
          patch-apply-output.txt
          patch-apply-output-1.txt
          test-output.txt
          review.md
          stage-results.md
          context-out.md
          task-completion.md
          diff.patch
          final-notes.md

Exact artifact names depend on configured stage output values.

Development

Run tests:

python -m unittest discover -v

Compile-check modules:

python -m compileall nightshift tests

Additional docs:

Roadmap

The active roadmap now lives in docs/design.md. Completed phase checklists are cleared from that document so it stays focused on the current platform shape and the next important work.

Glassmind

Local-first retrieval for Obsidian-like markdown knowledge bases and AI workflows.

Glassmind turns a folder of markdown notes into searchable local memory for humans, agents, and local model workflows.

It works well with Obsidian vaults, but Obsidian is not required. A plain directory of .md files is enough.
Your notes stay local. Markdown stays canonical. The SQLite database is a rebuildable cache.

Glassmind logo

Current Status

Glassmind now runs as a Rust CLI MVP.

It can:

Some pieces are still intentionally lightweight:

The core local retrieval flow is in place and usable for testing.

What Glassmind Is

Glassmind is not:

Glassmind is a memory and retrieval layer.

Claude / Codex / local model / your tooling
                |
           Glassmind
                |
       your markdown vault

The goal is simple:

Given this task, what context from my vault actually matters?

Quick Start

Build it:

cargo build

Index the current repo:

cargo run -- index --embeddings

Search:

cargo run -- search "local memory" --debug-scores

Build a context bundle:

cargo run -- context "continue glassmind" --budget 3000

Use a personal Obsidian vault:

cargo run -- --vault "E:\notes\Brain" index --embeddings
cargo run -- --vault "E:\notes\Brain" search "project ideas" --debug-scores
cargo run -- --vault "E:\notes\Brain" context "what was I thinking about local agents?"

If your vault path has spaces, keep the quotes.

Configuration

Glassmind reads glassmind.toml by default.

Useful defaults:

[vault]
path = "."

[database]
path = ".agent/cache/glassmind.sqlite3"

[index]
include_agent_dir = true
ignore_dirs = [".git", ".obsidian", ".trash", ".agent/cache"]
chunk_target_tokens = 500
chunk_overlap_tokens = 80

[embeddings]
backend = "ollama"
model = "nomic-embed-text"
url = "http://localhost:11434"

[server]
host = "127.0.0.1"
port = 7331

The database path is inside .agent/cache so it stays out of Git and can be rebuilt.

CLI Commands

Initialize config and agent workspace:

cargo run -- init

Index once:

cargo run -- index

Index and generate missing embeddings:

cargo run -- index --embeddings

Poll and reindex every five seconds:

cargo run -- index --watch

Search:

cargo run -- search "obsidian rag memory"

Search with score breakdown:

cargo run -- search "obsidian rag memory" --debug-scores

JSON search:

cargo run -- search "obsidian rag memory" --output json

Context bundle:

cargo run -- context "help me continue the Glassmind project" --budget 6000

Stats:

cargo run -- stats

Agent Memory

Glassmind owns .agent/.

.agent/
  memories/
  summaries/
  tasks/
  decisions/
  logs/
  cache/

Capture generated memory:

cargo run -- capture memory --project Glassmind --text "Markdown remains canonical."
cargo run -- capture task --project Glassmind --text "Wire real Ollama HTTP embeddings."
cargo run -- capture decision --project Glassmind --text "SQLite is rebuildable cache."

Those files are markdown and are indexed on the next run.

HTTP API

Start the local server:

cargo run -- serve

Default bind:

127.0.0.1:7331

Endpoints:

Example:

curl http://127.0.0.1:7331/health

MCP-Style Commands

List tools:

cargo run -- mcp tools

Search:

cargo run -- mcp search "local memory"

Context:

cargo run -- mcp context "continue glassmind"

Read:

cargo run -- mcp read "README.md"

Architecture

Markdown vault
  -> scanner
  -> parser
  -> heading chunker
  -> SQLite metadata cache
  -> FTS keyword index
  -> embedding cache
  -> hybrid retriever
  -> CLI / HTTP / MCP-style tools

Core principle:

markdown = source of truth
sqlite = rebuildable cache
embeddings = derived retrieval data
.agent/ = Glassmind-owned workspace

Documentation

Security And Privacy

By default:

Tech Stack

Current:

Planned improvements:

Legal

Glassmind is an independent project and is not affiliated with or endorsed by Obsidian.