In-process SDK runtime for agent-search with optional callback-driven Langfuse tracing
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 langfuse.langchain import CallbackHandler
from agent_search import advanced_rag
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 = CallbackHandler(
public_key="...",
secret_key="...",
host="https://cloud.langfuse.com",
)
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_ragbuild_langfuse_callbackrunrun_asyncresume_runget_run_statuscancel_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. - If
langfuse_callbackis omitted, SDK does not trace the run. langfuse_settingsis deprecated and ignored byadvanced_rag(...); pass an explicit callback instead.
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,RuntimeRerankConfigRAGStateSDKError,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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_search_core-1.0.0.tar.gz.
File metadata
- Download URL: agent_search_core-1.0.0.tar.gz
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99303dc379d2186ff4cdfd22bbdd1e6dfacbfe306e6733803307940c97523381
|
|
| MD5 |
c4558a33387879474f238d4c88ed9436
|
|
| BLAKE2b-256 |
11ecf83d054cbe12afb4af0ab9ad625907462121d9eaaa083adf2e54da51d3ea
|
File details
Details for the file agent_search_core-1.0.0-py3-none-any.whl.
File metadata
- Download URL: agent_search_core-1.0.0-py3-none-any.whl
- Upload date:
- Size: 90.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
007fe24e89e51cd66cf98af442d7a4d69646fe5f22fd53f72d24416b4e982219
|
|
| MD5 |
045f97ea4aa88df2a65cb2fb24418da4
|
|
| BLAKE2b-256 |
feb12a2299bc2d4971d1f5bc39eb4649e1b44134def2ca9822d246351071fff6
|