Vector RAG Agent
Vector RAG Agent
Guide 7 showed how to store documents in a
KnowledgeBase and query them with similarity / fulltext / hybrid
search. Guide 6 introduced the agent loop. This guide combines
the two: a Vector RAG Agent is an agent whose tool set is
pre-wired for retrieval, so the agent itself decides whether to
search, what table to search, and how to phrase the query.
Why Make Retrieval Agentic?
A textbook RAG pipeline is a fixed three-step program:
- Embed the user's question.
- Run a single similarity search.
- Stuff the top-k results into a final prompt.
That works when retrieval is always needed, the right phrasing is the user's question, and a single round of results is enough. It struggles when:
- The user asks something the model already knows ("what day is today?") — the retrieval step is pure overhead.
- The user's phrasing doesn't match the corpus phrasing ("PTO policy" vs "vacation days") — one search misses; a reformulation might land.
- One topic is enough; another needs two searches against different tables.
An agent moves those decisions inside the loop. The model sees the question, decides whether to retrieve, picks the table, writes a query in its own words, reads the results, and may search again before answering.
graph TD
A["User question"] --> B["VectorRAGAgent"]
B --> C{"Retrieval needed?"}
C -->|"no"| H["Final answer"]
C -->|"yes"| D["search_knowledge_base"]
D --> E["Top-k hits"]
E --> F{"Enough info?"}
F -->|"yes"| H
F -->|"no, refine"| D
F -->|"need a record's full body"| G["get_record_by_id"]
G --> H
The Three Tools
synalinks.VectorRAGAgent wraps a FunctionCallingAgent and
pre-wires three retrieval tools bound to a KnowledgeBase:
| Tool | Purpose |
|---|---|
get_knowledge_base_schema() |
List every table with its columns and descriptions. Used once to learn what's available. |
search_knowledge_base(table_name, query) |
Run the configured search (similarity / fulltext / hybrid_fts) against one table and return up to k hits. k is fixed per-agent at construction; the LM doesn't choose it per-call. |
get_record_by_id(table_name, record_id) |
After a search returns ids, fetch a full record. Useful when search snippets truncate long fields. |
The three tools cover the natural shape of retrieval: what tables exist → search one of them → optionally read a record in full.
Picking a Search Mode
search_type is a per-agent setting (the LM doesn't choose). It
shapes both the dispatch behaviour and the default instructions the
LM receives (so it phrases queries the right way).
search_type |
What it does | Use when |
|---|---|---|
"similarity" |
Pure vector search over embeddings. Requires an embedding model. | The corpus and the question use different words for the same concept (paraphrase-heavy). |
"fulltext" |
BM25 keyword search. No embedding model needed. | The words in the question are likely to appear verbatim in the documents (technical terms, named entities). |
"hybrid_fts" (default) |
Vector + BM25 fused with Reciprocal Rank Fusion (RRF). Requires an embedding model. | You don't want to choose — RRF combines both signals and is the safest default. |
For each mode, the agent's default instructions tell the LM how to phrase its queries: natural-language paraphrases for similarity, keyword-rich strings for fulltext, both for hybrid.
Output Format
Search results are returned as CSV by default (output_format="csv"),
which is dramatically more token-efficient than JSON for tabular
hits — no key names repeated per row. The LM reads CSV well, and on
modern providers it parses faster too. Switch to "json" if you
need list-of-dicts results for downstream code, but for purely
LM-facing flows CSV is the better default.
Building the Agent
The constructor signature mirrors FunctionCallingAgent exactly —
every parameter on that class is accepted with identical semantics.
The additions are retrieval-specific:
| Param | Required | Default | Notes |
|---|---|---|---|
knowledge_base |
yes | — | The KnowledgeBase to retrieve from. |
search_type |
no | "hybrid_fts" |
"similarity", "fulltext", or "hybrid_fts". |
k |
no | 5 |
Top-k for searches. Fixed per-agent — not exposed to the LM. |
similarity_threshold |
no | None |
Max vector distance for similarity / hybrid modes. |
fulltext_threshold |
no | None |
Min BM25 score for fulltext / hybrid modes. |
output_format |
no | "csv" |
"csv" (compact) or "json" (list of dicts). |
tools |
no | None |
Extra Tool instances or async functions to append to the three built-ins. Same name-collision and no-leading-underscore rules as FunctionCallingAgent. |
import synalinks
embedding_model = synalinks.EmbeddingModel(
model="gemini/gemini-embedding-001",
)
kb = synalinks.KnowledgeBase(
uri="duckdb://docs.db",
data_models=[Document],
embedding_model=embedding_model,
)
# ... populate kb ...
lm = synalinks.LanguageModel(model="ollama/qwen3:8b")
inputs = synalinks.Input(data_model=synalinks.ChatMessages)
outputs = await synalinks.VectorRAGAgent(
knowledge_base=kb,
language_model=lm,
)(inputs)
agent = synalinks.Program(inputs=inputs, outputs=outputs)
Note: "similarity" and "hybrid_fts" modes need the knowledge
base to have an embedding_model set. "fulltext" works without
one.
Layering Extra Tools
The tools= slot lets you append non-retrieval tools to the built-
in three. Useful when the answer mixes retrieved text with another
capability:
@synalinks.saving.register_synalinks_serializable()
async def calculate(expression: str):
"""Evaluate an arithmetic expression.
Args:
expression (str): A safe expression like '100 * 0.85'.
"""
return {"result": eval(expression, {"__builtins__": {}}, {})}
agent_module = synalinks.VectorRAGAgent(
knowledge_base=kb,
language_model=lm,
tools=[synalinks.Tool(calculate)],
)
Now the LM can retrieve a pricing policy from the kb and then compute a discount in the same turn.
A Worked Example
A small end-to-end task: a kb of HR / pricing policies, and the agent answers a question that needs both retrieval and arithmetic.
result = await agent(synalinks.ChatMessages(messages=[synalinks.ChatMessage(
role="user",
content=(
"If I have 100 users on the Enterprise plan, what would the "
"per-user monthly cost be after the volume discount?"
),
)]))
What the agent typically does:
search_knowledge_base("Document", "enterprise plan pricing volume discount")— pulls the pricing-policy document.- The LM reads the discount tiers from the snippet.
calculate("99 * (1 - 0.15)")— applies the 15% discount.- Stops, produces the final natural-language answer.
If the first search doesn't return what the LM expected, it reformulates and searches again. Multiple search rounds are normal when the question's phrasing diverges from the corpus's.
Multi-Turn Conversations
VectorRAGAgent accepts ChatMessages as input and threads context
across turns. Each turn the agent sees the full conversation, so it
can ground a follow-up against retrieval from a previous turn
without re-asking:
messages = []
for user_msg in [
"What's the daily meal allowance?",
"What about international?",
"I'm going for 3 days — what's my total budget?",
]:
messages.append(synalinks.ChatMessage(role="user", content=user_msg))
chat = synalinks.ChatMessages(messages=messages)
result = await agent(chat)
last = next(m for m in reversed(result.get("messages", []))
if m.get("role") == "assistant" and m.get("content"))
print("Agent:", last["content"])
messages.append(synalinks.ChatMessage(role="assistant", content=last["content"]))
Compared to Other Agents
VectorRAGAgent is one of several specialized agents that wrap a
FunctionCallingAgent with a workload-specific tool set:
| Agent | Bound to | Tools |
|---|---|---|
FunctionCallingAgent |
nothing | whatever you pass in |
SQLAgent |
a KnowledgeBase |
schema discovery, table sample, read-only SQL |
VectorRAGAgent |
a KnowledgeBase |
schema discovery, similarity / fulltext / hybrid search, get-by-id |
DeepAgent |
a workdir | list, search, read, write, edit, bash |
When to pick VectorRAGAgent over SQLAgent: the data is text
(unstructured documents), and the question is "find me what's
relevant to X" rather than "compute Y from rows of Z". When the
data is structured (typed columns) and the answer needs joins or
aggregations, reach for SQLAgent.
You can also use both — give an agent a KnowledgeBase with both
document tables and structured tables, layer SQL tools on top of
retrieval, and let the LM mix them. But for a single workload, the
specialized agent is the simpler call.
API References
Document
Bases: DataModel
A document in the knowledge base.
Source code in guides/24_vector_rag_agent.py
Source
import asyncio
import os
from dotenv import load_dotenv
import synalinks
class Document(synalinks.DataModel):
"""A document in the knowledge base."""
id: str = synalinks.Field(description="Document id")
title: str = synalinks.Field(description="Document title")
content: str = synalinks.Field(description="Body text")
SAMPLE_DOCUMENTS = [
Document(
id="pricing-enterprise",
title="Enterprise Plan Pricing",
content=(
"Enterprise Plan: $99/user/month billed annually. "
"Volume discounts: 10% off at 50 users, 15% off at 100, "
"20% off at 250."
),
),
Document(
id="policy-pto",
title="PTO Policy",
content=(
"Full-time employees receive 20 days of PTO per year. "
"PTO accrues monthly. Up to 5 unused days carry over."
),
),
Document(
id="policy-remote",
title="Remote Work Policy",
content=(
"Employees may work remotely up to 3 days per week with "
"manager approval. Core hours are 10 AM to 4 PM."
),
),
]
async def main():
load_dotenv()
synalinks.clear_session()
synalinks.enable_logging()
db_path = "./guides/vector_rag_agent_guide.db"
if os.path.exists(db_path):
os.remove(db_path)
# Build a kb with an embedding model so hybrid_fts can use both
# vector and BM25 signals.
embedding_model = synalinks.EmbeddingModel(model="ollama/all-minilm")
kb = synalinks.KnowledgeBase(
uri=f"duckdb://{db_path}",
data_models=[Document],
embedding_model=embedding_model,
wipe_on_start=True,
name="vector_rag_agent_guide_kb",
)
for doc in SAMPLE_DOCUMENTS:
await kb.update(doc.to_json_data_model())
language_model = synalinks.LanguageModel(model="ollama/qwen3:8b")
# Build the agent with the default hybrid_fts mode.
inputs = synalinks.Input(data_model=synalinks.ChatMessages)
outputs = await synalinks.VectorRAGAgent(
knowledge_base=kb,
language_model=language_model,
max_iterations=5,
)(inputs)
agent = synalinks.Program(
inputs=inputs,
outputs=outputs,
name="vector_rag_agent",
description="A RAG agent that retrieves and answers from documents.",
)
agent.summary()
# Ask a question that needs retrieval to answer correctly.
question = synalinks.ChatMessages(
messages=[
synalinks.ChatMessage(
role="user",
content="How much PTO do employees get per year?",
)
]
)
result = await agent(question)
# Print the final assistant message.
for msg in reversed(result.get("messages", [])):
if msg.get("role") == "assistant" and msg.get("content"):
print("Agent:", msg["content"])
break
if os.path.exists(db_path):
os.remove(db_path)
if __name__ == "__main__":
asyncio.run(main())
Run log
This guide calls synalinks.enable_logging(), so a full run traces every
module call. The log below is the unedited output of running the guide
above with local models.
Full run log — guides/24_vector_rag_agent.log
[Synalinks]
Call ID: fcf43190-6be2-4346-b15f-09866fbcd6bb
Parent call ID: None
Module: EmbeddingModel
Module Name: embedding_model
Module Description: An embedding model API wrapper.
Data Model JSON:
[
{
"texts": [
"text"
]
}
]
[Synalinks]
Call ID: fcf43190-6be2-4346-b15f-09866fbcd6bb
Parent call ID: None
Module: EmbeddingModel
Module Name: embedding_model
Module Description: An embedding model API wrapper.
Data Model JSON:
[
{
"embeddings": [
[
0.014406116,
0.07229573,
-0.021876175,
0.027740449,
-0.03251832,
0.03888424,
0.1319465,
0.04010598,
0.11198866,
-0.041769926,
0.040217698,
0.057247553,
0.0146675445,
-0.002334725,
0.0007380931,
0.019140892,
0.07064506,
-0.04579297,
-0.08961318,
-0.053754628,
0.019031122,
0.07674004,
0.039529912,
0.04100713,
-0.0020742952,
0.12510292,
-0.10727385,
0.061986044,
0.04365164,
-0.040840823,
-0.04525787,
0.0371019,
0.14573455,
0.03463864,
-0.047589462,
0.009235457,
-0.02651027,
0.02711168,
-0.018421039,
0.0024982356,
-0.031192584,
-0.106831156,
0.004864878,
0.01774739,
0.073965676,
-0.025897507,
-0.042828448,
0.0135398945,
0.02492457,
0.059299383,
-0.036922053,
-0.054479085,
-0.05154828,
0.016499622,
-0.021070449,
0.0707667,
0.01749234,
0.023935992,
0.024605546,
-0.0038526754,
0.02859286,
0.022280814,
-0.011404247,
0.05783011,
0.049139034,
-0.011771873,
-0.025152836,
0.045904323,
-0.11562953,
-0.02614516,
0.020742306,
-0.0046797683,
0.03621985,
0.09517846,
0.020333804,
-0.04426105,
-0.015455081,
-0.07089221,
0.058572218,
0.035958823,
-0.023859536,
-0.021437867,
0.0652053,
0.083042055,
0.03524372,
0.0340632,
0.032135714,
0.020936085,
-0.041787416,
0.0014055886,
0.007270266,
-0.06301039,
0.09361906,
-0.008869727,
-0.1674413,
0.048815515,
-0.04945322,
-0.09477175,
-0.017634626,
0.21612743,
0.015374068,
-0.010392812,
0.030707335,
0.0073650377,
-0.05607692,
-0.050809745,
0.05483729,
-0.025875594,
0.017361498,
-0.055447005,
0.020476695,
-0.073248886,
-0.12031971,
-0.051998142,
-0.021595396,
-0.08747401,
0.0074480646,
-0.030567272,
0.06650195,
0.043448735,
-0.045205012,
-0.037187263,
-0.063432015,
0.0072106575,
-0.063673906,
-0.056259274,
0.06510728,
-4.2508385e-33,
0.026087064,
-0.0012187179,
0.040757008,
0.09780552,
-0.01570776,
0.05542479,
-0.08448012,
-0.06108573,
-0.024512516,
-0.0018263763,
0.011344801,
-0.03576629,
-0.0045521352,
-0.0010065942,
0.07128947,
-0.07244958,
-0.034431733,
0.048277367,
0.025698744,
-0.03522279,
-0.05667654,
0.03272864,
0.04733542,
-0.0007333341,
-0.011502311,
0.019044682,
0.0037171557,
-0.06632106,
-0.02733565,
-0.0037851313,
-0.032163806,
0.008516921,
0.084225446,
-0.055177983,
-0.022827463,
0.022622155,
-0.0042970157,
-0.057015114,
0.041982498,
0.00029094465,
-0.034039073,
-0.0065367105,
0.03176329,
-0.09948356,
0.0035334001,
0.07505794,
0.0025601347,
0.0063530984,
-0.06944066,
-0.027398806,
0.010958682,
0.034126434,
-0.008230103,
-0.01295975,
0.041848753,
-0.017475285,
0.002923501,
0.0071249604,
-0.017464058,
0.04829933,
0.03336579,
0.051213026,
0.04170822,
0.00564903,
0.0064393175,
-0.038031034,
-0.038734984,
-0.08940118,
0.070569746,
-0.049796116,
-0.09790174,
-0.038917143,
0.004501107,
0.00018383915,
-0.056472115,
0.027264323,
-0.0039730035,
-0.021773769,
-0.04412174,
0.024094084,
-0.04118564,
-0.11032491,
0.04202433,
-0.010539565,
0.013168787,
-0.00038373278,
0.026207933,
-0.17191385,
0.024271822,
0.02399029,
-0.09138078,
-0.012214031,
-0.021403307,
-0.012108587,
0.047185082,
3.3519328e-33,
-0.020722514,
-0.020239227,
-0.085516095,
0.06684201,
0.03659499,
0.068083264,
0.051557094,
0.069862165,
0.036801387,
0.00061966863,
0.010218854,
0.06078521,
0.020580374,
-0.034688853,
-0.018589383,
0.03219792,
0.11753492,
0.033736866,
0.009101076,
0.009911077,
-0.079862095,
-0.07961568,
-0.09189634,
-0.013897216,
0.00963438,
0.026997568,
0.03674982,
0.0005409538,
-0.025250142,
-0.004609075,
-0.005039438,
-0.041050643,
0.037324157,
0.0477516,
-0.04685448,
0.039089955,
0.08060342,
-0.018475085,
-0.0583313,
0.043158233,
0.15925314,
0.024767159,
0.008286801,
0.06519889,
-0.049940612,
0.009208594,
-0.12152326,
-0.03747506,
0.027621953,
0.054581456,
0.010334051,
-0.036141258,
-0.02480936,
-0.091686495,
-0.093687095,
-0.032043226,
-0.041110773,
0.013693507,
0.0018785266,
-0.025998915,
-0.05466682,
0.0044958014,
-0.023842204,
0.0368453,
0.0493135,
-0.050591376,
-0.027658297,
0.0068221283,
-0.060855024,
0.002409423,
0.083179034,
-0.02835793,
-0.05976815,
0.008503926,
-0.01565034,
0.007607763,
-0.032602414,
0.02400566,
-0.11613434,
-0.032230344,
0.10856419,
0.024128878,
-0.03988163,
0.09215854,
0.031295,
0.035242062,
-0.03396963,
-0.01858857,
-0.009887885,
-0.009365501,
-0.0085985605,
0.056675747,
0.006079944,
0.060889103,
-0.0576706,
-1.1630864e-8,
-0.006679613,
-0.08317517,
-0.040941663,
-0.011146898,
0.00013351985,
0.047622744,
0.033236183,
-0.04214696,
-0.014344519,
-0.025341982,
0.015469645,
-0.011114907,
-0.049808007,
-0.035167903,
0.04607065,
0.0052523506,
0.0082305325,
-0.026163988,
0.009086706,
0.00353762,
0.070797004,
0.044026963,
-0.036164872,
0.029818872,
-0.040995724,
0.028787557,
-0.019420875,
0.080384314,
0.016984886,
0.0059752017,
0.09571893,
0.032191027,
0.00032898353,
-0.0068488275,
0.038783666,
-0.030905334,
0.05720685,
-0.0357502,
0.052814186,
0.04241418,
0.046766154,
0.032292455,
-0.03313094,
-0.043708295,
0.022648387,
-0.0008736377,
0.03185666,
-0.11952025,
-0.01928425,
-0.04032481,
-0.0029067774,
0.019504933,
0.042029947,
0.04263164,
0.019137733,
-0.03276784,
0.101011366,
0.063358195,
-0.06101046,
0.04489093,
0.10000594,
0.0698285,
0.039636046,
-0.029267678
]
]
}
]
(DEBUG) [Synalinks]
Call ID: e7c72f13-584a-47b4-9fbd-b98c45e949a0
Parent call ID: None
Module: VectorRAGAgent
Module Name: vector_rag_agent
Module Description: A ready-to-use retrieval-augmented agent backed by a knowledge base.
Data Model JSON Schema:
[
{
"$defs": {
"ChatMessage": {
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A list of chat messages",
"properties": {
"messages": {
"default": [],
"description": "The list of chat messages",
"items": {
"$ref": "#/$defs/ChatMessage"
},
"title": "Messages",
"type": "array"
}
},
"title": "ChatMessages",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: 5d7dc55d-18fe-411f-8d41-cac0600ec019
Parent call ID: e7c72f13-584a-47b4-9fbd-b98c45e949a0
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatMessage": {
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A list of chat messages",
"properties": {
"messages": {
"default": [],
"description": "The list of chat messages",
"items": {
"$ref": "#/$defs/ChatMessage"
},
"title": "Messages",
"type": "array"
}
},
"title": "ChatMessages",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: 5d7dc55d-18fe-411f-8d41-cac0600ec019
Parent call ID: e7c72f13-584a-47b4-9fbd-b98c45e949a0
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: 608f36e2-6b01-4340-916f-004cebf91d5d
Parent call ID: 5d7dc55d-18fe-411f-8d41-cac0600ec019
Module: Generator
Module Name: final_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatMessage": {
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A list of chat messages",
"properties": {
"messages": {
"default": [],
"description": "The list of chat messages",
"items": {
"$ref": "#/$defs/ChatMessage"
},
"title": "Messages",
"type": "array"
}
},
"title": "ChatMessages",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: 608f36e2-6b01-4340-916f-004cebf91d5d
Parent call ID: 5d7dc55d-18fe-411f-8d41-cac0600ec019
Module: Generator
Module Name: final_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: f632e6c2-cfe4-49dd-aeb4-a8999c413f85
Parent call ID: 608f36e2-6b01-4340-916f-004cebf91d5d
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatMessage": {
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A list of chat messages",
"properties": {
"messages": {
"default": [],
"description": "The list of chat messages",
"items": {
"$ref": "#/$defs/ChatMessage"
},
"title": "Messages",
"type": "array"
}
},
"title": "ChatMessages",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: f632e6c2-cfe4-49dd-aeb4-a8999c413f85
Parent call ID: 608f36e2-6b01-4340-916f-004cebf91d5d
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: 097c820c-f68e-443a-b0f7-cfaa30dad63f
Parent call ID: f632e6c2-cfe4-49dd-aeb4-a8999c413f85
Module: Generator
Module Name: final_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatMessage": {
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A list of chat messages",
"properties": {
"messages": {
"default": [],
"description": "The list of chat messages",
"items": {
"$ref": "#/$defs/ChatMessage"
},
"title": "Messages",
"type": "array"
}
},
"title": "ChatMessages",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: 097c820c-f68e-443a-b0f7-cfaa30dad63f
Parent call ID: f632e6c2-cfe4-49dd-aeb4-a8999c413f85
Module: Generator
Module Name: final_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON Schema:
[
{
"$defs": {
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
}
]
(DEBUG) [Synalinks]
Call ID: e7c72f13-584a-47b4-9fbd-b98c45e949a0
Parent call ID: None
Module: VectorRAGAgent
Module Name: vector_rag_agent
Module Description: A ready-to-use retrieval-augmented agent backed by a knowledge base.
Data Model JSON Schema:
[
{
"$defs": {
"ChatMessage": {
"additionalProperties": false,
"description": "A chat message",
"properties": {
"role": {
"$ref": "#/$defs/ChatRole",
"description": "The chat message role"
},
"reasoning_content": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The reasoning/thinking content of the message. Keyed to match the litellm/DeepSeek `reasoning_content` chat-completion field (a provider extension, not part of the base OpenAI spec), so the message API stays a subset of the litellm-extended chat-completion message.",
"title": "Reasoning Content"
},
"thinking_blocks": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Opaque provider-native thinking blocks (e.g. Anthropic's signed `thinking_blocks`; a litellm extension, not part of the base OpenAI spec). Carried through verbatim on assistant-message re-injection so multi-turn tool-use round-trips preserve signatures. None for providers that emit reasoning only as text.",
"title": "Thinking Blocks"
},
"content": {
"anyOf": [
{
"type": "string"
},
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"additionalProperties": true,
"type": "object"
},
{
"type": "null"
}
],
"default": null,
"description": "The content of the message",
"title": "Content"
},
"tool_call_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "The id of the tool call if role is `tool`",
"title": "Tool Call Id"
},
"tool_calls": {
"anyOf": [
{
"items": {
"$ref": "#/$defs/ToolCall"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The tool calls of the agent",
"title": "Tool Calls"
}
},
"required": [
"role"
],
"title": "ChatMessage",
"type": "object"
},
"ChatRole": {
"description": "The chat message roles",
"enum": [
"system",
"developer",
"user",
"assistant",
"tool",
"function"
],
"title": "ChatRole",
"type": "string"
},
"ToolCall": {
"additionalProperties": false,
"description": "A tool call, shaped like an OpenAI Chat Completions tool call.\n\nMirrors the wire envelope (`{id, type, function: {name, arguments}}`)\nexcept that `arguments` stays a parsed dict rather than a JSON-encoded\nstring, so modules and agents can read it directly. The string encoding\nis applied only at the wire edge (see `backend.pydantic.chat_completions`).",
"properties": {
"id": {
"description": "The id of the tool call",
"title": "Id",
"type": "string"
},
"type": {
"const": "function",
"default": "function",
"description": "The tool call type (always `function` today)",
"title": "Type",
"type": "string"
},
"function": {
"$ref": "#/$defs/ToolCallFunction",
"description": "The function invocation (name + arguments)"
}
},
"required": [
"id",
"function"
],
"title": "ToolCall",
"type": "object"
},
"ToolCallFunction": {
"additionalProperties": false,
"description": "The `function` payload of a tool call (name + parsed arguments).",
"properties": {
"name": {
"description": "The name of the function called",
"title": "Name",
"type": "string"
},
"arguments": {
"additionalProperties": true,
"description": "The arguments of the tool call",
"title": "Arguments",
"type": "object"
}
},
"required": [
"name",
"arguments"
],
"title": "ToolCallFunction",
"type": "object"
}
},
"additionalProperties": false,
"description": "A list of chat messages",
"properties": {
"messages": {
"default": [],
"description": "The list of chat messages",
"items": {
"$ref": "#/$defs/ChatMessage"
},
"title": "Messages",
"type": "array"
}
},
"title": "ChatMessages",
"type": "object"
}
]
Program: vector_rag_agent
description: 'A RAG agent that retrieves and answers from documents.'
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┓
┃ Module (type) ┃ Output Schema ┃ Vars # ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━┩
│ input_module (InputModule) │ ChatRole: Literal['system', │ 0 │
│ │ 'developer', 'user', │ │
│ │ 'assistant', 'tool', 'function'] │ │
│ │ │ │
│ │ ToolCallFunction: │ │
│ │ name: str │ │
│ │ arguments: dict │ │
│ │ │ │
│ │ ToolCall: │ │
│ │ id: str │ │
│ │ type: Literal['function'] = │ │
│ │ 'function' │ │
│ │ function: ToolCallFunction │ │
│ │ │ │
│ │ ChatMessage: │ │
│ │ role: ChatRole │ │
│ │ reasoning_content: str | None │ │
│ │ = None │ │
│ │ thinking_blocks: list | None = │ │
│ │ None │ │
│ │ content: str | list | dict | │ │
│ │ None = None │ │
│ │ tool_call_id: str | None = │ │
│ │ None │ │
│ │ tool_calls: list[ToolCall] | │ │
│ │ None = None │ │
│ │ │ │
│ │ ChatMessages: │ │
│ │ messages: list[ChatMessage] = │ │
│ │ [] │ │
├─────────────────────────────┼──────────────────────────────────┼─────────┤
│ vector_rag_agent │ ChatRole: Literal['system', │ 2 │
│ (VectorRAGAgent) │ 'developer', 'user', │ │
│ │ 'assistant', 'tool', 'function'] │ │
│ │ │ │
│ │ ToolCallFunction: │ │
│ │ name: str │ │
│ │ arguments: dict │ │
│ │ │ │
│ │ ToolCall: │ │
│ │ id: str │ │
│ │ type: Literal['function'] = │ │
│ │ 'function' │ │
│ │ function: ToolCallFunction │ │
│ │ │ │
│ │ ChatMessage: │ │
│ │ role: ChatRole │ │
│ │ reasoning_content: str | None │ │
│ │ = None │ │
│ │ thinking_blocks: list | None = │ │
│ │ None │ │
│ │ content: str | list | dict | │ │
│ │ None = None │ │
│ │ tool_call_id: str | None = │ │
│ │ None │ │
│ │ tool_calls: list[ToolCall] | │ │
│ │ None = None │ │
│ │ │ │
│ │ ChatMessages: │ │
│ │ messages: list[ChatMessage] = │ │
│ │ [] │ │
└─────────────────────────────┴──────────────────────────────────┴─────────┘
[Synalinks]
Call ID: b349f450-503c-44fe-b95e-3d6b83ba4bac
Parent call ID: None
Module: Functional
Module Name: vector_rag_agent
Module Description: A RAG agent that retrieves and answers from documents.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
}
]
}
]
[Synalinks]
Call ID: 84cdf3ab-d4ad-4635-8664-214b637aa194
Parent call ID: b349f450-503c-44fe-b95e-3d6b83ba4bac
Module: VectorRAGAgent
Module Name: vector_rag_agent
Module Description: A ready-to-use retrieval-augmented agent backed by a knowledge base.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
}
]
}
]
[Synalinks]
Call ID: 7b52cddc-bae5-47c4-b25f-7c03e4948997
Parent call ID: 84cdf3ab-d4ad-4635-8664-214b637aa194
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
}
]
}
]
[Synalinks]
Call ID: 66f9701e-853b-477f-9f50-ee3758557d6e
Parent call ID: 7b52cddc-bae5-47c4-b25f-7c03e4948997
Module: LanguageModel
Module Name: language_model
Module Description: A language model API wrapper.
Data Model JSON:
[
{
"messages": [
{
"role": "system",
"content": "<instructions>\nYou are a retrieval-augmented assistant with access to a knowledge base.\n\nAvailable tables: ['Document']\nSearch mode: hybrid_fts\n\nPlan:\n1. If you don't already know what's available, call `get_knowledge_base_schema`.\n2. Call `search_knowledge_base` with the table you want and a query.\n Use natural-language queries that contain the keywords you expect to appear in matching documents — the search fuses vector similarity and BM25 with Reciprocal Rank Fusion, so both signals contribute.\n3. If a search result references an id you want to inspect in full,\n call `get_record_by_id`.\n4. Once you have enough context, stop calling tools and answer.\n\nConstraints:\n- Only retrieve when the user's question actually needs grounded\n information. Trivial questions don't need a search.\n- Reformulate the user's question into focused queries; don't just pass\n the raw user text.\n- If a search returns nothing useful, retry with a different phrasing\n before giving up.\n</instructions>\n"
},
{
"role": "user",
"content": "How much PTO do employees get per year?"
}
]
}
]
[Synalinks]
Call ID: 66f9701e-853b-477f-9f50-ee3758557d6e
Parent call ID: 7b52cddc-bae5-47c4-b25f-7c03e4948997
Module: LanguageModel
Module Name: language_model
Module Description: A language model API wrapper.
Data Model JSON:
[
{
"role": "assistant",
"content": "",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
}
]
[Synalinks]
Call ID: 7b52cddc-bae5-47c4-b25f-7c03e4948997
Parent call ID: 84cdf3ab-d4ad-4635-8664-214b637aa194
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON:
[
{
"role": "assistant",
"content": "",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
}
]
[Synalinks]
Call ID: 50bd2808-2455-442a-b2ec-68933585baa1
Parent call ID: 66f9701e-853b-477f-9f50-ee3758557d6e
Module: Tool
Module Name: search_knowledge_base
Module Description: Search a table for records relevant to a query.
Keyword Arguments:
{
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
[Synalinks]
Call ID: 7b093022-ef51-4092-aa88-4dd0a8a86d08
Parent call ID: 50bd2808-2455-442a-b2ec-68933585baa1
Module: EmbeddingModel
Module Name: embedding_model
Module Description: An embedding model API wrapper.
Data Model JSON:
[
{
"texts": [
"PTO policy annual leave accrual"
]
}
]
[Synalinks]
Call ID: 7b093022-ef51-4092-aa88-4dd0a8a86d08
Parent call ID: 50bd2808-2455-442a-b2ec-68933585baa1
Module: EmbeddingModel
Module Name: embedding_model
Module Description: An embedding model API wrapper.
Data Model JSON:
[
{
"embeddings": [
[
0.009470511,
0.014364378,
0.032572355,
0.009872702,
0.031086247,
0.06276789,
0.057898775,
-0.056036115,
-0.06466349,
0.045237374,
0.051015593,
-0.05836737,
-0.04374533,
0.005870186,
-0.006916204,
0.034318876,
-0.009300978,
-0.0064986716,
0.05674489,
-0.044009764,
0.01124252,
-0.02184718,
-0.055483647,
0.026224973,
0.011204666,
0.014449278,
0.020926114,
0.05838608,
0.017401703,
0.07432331,
-0.040385686,
0.0037790178,
-0.02603171,
-0.06825162,
0.034095075,
0.005174776,
-0.06873193,
-0.051433522,
-0.0342354,
-0.020892171,
0.015309205,
0.017990563,
0.058344264,
-0.016629882,
0.026811237,
0.030318556,
0.024532711,
0.025267342,
-0.0074423915,
0.10919917,
0.060123242,
0.016524317,
0.009790829,
0.016884113,
-0.03993737,
0.014686613,
0.0726453,
-0.058895763,
-0.0316748,
-0.037606627,
-0.053462572,
-0.036518343,
-0.042588297,
0.0018966335,
0.04624123,
-0.008975065,
0.021179268,
-0.017546752,
-0.037325837,
0.00053469575,
-0.12981899,
0.009362649,
-0.03792177,
-0.048630893,
0.039161574,
0.051005956,
-0.0222571,
0.04106318,
0.053345952,
-0.12932743,
0.022564495,
0.07408403,
0.01976229,
-0.021048782,
-0.058418274,
-0.020466065,
0.031002142,
-0.033730865,
0.033464406,
0.042341415,
0.12951119,
0.08504193,
0.021692563,
-0.07597208,
-0.042089682,
-0.10990275,
-0.045578614,
-0.016220523,
0.013075723,
0.01941264,
0.008963146,
-0.0029466557,
-0.07780556,
0.0053228852,
0.000024615423,
-0.000084710206,
0.06698826,
-0.040270016,
0.058621693,
0.07105646,
-0.042155888,
0.072387435,
0.02441865,
-0.051795866,
0.0071803774,
0.04600566,
-0.08527978,
0.0019516503,
0.1378921,
-0.009632909,
0.054408334,
0.022897597,
-0.093841344,
0.06140091,
-0.03501632,
-0.041701082,
0.028738631,
6.486313e-34,
0.036375675,
0.02691685,
0.009746282,
-0.005532892,
0.087879874,
-0.04115202,
-0.027734617,
-0.06446659,
0.059374947,
-0.061126072,
-0.021130579,
0.02073858,
-0.023776542,
-0.08201851,
0.10005817,
-0.020387826,
0.011343261,
0.1496187,
0.07526501,
0.05204579,
0.06228333,
-0.011361757,
0.07025838,
0.07514232,
0.011219573,
0.1198596,
-0.070832774,
-0.04243808,
-0.1000107,
0.015919825,
0.046282243,
0.043614086,
0.040720407,
-0.04973896,
-0.0077351695,
-0.08766921,
-0.029158361,
0.033440065,
0.04793771,
-0.03416229,
-0.008549747,
-0.06376706,
0.009392846,
0.041201603,
-0.049472023,
-0.15364063,
0.06345165,
0.038141105,
0.009471406,
0.07858522,
0.0037816826,
-0.054539725,
-0.05553305,
-0.08783001,
0.004641993,
-0.06447723,
-0.07016067,
0.006984266,
0.07904315,
-0.09596188,
0.046310585,
0.11449282,
-0.0051427083,
0.03642785,
-0.11478857,
0.040813208,
-0.06860073,
-0.008904518,
0.089407675,
-0.00696888,
-0.02188072,
0.024006937,
-0.035874575,
0.012315227,
0.0079505155,
-0.000691869,
0.06524629,
0.011851524,
0.024812767,
0.0009597368,
-0.029710209,
0.065859646,
0.03703555,
-0.037149947,
0.09370394,
-0.015421491,
0.0552718,
0.025600687,
-0.003867849,
-0.013007309,
0.053045206,
-0.049962014,
-0.0016670558,
0.047095317,
0.057588123,
-2.4830395e-33,
0.03299179,
0.039685305,
0.056413747,
-0.13303302,
-0.055414688,
-0.040843803,
-0.03900813,
0.014583241,
0.07516114,
0.05763905,
-0.030532014,
-0.048485313,
0.039505046,
0.023126662,
-0.02516419,
-0.020768035,
0.040412046,
-0.038462173,
-0.058850493,
-0.017373255,
-0.027568974,
0.016813556,
0.07575849,
0.05204379,
0.014476409,
0.004797156,
-0.05518769,
-0.0033275667,
0.008397922,
0.03229173,
-0.07453164,
-0.07605611,
0.00094408676,
0.07575123,
0.059669606,
-0.093378104,
-0.057537146,
0.048816655,
-0.0067304294,
0.14269555,
0.08616227,
-0.07063735,
0.09629567,
-0.001893728,
-0.0007601826,
-0.031241123,
0.014029281,
0.00027790162,
-0.032973353,
-0.057679955,
0.037256766,
-0.058833912,
0.008572639,
-0.030758698,
-0.017342424,
0.059350908,
0.05806559,
-0.03970144,
-0.025712607,
-0.04413842,
0.037698306,
0.005703802,
-0.0153349005,
0.08407105,
0.050858542,
-0.044050254,
0.04468371,
-0.048404615,
-0.0061147986,
-0.05221535,
0.01613732,
-0.016566116,
-0.0043666204,
-0.035880674,
0.03990729,
0.044507798,
0.0053361575,
-0.015903294,
-0.03641636,
0.038923163,
-0.13309605,
0.084355436,
-0.04138445,
0.0009042854,
-0.028392473,
-0.07045583,
-0.01323704,
-0.05530539,
-0.011866965,
0.08609773,
0.045818504,
-0.048224088,
0.086824104,
-0.043022167,
-0.00037238258,
-1.7362742e-8,
0.03348127,
0.032280084,
0.082929626,
-0.013747872,
0.043943074,
-0.110413775,
0.0028350635,
-0.084331825,
0.025562327,
0.006062354,
0.06416756,
0.017159471,
0.036701422,
-0.06158189,
-0.06866704,
0.037880052,
-0.037231073,
0.01317036,
-0.022990013,
0.010870629,
-0.089606956,
-0.03829478,
-0.0353982,
-0.061095405,
-0.03631615,
0.015658522,
0.004037697,
0.02321459,
0.041175354,
-0.033452444,
0.020030735,
-0.020657545,
-0.038029745,
-0.048467703,
-0.05892779,
-0.032231655,
0.07596277,
-0.013655884,
-0.0073911264,
-0.061804704,
-0.022581102,
0.043951415,
0.031554427,
0.025670476,
-0.0310585,
0.00030828762,
-0.075208165,
-0.1054965,
-0.033376355,
-0.085935414,
0.046002403,
-0.01148139,
0.0063908533,
0.04390446,
-0.019048776,
-0.05789612,
0.00086500146,
0.01828124,
-0.10788188,
-0.014276331,
0.013807418,
0.020479992,
0.038598835,
-0.030707464
]
]
}
]
[Synalinks]
Call ID: 50bd2808-2455-442a-b2ec-68933585baa1
Parent call ID: 66f9701e-853b-477f-9f50-ee3758557d6e
Module: Tool
Module Name: search_knowledge_base
Module Description: Search a table for records relevant to a query.
Data Model JSON:
[
{
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
}
]
[Synalinks]
Call ID: f405d7e2-2b72-4583-99c2-fd139408ed5a
Parent call ID: 7b093022-ef51-4092-aa88-4dd0a8a86d08
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
},
{
"role": "assistant",
"content": "",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
},
{
"role": "tool",
"content": {
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
},
"tool_call_id": "call_s1a7xfam"
}
]
}
]
[Synalinks]
Call ID: c7ebcc4b-9178-459e-b440-189b4ffaf99f
Parent call ID: f405d7e2-2b72-4583-99c2-fd139408ed5a
Module: LanguageModel
Module Name: language_model
Module Description: A language model API wrapper.
Data Model JSON:
[
{
"messages": [
{
"role": "system",
"content": "<instructions>\nYou are a retrieval-augmented assistant with access to a knowledge base.\n\nAvailable tables: ['Document']\nSearch mode: hybrid_fts\n\nPlan:\n1. If you don't already know what's available, call `get_knowledge_base_schema`.\n2. Call `search_knowledge_base` with the table you want and a query.\n Use natural-language queries that contain the keywords you expect to appear in matching documents — the search fuses vector similarity and BM25 with Reciprocal Rank Fusion, so both signals contribute.\n3. If a search result references an id you want to inspect in full,\n call `get_record_by_id`.\n4. Once you have enough context, stop calling tools and answer.\n\nConstraints:\n- Only retrieve when the user's question actually needs grounded\n information. Trivial questions don't need a search.\n- Reformulate the user's question into focused queries; don't just pass\n the raw user text.\n- If a search returns nothing useful, retry with a different phrasing\n before giving up.\n</instructions>\n"
},
{
"role": "user",
"content": "How much PTO do employees get per year?"
},
{
"role": "assistant",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"content": "",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
},
{
"role": "tool",
"content": {
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
},
"tool_call_id": "call_s1a7xfam"
}
]
}
]
[Synalinks]
Call ID: c7ebcc4b-9178-459e-b440-189b4ffaf99f
Parent call ID: f405d7e2-2b72-4583-99c2-fd139408ed5a
Module: LanguageModel
Module Name: language_model
Module Description: A language model API wrapper.
Data Model JSON:
[
{
"role": "assistant",
"content": "Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year.",
"reasoning_content": "Okay, let me process the search results. The user asked about PTO per year. The first result is from the Document table with id \"policy-pto\". The content says full-time employees get 20 days of PTO annually. That's the main answer. The other documents mention pricing and remote work, which aren't relevant here. I should confirm there's no other info needed. Since the answer is straightforward, I can provide it directly without further tool calls.\n"
}
]
[Synalinks]
Call ID: f405d7e2-2b72-4583-99c2-fd139408ed5a
Parent call ID: 7b093022-ef51-4092-aa88-4dd0a8a86d08
Module: Generator
Module Name: tool_calls_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON:
[
{
"role": "assistant",
"content": "Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year.",
"reasoning_content": "Okay, let me process the search results. The user asked about PTO per year. The first result is from the Document table with id \"policy-pto\". The content says full-time employees get 20 days of PTO annually. That's the main answer. The other documents mention pricing and remote work, which aren't relevant here. I should confirm there's no other info needed. Since the answer is straightforward, I can provide it directly without further tool calls.\n"
}
]
[Synalinks]
Call ID: e7edf491-cec7-4062-b3c7-e187e31afb68
Parent call ID: c7ebcc4b-9178-459e-b440-189b4ffaf99f
Module: Generator
Module Name: final_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
},
{
"role": "assistant",
"content": "",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
},
{
"role": "tool",
"content": {
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
},
"tool_call_id": "call_s1a7xfam"
}
]
}
]
[Synalinks]
Call ID: 774626bc-a93b-46f5-9d98-9b973678b320
Parent call ID: e7edf491-cec7-4062-b3c7-e187e31afb68
Module: LanguageModel
Module Name: language_model
Module Description: A language model API wrapper.
Data Model JSON:
[
{
"messages": [
{
"role": "system",
"content": "<instructions>\nYou are a retrieval-augmented assistant with access to a knowledge base.\n\nAvailable tables: ['Document']\nSearch mode: hybrid_fts\n\nPlan:\n1. If you don't already know what's available, call `get_knowledge_base_schema`.\n2. Call `search_knowledge_base` with the table you want and a query.\n Use natural-language queries that contain the keywords you expect to appear in matching documents — the search fuses vector similarity and BM25 with Reciprocal Rank Fusion, so both signals contribute.\n3. If a search result references an id you want to inspect in full,\n call `get_record_by_id`.\n4. Once you have enough context, stop calling tools and answer.\n\nConstraints:\n- Only retrieve when the user's question actually needs grounded\n information. Trivial questions don't need a search.\n- Reformulate the user's question into focused queries; don't just pass\n the raw user text.\n- If a search returns nothing useful, retry with a different phrasing\n before giving up.\n</instructions>\n"
},
{
"role": "user",
"content": "How much PTO do employees get per year?"
},
{
"role": "assistant",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"content": "",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
},
{
"role": "tool",
"content": {
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
},
"tool_call_id": "call_s1a7xfam"
}
]
}
]
[Synalinks]
Call ID: 774626bc-a93b-46f5-9d98-9b973678b320
Parent call ID: e7edf491-cec7-4062-b3c7-e187e31afb68
Module: LanguageModel
Module Name: language_model
Module Description: A language model API wrapper.
Data Model JSON:
[
{
"role": "assistant",
"content": "Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year.",
"reasoning_content": "Okay, let me process this. The user asked about PTO per year. The search results show a document titled \"PTO Policy\" with content mentioning full-time employees get 20 days of PTO annually. That's the key info needed. The other documents are about pricing and remote work, which aren't relevant here. Since the PTO policy document is found, I can directly answer with the 20 days figure. No need for further searches. Just confirm the answer is from the relevant document and present it clearly.\n"
}
]
[Synalinks]
Call ID: e7edf491-cec7-4062-b3c7-e187e31afb68
Parent call ID: c7ebcc4b-9178-459e-b440-189b4ffaf99f
Module: Generator
Module Name: final_generator_vector_rag_agent
Module Description: Use a `LanguageModel` to generate a data model from an arbitrary input data model.
Data Model JSON:
[
{
"role": "assistant",
"content": "Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year.",
"reasoning_content": "Okay, let me process this. The user asked about PTO per year. The search results show a document titled \"PTO Policy\" with content mentioning full-time employees get 20 days of PTO annually. That's the key info needed. The other documents are about pricing and remote work, which aren't relevant here. Since the PTO policy document is found, I can directly answer with the 20 days figure. No need for further searches. Just confirm the answer is from the relevant document and present it clearly.\n"
}
]
[Synalinks]
Call ID: 84cdf3ab-d4ad-4635-8664-214b637aa194
Parent call ID: b349f450-503c-44fe-b95e-3d6b83ba4bac
Module: VectorRAGAgent
Module Name: vector_rag_agent
Module Description: A ready-to-use retrieval-augmented agent backed by a knowledge base.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
},
{
"role": "assistant",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"content": "",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
},
{
"role": "tool",
"content": {
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
},
"tool_call_id": "call_s1a7xfam"
},
{
"role": "assistant",
"reasoning_content": "Okay, let me process this. The user asked about PTO per year. The search results show a document titled \"PTO Policy\" with content mentioning full-time employees get 20 days of PTO annually. That's the key info needed. The other documents are about pricing and remote work, which aren't relevant here. Since the PTO policy document is found, I can directly answer with the 20 days figure. No need for further searches. Just confirm the answer is from the relevant document and present it clearly.\n",
"content": "Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year."
}
]
}
]
[Synalinks]
Call ID: b349f450-503c-44fe-b95e-3d6b83ba4bac
Parent call ID: None
Module: Functional
Module Name: vector_rag_agent
Module Description: A RAG agent that retrieves and answers from documents.
Data Model JSON:
[
{
"messages": [
{
"role": "user",
"content": "How much PTO do employees get per year?"
},
{
"role": "assistant",
"reasoning_content": "Okay, the user is asking how much PTO employees get per year. Let me think about how to approach this. \n\nFirst, I need to check if the knowledge base has any relevant information. The available table is Document, so I should search that. The question is about PTO policies, which might be outlined in employee handbooks or company policies. \n\nI'll use the search_knowledge_base function with the Document table and a query related to PTO. The query should include keywords like \"PTO,\" \"annual,\" \"leave,\" etc. Let me try that.\n\nIf the search returns documents that mention PTO policies, I can then retrieve specific records by their IDs to get the exact details. If not, I might need to adjust the search terms or check if there's another table, but since only Document is available, I'll stick with that.\n\nOnce I find the relevant documents, I can summarize the information to answer the user. If the documents don't specify, I should inform the user that the information isn't available in the knowledge base.\n",
"content": "",
"tool_calls": [
{
"id": "call_s1a7xfam",
"type": "function",
"function": {
"name": "search_knowledge_base",
"arguments": {
"query": "PTO policy annual leave accrual",
"table_name": "Document"
}
}
}
]
},
{
"role": "tool",
"content": {
"table": "Document",
"query": "PTO policy annual leave accrual",
"search_type": "hybrid_fts",
"results": "\"id\",\"title\",\"content\",\"embedding\",\"score\"\n\"policy-pto\",\"PTO Policy\",\"Full-time employees receive 20 days of PTO per year. PTO accrues monthly. Up to 5 unused days carry over.\",,0.03252247488101534\n\"pricing-enterprise\",\"Enterprise Plan Pricing\",\"Enterprise Plan: $99/user/month billed annually. Volume discounts: 10% off at 50 users, 15% off at 100, 20% off at 250.\",,0.03252247488101534\n\"policy-remote\",\"Remote Work Policy\",\"Employees may work remotely up to 3 days per week with manager approval. Core hours are 10 AM to 4 PM.\",,0.031746031746031744\n",
"row_count": 3,
"output_format": "csv"
},
"tool_call_id": "call_s1a7xfam"
},
{
"role": "assistant",
"reasoning_content": "Okay, let me process this. The user asked about PTO per year. The search results show a document titled \"PTO Policy\" with content mentioning full-time employees get 20 days of PTO annually. That's the key info needed. The other documents are about pricing and remote work, which aren't relevant here. Since the PTO policy document is found, I can directly answer with the 20 days figure. No need for further searches. Just confirm the answer is from the relevant document and present it clearly.\n",
"content": "Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year."
}
]
}
]
Agent: Full-time employees receive **20 days of PTO per year** according to the PTO policy document. PTO accrues monthly, and up to 5 unused days can carry over to the next year.