Cortexa.Workspace (cortexa v0.1.1)

Copy Markdown View Source

GCCWorkspace — persistent versioned memory workspace for LLM agents.

cortexa — Git-inspired context management. Based on arXiv:2508.00031.

Summary

Functions

BRANCH — create an isolated reasoning workspace.

COMMIT — checkpoint a milestone on the current branch.

CONTEXT — hierarchical memory retrieval.

Initialize a fresh .GCC workspace.

List all branches.

Attach to an existing .GCC workspace.

Append an OTA cycle to the current branch.

MERGE — integrate a branch back into a target.

Create a new workspace handle.

Switch to an existing branch.

Types

t()

@type t() :: %Cortexa.Workspace{
  current_branch: String.t(),
  gcc_dir: String.t(),
  root: String.t()
}

Functions

branch(ws, name, purpose)

@spec branch(t(), String.t(), String.t()) :: t()

BRANCH — create an isolated reasoning workspace.

commit(ws, contribution, previous_summary \\ nil, update_roadmap \\ nil)

@spec commit(t(), String.t(), String.t() | nil, String.t() | nil) ::
  {t(), Cortexa.Models.CommitRecord.t()}

COMMIT — checkpoint a milestone on the current branch.

context(ws, branch_name \\ nil, k \\ 1)

@spec context(t(), String.t() | nil, non_neg_integer()) ::
  Cortexa.Models.ContextResult.t()

CONTEXT — hierarchical memory retrieval.

init(ws, project_roadmap \\ "")

@spec init(t(), String.t()) :: t()

Initialize a fresh .GCC workspace.

list_branches(ws)

@spec list_branches(t()) :: [String.t()]

List all branches.

load(ws)

@spec load(t()) :: t()

Attach to an existing .GCC workspace.

log_ota(ws, observation, thought, action)

@spec log_ota(t(), String.t(), String.t(), String.t()) ::
  {t(), Cortexa.Models.OTARecord.t()}

Append an OTA cycle to the current branch.

merge(ws, branch_name, summary \\ nil, target \\ "main")

@spec merge(t(), String.t(), String.t() | nil, String.t()) ::
  {t(), Cortexa.Models.CommitRecord.t()}

MERGE — integrate a branch back into a target.

new(project_root)

@spec new(String.t()) :: t()

Create a new workspace handle.

switch_branch(ws, name)

@spec switch_branch(t(), String.t()) :: t()

Switch to an existing branch.