Skip to content

kehao95/quine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,291 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quine

A POSIX-native runtime for large language model agents

Quine realizes an LLM agent as a native operating-system process. An agent has a PID, standard streams, a filesystem, resource limits, and lifecycle operations such as fork, spawn, exec, and exit. The runtime uses Unix process semantics as the substrate for agent coordination instead of rebuilding those semantics inside an application framework.

# Pipe material into a mission.
echo "What is 2+2?" | quine "answer the question"

# Run a mission directly.
quine "write a haiku about recursion"

# Ask the process to reproduce an executable successor.
quine "Output a binary that is an implementation of yourself." > q
chmod +x q
./q "say hello to the world"

At A Glance

Quine is both a runtime and a research workbench.

  • Runtime code lives here, centered on cmd/quine/ and internal/.
  • Experiments, evidence records, and evaluation harnesses live under experiments/ and tests/.
  • Papers, theory notes, essays, and some unfinished drafts live under Paper/.

The repository is intentionally more than a polished SDK. It is a public record of code, experiments, papers, and ideas evolving together. Some directories are research notes or active drafts; treat them as working material unless their local README says otherwise.

Quick Start

Install the command:

go install github.com/kehao95/quine/cmd/quine@latest

Or build from a checkout:

git clone https://github.com/kehao95/quine.git
cd quine
go build -o ./quine ./cmd/quine/

Configure a model endpoint:

cp .env.example .env
# Edit .env, then export the variables into your shell.
source .env

Run:

echo "What is 2+2?" | ./quine "answer the question"

For model profiles, workspace modes, runtime controls, and validation commands, see QUICKSTART.md.

Core Idea

Quine's first-order object is the POSIX-native LLM agent runtime.

Claim Meaning Why it matters
Agent = Process The agent is a native OS process, not a simulated persona inside an app framework Moves the substrate from conversation management to a mature computational ontology
POSIX as Physics Permissions, signals, pipes, files, and resource limits are the environment's laws Safety and coordination become environmental constraints, not prompt-only intentions
Context as Entropy Tokens are volatile working memory, not durable knowledge Makes externalization, memory structure, and fork principled cognitive operations
Selection over Instruction Robust behavior emerges because bad strategies fail under scarcity Reframes agent design from prescribing behavior to shaping a survivable environment
Behavior is the Acceptance Test A feature is incomplete until a model can discover and use it from prompt plus schema Treats legibility and emergence as first-class systems properties

Quine matters less as another tool wrapper and more as a runtime cut: an agent is a process living under operating-system physics. That shift changes what counts as memory, communication, safety, failure, and intelligence.

Documentation

If you want to... Start with
run Quine locally QUICKSTART.md
understand runtime behavior Architecture Snapshot, then Paper/core/
inspect implementation cmd/quine/ and internal/
run tests and evaluations EVALUATION.md and tests/README.md
follow experiments experiments/README.md
read papers and essays Paper/README.md
contribute or run agent maintenance For Contributors And Agents

Repository Map

Path Role
cmd/quine/ CLI entrypoint for the runtime
cmd/qctl/, operator/qctl/ Companion client surfaces for attach/spawn workflows
cmd/world/, habitat/ Controlled habitat runtime used by world and environment-control studies
internal/ Runtime substrate: config, LLM protocols, tools, tape, lifecycle, and workspace behavior
tests/ Validation harnesses and model-facing evaluations
experiments/ Experiment designs, run records, and empirical exploration
Paper/ Theory, definitions, publication tracks, essays, and draft material
scripts/ Validators and helper scripts
obsidian/ Checked-in text-native observation overlays

Architecture Snapshot

This is a reader-facing snapshot. The implementation and Paper/core/registries/ own the detailed runtime contract.

Agent primitive POSIX mechanism Purpose
Identity session_id, run_id, PID Durable lineage, physical run, live route
Interface stdin/stdout/stderr Material input, deliverable output, diagnostics
State filesystem surfaces, retained traces, context, bounded env handoff Durable state, volatile cognition, explicit inheritance
Lifecycle fork / spawn / exec / exit Context-preserving creation, fresh creation, image replacement, judgment
Composition pipes, job control, process groups Multi-agent coordination

The host side is deterministic Go code that exposes OS-like constraints. The guest side is a probabilistic model operating through that process surface. Tools map model calls to filesystem, process, and lifecycle operations.

Research And Papers

Quine sits at the intersection of systems, agent design, and artificial life.

Area Core contribution
Systems A minimal runtime that maps agent primitives directly to POSIX primitives
Agent architecture A Harvard-style separation between optional mission, material, deliverable, and failure signal
Long-context cognition A metabolic model where fork, explicit memory structure, and externalization counter context entropy
Artificial life Environments where bounded lifespan, reproduction, and selection can produce observable emergent strategies
Evaluation Behavior tests that ask whether a model can learn the runtime's physics

Current entrypoints:

Artifacts

Some experiment outputs and evidence bundles are represented by DVC pointer files rather than stored directly in Git. Public artifact restore is manifest-scoped: exact public paths are listed in .dvc/public-manifest.txt and restored with the repo scripts that read that manifest.

A plain dvc pull is not the public restore contract for this repository. Use the experiment-local README or evidence surface when a public artifact is available.

For Contributors And Agents

This README is the human public entrypoint. Agent and maintainer operating rules live in the repo control plane:

  • AGENTS.md for agent behavior, maintenance boundaries, and repo self-model rules
  • DEVELOPMENT.md for development routing, validation contracts, and maintainer navigation
  • CLOSURE.md for closure criteria
  • ROADMAP.md and STATUS.md for durable project routing and human assessments

If you are only trying Quine, start with QUICKSTART.md.

Follow

Citation

Quine has two citation anchors. For the runtime, implementation, or agent-as-process design point, cite the systems paper. If you discuss Quine as a process habitat for generative artificial life, also cite the ALife workshop manuscript.

Runtime / systems:

Generative ALife / process habitats:

See CITATION.cff for machine-readable citation metadata, including the preferred paper and related paper references.

License

Quine is Free Software released under the GPLv2, the same license family as the Linux kernel. See LICENSE for details.

About

The Quine research project

Resources

License

Stars

Watchers

Forks

Contributors