ReflexioDeveloper Docs
Menu
All

Unified Search

Search across all entity types in a single call.

Unified Search

Search across all entity types (profiles, agent_playbooks, user_playbooks) in a single call. The server runs query reformulation and searches all entity types in parallel.

When an agent playbook is returned, user_playbooks omits source user playbooks already represented by that agent playbook. The server does not refill suppressed user playbooks, so user_playbooks may contain fewer than top_k items.

response = client.search(
    query="user preferences",
    top_k=5,
    threshold=0.45
)
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/search" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "query": "user preferences",
  "top_k": 5,
  "threshold": 0.45
}
JSON

Prop

Type

Example:

# Basic unified search
response = client.search(query="response quality issues")

print(f"Profiles: {len(response.profiles)}")
print(f"Agent Playbooks: {len(response.agent_playbooks)}")
print(f"User Playbooks: {len(response.user_playbooks)}")
if response.reformulated_query:
    print(f"Reformulated query: {response.reformulated_query}")

for profile in response.profiles:
    print(f"  Profile: {profile.content[:80]}...")

for playbook in response.agent_playbooks:
    print(f"  Playbook: {playbook.content[:80]}...")

# Search with filters
response = client.search(
    query="handling edge cases",
    agent_version="v2.1.0",
    top_k=10,
    threshold=0.4
)

# Search filtered by user
response = client.search(
    query="product preferences",
    user_id="user_123",
    top_k=5
)
curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/search" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "query": "response quality issues"
}
JSON

curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/search" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "query": "handling edge cases",
  "agent_version": "v2.1.0",
  "top_k": 10,
  "threshold": 0.4
}
JSON

curl -X POST "${REFLEXIO_URL:-https://www.reflexio.ai}/api/search" \
  -H "User-Agent: my-agent-reflexio" \
  -H "Authorization: Bearer $REFLEXIO_API_KEY" \
  -H "Content-Type: application/json" \
  --data @- <<'JSON'
{
  "query": "product preferences",
  "user_id": "user_123",
  "top_k": 5
}
JSON