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.dev3.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.dev3.tar.gz.

File metadata

  • Download URL: swarmauri_vectorstore_git-0.10.1.dev3.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.dev3.tar.gz
Algorithm Hash digest
SHA256 a2e4a80fff897e1260eefb3b3587dc591f480c55f4ccdd91fd1bca27cc276f21
MD5 6244e732cc00f2c1438a6baef0666309
BLAKE2b-256 66c3ddd11fab6f224f8f8be1f79d2b5e0ec6b7d540e522f43e9889ea56abcd2e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: swarmauri_vectorstore_git-0.10.1.dev3-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.dev3-py3-none-any.whl
Algorithm Hash digest
SHA256 7506fa4c6f25868d8f8673b154da76b5ace37c50f1028d7ffa875c0f035ac10c
MD5 c822b22e0bcfd3b673b1979bcac88e00
BLAKE2b-256 c3386c8295d5b8bb3be0b3590ca2963fcf482081b68bab5a1cdcca419b379055

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