Skip to main content

gigaevo-client

PyPI

Unified Python SDK for the GigaEvo ecosystem: persistent memory for CARL artifacts (chains, steps, agents, memory cards, agent skills) plus the GigaEvo Platform API surface.

mmar-carl is a required dependency and is installed automatically with the client.

Renamed in 0.3.0. The legacy distribution name gigaevo-memory is now a meta-package that depends on gigaevo-client. Existing from gigaevo_memory import ... call sites keep working through a shim that emits one DeprecationWarning per process. New projects should depend on gigaevo-client and import from gigaevo_client.

Installation

pip install gigaevo-client

Legacy installs (pip install gigaevo-memory) still work and transitively pull in gigaevo-client.

For vector or hybrid search with the default local embedding provider, also install sentence-transformers:

pip install gigaevo-memory sentence-transformers

If you are running against this repository's local Docker stack, bring the API up and apply migrations first:

make up
make migrate

The compose stack in this repository publishes the API at http://localhost:8002. MemoryClient() without an explicit base_url still defaults to http://localhost:8000, which is intended for a standalone local API process or an equivalent reverse-proxied endpoint.

Quick Start

Save and load a chain

from mmar_carl import ContextSearchConfig, LLMStepDescription, ReasoningChain
from gigaevo_memory import MemoryClient

chain = ReasoningChain(
    steps=[
        LLMStepDescription(
            number=1,
            title="Analyze text",
            aim="Summarize the input text",
            reasoning_questions="What is the main topic? What are the key points?",
            stage_action="Read the input and produce a concise summary",
            example_reasoning="The text is about X, with key points A, B, and C.",
        )
    ],
    max_workers=1,
    metadata={"name": "Simple Analysis Chain"},
    search_config=ContextSearchConfig(strategy="substring"),
)

with MemoryClient(base_url="http://localhost:8002") as client:
    ref = client.save_chain(
        chain=chain,
        name="simple_analysis_chain",
        tags=["demo", "analysis"],
    )

    loaded_chain = client.get_chain(ref.entity_id, channel="latest")
    loaded_chain_dict = client.get_chain_dict(ref.entity_id, channel="latest")
    versions = client.list_versions(ref.entity_id, entity_type="chain")

    print(ref.entity_id)
    print(len(loaded_chain.steps))
    print(loaded_chain_dict["metadata"]["name"])
    print([v.version_number for v in versions])

Save and search memory cards

from gigaevo_memory import MemoryClient, SearchType

memory_card = {
    "description": "Batch Processing Pattern",
    "explanation": "Use when work can be split into independent chunks.",
    "keywords": ["batch", "parallel", "etl"],
    "category": "pattern_optimization",
}

with MemoryClient(base_url="http://localhost:8002") as client:
    ref = client.save_memory_card(
        memory_card=memory_card,
        name="Batch Processing Pattern",
        tags=memory_card["keywords"],
        when_to_use=memory_card["explanation"],
    )

    card = client.get_memory_card(ref.entity_id)
    results = client.search(
        query="batch processing",
        search_type=SearchType.BM25,
        entity_type="memory_card",
        top_k=5,
    )

    print(card.description)
    print([item.description for item in results])

Retrieve and report IdeaL guidance

from gigaevo_client import GigaEvoClient

with GigaEvoClient(base_url="http://localhost:8002") as client:
    result = client.retrieve_for_evolution(
        namespace="t2rag-ideal",
        run_id="run-42",
        candidate_id="candidate-7",
        context={
            "task_description": "Answer questions from financial reports.",
            "focus": "The table header scale was ignored.",
        },
        k=3,
    )
    client.record_mutation_outcome(
        namespace="t2rag-ideal",
        run_id="run-42",
        candidate_id="candidate-7",
        delta=0.02,
        cited_idea_ids=[result.items[0].id] if result.items else [],
    )

Search APIs

The client exposes unified search for memory-card retrieval:

  • search(query, search_type=..., top_k=..., entity_type="memory_card") Unified BM25, vector, or hybrid search. Returns list[MemoryCardSpec].

Use unified search for memory-card retrieval:

The following examples use MemoryClient() without base_url, so they assume a standalone API on http://localhost:8000 unless you provide a different endpoint.

from gigaevo_memory import MemoryClient, SearchType

with MemoryClient() as client:
    bm25_hits = client.search(
        query="batch processing",
        search_type=SearchType.BM25,
        entity_type="memory_card",
    )

    hybrid_hits = client.search(
        query="performance optimization",
        search_type=SearchType.HYBRID,
        entity_type="memory_card",
        hybrid_weights=(0.3, 0.7),
    )

Batch search is also available for memory cards:

from gigaevo_memory import MemoryClient, SearchType

with MemoryClient() as client:
    results = client.batch_search(
        queries=["batch processing", "etl pipeline", "parallel execution"],
        search_type=SearchType.BM25,
        top_k=3,
    )

Vector and hybrid search requirements

Vector-capable search has two runtime requirements:

  • The client must be able to generate embeddings. By default this means installing sentence-transformers, or passing a custom embedding_provider.
  • The server must have vector search enabled. If the API is started with vector search disabled, vector and hybrid requests return 503.

Version management

The client includes helpers for versioned entities and channel management:

from gigaevo_memory import MemoryClient

with MemoryClient() as client:
    entity_id = "your-chain-id"
    version_id = "your-version-id"
    from_version = "older-version-id"
    to_version = "newer-version-id"

    versions = client.list_versions(entity_id, entity_type="chain")
    detail = client.get_version(entity_id, version_id, entity_type="chain")
    diff = client.diff_versions(entity_id, from_version, to_version, entity_type="chain")
    client.pin_channel(entity_id, channel="stable", version_id=version_id, entity_type="chain")
    client.promote(entity_id, from_channel="latest", to_channel="stable", entity_type="chain")

Watching for updates

Use watch_chain() to subscribe to SSE updates for a chain:

from gigaevo_memory import MemoryClient

with MemoryClient() as client:
    entity_id = "your-chain-id"

    sub = client.watch_chain(
        entity_id,
        callback=lambda new_chain: print(f"Chain updated: {len(new_chain.steps)} steps"),
    )

    # ... later ...
    sub.stop()

Cache policies

from gigaevo_memory import CachePolicy, MemoryClient

# TTL-based cache (default: 300 seconds)
client = MemoryClient(cache_policy=CachePolicy.TTL, cache_ttl=300)

# Conditional GET using ETag when a cached entry exists
client = MemoryClient(cache_policy=CachePolicy.FRESHNESS_CHECK)

CachePolicy.SSE_PUSH exists as a cache policy enum, but normal entity reads do not automatically attach an SSE listener. For push-style updates today, use watch_chain() explicitly.

Development

make client-install
make client-test
make client-lint
make client-build

Examples

Runnable example scripts live in examples/:

  • upload_chain.py
  • download_chain.py
  • update_chain.py
  • run_chain.py
  • upload_memory_card.py
  • memory_cards_demo.py

Metadata

Release files for gigaevo-client 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gigaevo-client 0.4.0
File Size Uploaded Provenance Actions
gigaevo_client-0.4.0.tar.gz 53.4 kB Without provenance Details for gigaevo_client-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gigaevo-client 0.4.0
File Interpreter ABI Platform Actions
gigaevo_client-0.4.0-py3-none-any.whl Python 3 none any Details for gigaevo_client-0.4.0-py3-none-any.whl

Total release size: 119.4 kB

Release files / gigaevo_client-0.4.0.tar.gz

Download URL gigaevo_client-0.4.0.tar.gz
Size 53.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c551917f91bdac3a26158328673881f60f57effa23ff959f350b754424c9251c
BLAKE2b-256 checksum
How to use checksums
54d907ef01415983c2226bfcf51bd9d410bbecf09a97b786921354599d9ba181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / gigaevo_client-0.4.0-py3-none-any.whl

Download URL gigaevo_client-0.4.0-py3-none-any.whl
Size 66.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dcd0a50707cad3726b1818cf701efeffc952fcf8fe18681bf33dc2ae19614b74
BLAKE2b-256 checksum
How to use checksums
54cbe5b49e106d48874a028b738a92b02031998987e1b10e1a02c7bc2840de40
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for gigaevo-client 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page