Skip to main content

Swarmauri Git Vector Store

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_vectorstore_git

Swarmauri Vectorstore Git

A Swarmauri community vector store that indexes Git repositories for semantic retrieval over commits and git log style records.

Features

  • Index scopes:
    • head: commits reachable from HEAD
    • ref: commits reachable from a specific branch, tag, or revision
    • all_refs: commits reachable from every ref in the repository
  • Document kinds:
    • commit: normalized commit metadata and changed-path text
    • log: rendered git log --stat style text
  • Pure git CLI backend, so there is no hard dependency on pygit2
  • Convenience CLI with colored logs for ad hoc retrieval
  • Default CLI behavior targets the current repo (.) and indexes all refs via --ref all

Installation

pip install swarmauri_vectorstore_git

Usage

from swarmauri_standard.documents.Document import Document
from swarmauri_vectorstore_git import GitVectorStore

store = GitVectorStore(
    repo_path=".",
    scope="all_refs",
    document_kinds=("commit", "log"),
)

store.build_index()
results = store.retrieve("oauth token bug", top_k=3)

for document in results:
    print(document.metadata["oid"], document.metadata["kind"])
    print(document.content[:200])

CLI

gitvs query --query "memory leak fix" --top-k 5

To inspect both document kinds together and return machine-readable output:

gitvs --ref HEAD --document-kind commit --document-kind log query --query "mojibake plugin readme" --top-k 2 --json

Actual output captured against the swarmauri-sdk repository:

[
  {
    "id": "5fb843d09edc2be4e681d4cff73b11a677439588:commit",
    "metadata": {
      "oid": "5fb843d09edc2be4e681d4cff73b11a677439588",
      "kind": "commit",
      "scope": "head",
      "ref": null,
      "parents": [
        "0d29234100fd8bff6ace454cb5ede16d43550f20"
      ],
      "changed_paths": [
        "pkgs/plugins/EmbedXMP/README.md",
        "pkgs/plugins/example_plugin/README.md"
      ],
      "subject": "Fix mojibake in plugin README feature bullets",
      "author": {
        "name": "cobycloud",
        "email": "25079070+cobycloud@users.noreply.github.com",
        "time": "2026-05-03T01:51:22-05:00"
      },
      "committer": {
        "name": "cobycloud",
        "email": "25079070+cobycloud@users.noreply.github.com",
        "time": "2026-05-03T01:52:36-05:00"
      }
    },
    "content": "commit 5fb843d09edc2be4e681d4cff73b11a677439588\nscope head\nref HEAD\nsubject Fix mojibake in plugin README feature bullets\nauthor cobycloud <25079070+cobycloud@users.noreply.github.com>\ncommitter cobycloud <25079070+cobycloud@users.noreply.github.com>\nauthored_at 2026-05-03T01:51:22-05:00\ncommitted_at 2026-05-03T01:52:36-05:00\nparents 0d29234100fd8bff6ace454cb5ede16d43550f20\n\nmessage\nFix mojibake in plugin README feature bullets\n\nchanged_paths\npkgs/plugins/EmbedXMP/README.md\npkgs/plugins/example_plugin/README.md\n\ndiff_stats\npkgs/plugins/EmbedXMP/README.md       | 10 +++++-----\n pkgs/plugins/example_plugin/README.md |  8 ++++----\n 2 files changed, 9 insertions(+), 9 deletions(-)"
  },
  {
    "id": "5fb843d09edc2be4e681d4cff73b11a677439588:log",
    "metadata": {
      "oid": "5fb843d09edc2be4e681d4cff73b11a677439588",
      "kind": "log",
      "scope": "head",
      "ref": null,
      "subject": "Fix mojibake in plugin README feature bullets"
    },
    "content": "commit 5fb843d09edc2be4e681d4cff73b11a677439588\nAuthor:     cobycloud <25079070+cobycloud@users.noreply.github.com>\nAuthorDate: 2026-05-03T01:51:22-05:00\nCommit:     cobycloud <25079070+cobycloud@users.noreply.github.com>\nCommitDate: 2026-05-03T01:52:36-05:00\n\n    Fix mojibake in plugin README feature bullets\n\n pkgs/plugins/EmbedXMP/README.md       | 10 +++++-----\n pkgs/plugins/example_plugin/README.md |  8 ++++----\n 2 files changed, 9 insertions(+), 9 deletions(-)"
  }
]

To inspect a specific retrieved document:

gitvs --ref HEAD show --document-id 5fb843d09edc2be4e681d4cff73b11a677439588:commit

Actual output:

commit 5fb843d09edc2be4e681d4cff73b11a677439588
scope head
ref HEAD
subject Fix mojibake in plugin README feature bullets
author cobycloud <25079070+cobycloud@users.noreply.github.com>
committer cobycloud <25079070+cobycloud@users.noreply.github.com>
authored_at 2026-05-03T01:51:22-05:00
committed_at 2026-05-03T01:52:36-05:00
parents 0d29234100fd8bff6ace454cb5ede16d43550f20

message
Fix mojibake in plugin README feature bullets

changed_paths
pkgs/plugins/EmbedXMP/README.md
pkgs/plugins/example_plugin/README.md

diff_stats
pkgs/plugins/EmbedXMP/README.md       | 10 +++++-----
 pkgs/plugins/example_plugin/README.md |  8 ++++----
 2 files changed, 9 insertions(+), 9 deletions(-)

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

swarmauri_vectorstore_git-0.10.1.dev4.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file swarmauri_vectorstore_git-0.10.1.dev4.tar.gz.

File metadata

  • Download URL: swarmauri_vectorstore_git-0.10.1.dev4.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_vectorstore_git-0.10.1.dev4.tar.gz
Algorithm Hash digest
SHA256 189c9e6ec474e38e92baa3264eabdc8cedca0660bb38068bff310d6f88889796
MD5 95c6d7a9123d1ea345fbae1ff04bc2dd
BLAKE2b-256 c5f2403ec8c036abec46a7ea4c672537e31925455da41e4f4cb521f2ec9f0376

See more details on using hashes here.

File details

Details for the file swarmauri_vectorstore_git-0.10.1.dev4-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_vectorstore_git-0.10.1.dev4-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_vectorstore_git-0.10.1.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 3cfb1452191b33052775c34aa1161ea943b4b54bf048e6682fa6e5c7b1129e10
MD5 e474de06905d3851747743cd8aebf57b
BLAKE2b-256 afe79498bdd69d20339f3669487dd1a7781c6b80b6c781a942e64c07af693186

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page