Options and configuration keys for Git database adapter.
Git repos serve as agent-scoped databases. Entities are EDN files in directories, commits are the transaction log.
Options and configuration keys for Git database adapter. Git repos serve as agent-scoped databases. Entities are EDN files in directories, commits are the transaction log.
Boolean. If true, the repository is initialized as a bare repo (git init --bare). Bare repos have no working directory — worktrees are the only working dirs. Use for conversation-style storage where each conversation is a worktree/branch.
Boolean. If true, the repository is initialized as a bare repo (git init --bare). Bare repos have no working directory — worktrees are the only working dirs. Use for conversation-style storage where each conversation is a worktree/branch.
Function (fn [entity-map operation] string) that generates a git commit message. Operation is :create, :update, or :delete. Default: "{operation} {entity-type}/{id}"
Function (fn [entity-map operation] string) that generates a git commit message.
Operation is :create, :update, or :delete.
Default: "{operation} {entity-type}/{id}"Key in config for map of schema name -> repo config. {:knowledge {:dir "mementum/memories/" :auto-init? true}}
Key in config for map of schema name -> repo config.
{:knowledge {:dir "mementum/memories/" :auto-init? true}}Boolean. If true, this entity type is stored as a directory, not a file. Each entity instance is a subdirectory. Core attributes live in an index file inside the directory, named after the entity namespace + file-extension.
Example: (defattr id :experiment/id :string {::gto/directory? true ::gto/entity-dir "scale-invariance"})
This produces: scale-invariance/{id}/experiment.edn
Boolean. If true, this entity type is stored as a directory, not a file.
Each entity instance is a subdirectory. Core attributes live in an index file
inside the directory, named after the entity namespace + file-extension.
Example: (defattr id :experiment/id :string
{::gto/directory? true
::gto/entity-dir "scale-invariance"})
This produces: scale-invariance/{id}/experiment.ednBoolean. If true, install git-embed hooks at repository creation time. Enables automatic semantic indexing on every commit. Requires git-embed to be installed. Defaults to false.
Example: {:dir "data/knowledge" :embed? true}
Boolean. If true, install git-embed hooks at repository creation time.
Enables automatic semantic indexing on every commit.
Requires git-embed to be installed. Defaults to false.
Example: {:dir "data/knowledge" :embed? true}Directory name for this entity type within the repo. Defaults to the namespace of the identity attribute.
Example: (defattr id :memory/id :string {::gto/entity-dir "memory"})
Directory name for this entity type within the repo.
Defaults to the namespace of the identity attribute.
Example: (defattr id :memory/id :string
{::gto/entity-dir "memory"})File extension for entity files (including the dot). Defaults to ".edn". Controls entity-path construction, list-entities filtering, and repo-status counting.
Set per identity attribute. When set, all entities of that type use the given extension.
Example: (defattr id :memory/id :uuid {::gto/entity-dir "mementum/memories" ::gto/file-extension ".md"})
File extension for entity files (including the dot). Defaults to ".edn".
Controls entity-path construction, list-entities filtering, and repo-status counting.
Set per identity attribute. When set, all entities of that type use the given extension.
Example: (defattr id :memory/id :uuid
{::gto/entity-dir "mementum/memories"
::gto/file-extension ".md"})Attribute whose value is used as the filename (without extension). Must be unique within the entity type. Defaults to the identity attribute.
Example: (defattr slug :memory/slug :string {::gto/file-key true})
Attribute whose value is used as the filename (without extension).
Must be unique within the entity type. Defaults to the identity attribute.
Example: (defattr slug :memory/slug :string
{::gto/file-key true})Boolean. If false, automatic resolvers will not be generated for this attribute. Defaults to true.
Boolean. If false, automatic resolvers will not be generated for this attribute. Defaults to true.
Function (fn [file-content] entity-data) that deserializes file content on read. Defaults to clojure.edn/read-string.
For raw text entities that need attribute wrapping: {::gto/read-fn (fn [s] {:content s})}
For custom formats: {::gto/read-fn (fn [s] (json/parse-string s true))}
Function (fn [file-content] entity-data) that deserializes file content on read.
Defaults to clojure.edn/read-string.
For raw text entities that need attribute wrapping:
{::gto/read-fn (fn [s] {:content s})}
For custom formats:
{::gto/read-fn (fn [s] (json/parse-string s true))}Boolean. If true, this attribute is derived from git metadata (commit info, etc.) and is not stored in the EDN file.
Boolean. If true, this attribute is derived from git metadata (commit info, etc.) and is not stored in the EDN file.
Boolean. If true, the all-IDs resolver lists entities recursively through subdirectories. Entity IDs become relative paths from entity-dir without extension (e.g. "architecture/statecharts" for mementum/knowledge/architecture/statecharts.md). Defaults to false (flat directory listing).
Example: (defattr id :wiki/slug :string {::gto/entity-dir "mementum/knowledge" ::gto/recursive? true})
Boolean. If true, the all-IDs resolver lists entities recursively through
subdirectories. Entity IDs become relative paths from entity-dir without
extension (e.g. "architecture/statecharts" for mementum/knowledge/architecture/statecharts.md).
Defaults to false (flat directory listing).
Example: (defattr id :wiki/slug :string
{::gto/entity-dir "mementum/knowledge"
::gto/recursive? true})Key in Pathom env for map of schema name -> git repo map. Each repo map: {:dir string, :initialized? boolean}
Key in Pathom env for map of schema name -> git repo map.
Each repo map: {:dir string, :initialized? boolean}Boolean. If true, this entity type lives inside a parent directory entity. The resolver requires the parent identity in its input (compound input). Path construction includes parent: repo/entity-dir/parent-id/ref-name/child-id.ext
The parent-child relationship is declared via a :ref attribute on the parent with ao/target pointing to this identity. The ref attribute name determines the child subdirectory: (name :experiment/results) → "results/".
Example: (defattr result-id :result/id :string {ao/identity? true ao/schema :experiments ::gto/scoped? true})
Boolean. If true, this entity type lives inside a parent directory entity.
The resolver requires the parent identity in its input (compound input).
Path construction includes parent: repo/entity-dir/parent-id/ref-name/child-id.ext
The parent-child relationship is declared via a :ref attribute on the parent
with ao/target pointing to this identity. The ref attribute name determines
the child subdirectory: (name :experiment/results) → "results/".
Example: (defattr result-id :result/id :string
{ao/identity? true
ao/schema :experiments
::gto/scoped? true})String. Declares that this attribute lives in a specific file within the directory entity, not the index file. Enables selective loading — different resolvers for different files, Pathom only reads what the query asks for.
Attributes with the same source-file value share a resolver. Attributes without source-file go in the index file (default group). Only meaningful for directory entities (::gto/directory? true).
Example: (defattr analysis :experiment/analysis :map {ao/schema :experiments ao/identities #{:experiment/id} ::gto/source-file "summary.edn"})
String. Declares that this attribute lives in a specific file within the
directory entity, not the index file. Enables selective loading — different
resolvers for different files, Pathom only reads what the query asks for.
Attributes with the same source-file value share a resolver. Attributes
without source-file go in the index file (default group). Only meaningful
for directory entities (::gto/directory? true).
Example: (defattr analysis :experiment/analysis :map
{ao/schema :experiments
ao/identities #{:experiment/id}
::gto/source-file "summary.edn"})Subdirectory name within the bare repo for worktrees. Defaults to "worktrees".
Subdirectory name within the bare repo for worktrees. Defaults to "worktrees".
Boolean. If true, this repo uses worktrees for concurrent branch access. Requires ::bare? true. Worktree directory is created inside the repo.
Boolean. If true, this repo uses worktrees for concurrent branch access. Requires ::bare? true. Worktree directory is created inside the repo.
Function (fn [entity-data] string) that serializes entity data for writing to disk. Defaults to pr-str (EDN serialization).
For raw text entities, use identity: {::gto/write-fn identity}
For custom formats: {::gto/write-fn (fn [m] (json/generate-string m))}
Function (fn [entity-data] string) that serializes entity data for writing to disk.
Defaults to pr-str (EDN serialization).
For raw text entities, use identity:
{::gto/write-fn identity}
For custom formats:
{::gto/write-fn (fn [m] (json/generate-string m))}cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |