Skip to main content

In-process SDK runtime for agent-search

Project description

agent-search core SDK

In-process Python SDK for agent-search. This package lets you call the runtime directly inside your own app.

The SDK always requires both:

  • A chat model (e.g. langchain_openai.ChatOpenAI)
  • A vector store that implements similarity_search(query, k, filter=None)

It does not auto-build these dependencies for you.

Install (PyPI)

python3.11 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install agent-search-core
python -c "import agent_search; print(agent_search.__file__)"

Quick start

from langchain_openai import ChatOpenAI
from agent_search import advanced_rag, build_langfuse_callback
from agent_search.vectorstore.langchain_adapter import LangChainVectorStoreAdapter

vector_store = LangChainVectorStoreAdapter(your_langchain_vector_store)
model = ChatOpenAI(model="gpt-4.1-mini", temperature=0.0)
langfuse_callback = build_langfuse_callback(sampling_key="customer-123")

response = advanced_rag(
    "What is pgvector?",
    vector_store=vector_store,
    model=model,
    langfuse_callback=langfuse_callback,
)
print(response.output)

Requirements

  • Python >=3.11,<3.14
  • A compatible vector store and chat model as shown above.

Build

cd sdk/core
python -m build

Runtime API surface

Primary functions exposed by agent_search:

  • advanced_rag
  • build_langfuse_callback
  • run
  • run_async
  • get_run_status
  • cancel_run

run(...) remains available as a compatibility alias and delegates to advanced_rag(...).

Tracing behavior for advanced_rag(...):

  • If you pass langfuse_callback=..., SDK uses that callback for run tracing.
  • Or pass langfuse_settings={...} and SDK builds the callback from that config.
  • If both are omitted, SDK does not trace the run.

Config-driven tracing example:

response = advanced_rag(
    "What is pgvector?",
    vector_store=vector_store,
    model=model,
    langfuse_settings={
        "enabled": True,
        "public_key": "...",
        "secret_key": "...",
        "host": "https://cloud.langfuse.com",
        "environment": "production",
        "release": "agent-search-core-0.1.8",
        "runtime_sample_rate": 1.0,
    },
)

advanced_rag(...) output schema:

RuntimeAgentRunResponse(
  main_question: str,
  sub_qa: list[SubQuestionAnswer],
  output: str,
  final_citations: list[CitationSourceRow],
)

Config and errors exposed by agent_search:

  • RuntimeConfig, RuntimeTimeoutConfig, RuntimeRetrievalConfig, RuntimeRerankConfig
  • SDKError, SDKConfigurationError, SDKRetrievalError, SDKModelError, SDKTimeoutError

Vector store compatibility

Runtime SDK expects similarity_search(query, k, filter=None). For LangChain-backed stores, use:

  • agent_search.vectorstore.langchain_adapter.LangChainVectorStoreAdapter

Notes

  • For the full app (API, DB, UI), run this repo with Docker Compose.
  • For SDK-only use, install from PyPI and supply your own model + vector store.

Release guidance

Use the repository release script from project root:

./scripts/release_sdk.sh

The release script verifies the built wheel includes the agent_search package before upload.

Publish flow (requires TWINE_API_TOKEN):

PUBLISH=1 TWINE_API_TOKEN=*** ./scripts/release_sdk.sh

Tag format used by CI release workflow:

  • agent-search-core-v<version>

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

agent_search_core-0.1.8.tar.gz (71.7 kB view details)

Uploaded Source

Built Distribution

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

agent_search_core-0.1.8-py3-none-any.whl (98.0 kB view details)

Uploaded Python 3

File details

Details for the file agent_search_core-0.1.8.tar.gz.

File metadata

  • Download URL: agent_search_core-0.1.8.tar.gz
  • Upload date:
  • Size: 71.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for agent_search_core-0.1.8.tar.gz
Algorithm Hash digest
SHA256 42158b166e2928227eefd26bf6b936558aa67f39f17477976f815ef70662502a
MD5 2f5d16b18ae8848101ebb691b26491cb
BLAKE2b-256 a3e8744dc5508e1f9181fc3fe02cf89f0ca00a554ca68a2285d7e0dd501392ef

See more details on using hashes here.

File details

Details for the file agent_search_core-0.1.8-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_search_core-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9b854c8c4f6d66a88c07e1162bf1f885fe06593d6b06980ca05b7319b45415ca
MD5 aa6347ff02b756af85b1c457436b865f
BLAKE2b-256 b778506c5aa5b60c514046784e8f1fb5b66d063469c7a6c22a21bb38b93ddbcf

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