Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions exercises/Python-LangGraph/06-discover-connected-crimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,21 +134,15 @@ def intelligence_researcher_node(state: AgentState) -> dict:
print("\n🔍 Intelligence Researcher starting web search...")

try:
suspects = [s.strip() for s in state["suspect_names"].split(",")]
intelligence_results = []

for suspect in suspects:
print(f" Searching public records for: {suspect}")
query = f"{suspect} criminal record art theft security technician Europe background check"
result = call_sonar_pro_search(query)
intelligence_results.append(f"Background check for {suspect}:\n{result}")

print(" Searching for similar art theft incidents...")
pattern_query = "museum art theft insider job no forced entry Europe similar incidents criminal network"
pattern_result = call_sonar_pro_search(pattern_query)
intelligence_results.append(f"Similar Art Theft Patterns:\n{pattern_result}")
print(f" Searching public records for: {state['suspect_names']}")
query = (
f"Background check for suspects {state['suspect_names']}: "
f"criminal record, art theft involvement, security technician background, Europe. "
f"Also include similar museum art theft incidents with no forced entry, insider job patterns, criminal networks in Europe."
)
result = call_sonar_pro_search(query)

raw_results = "Intelligence Research Complete:\n\n" + "\n\n".join(intelligence_results)
raw_results = f"Intelligence Research Complete:\n\n{result}"

response = model.invoke([
SystemMessage(content=WEB_RESEARCHER_AGENT["prompt"]),
Expand Down Expand Up @@ -336,10 +330,7 @@ python .\project\Python-LangGraph\starter-project\main.py
> ✅ Evidence analysis complete
>
> 🔍 Intelligence Researcher starting web search...
> Searching public records for: Sophie Dubois
> Searching public records for: Marcus Chen
> Searching public records for: Viktor Petrov
> Searching for similar art theft incidents...
> Searching public records for: Sophie Dubois, Marcus Chen, Viktor Petrov
> ✅ Intelligence research complete
>
> 🔍 Lead Detective analyzing all findings...
Expand Down
6 changes: 5 additions & 1 deletion exercises/Python/06-discover-connected-crimes.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,17 @@ intelligence_researcher_agent:
research_criminal_network:
description: >
Search the web for intelligence about the three suspects ({suspect_names}) and
related crimes. Use the call_sonar_pro_search tool to find:
related crimes. Use the call_sonar_pro_search tool to find all of the following
in a SINGLE search query that includes all suspect names together:
1. Public criminal records or prior convictions for each suspect
2. Similar art theft incidents with the same modus operandi (insider job, no forced entry)
3. Connections to known art theft rings or criminal networks
4. News reports or public information about any of the suspects
5. Recent museum heists in Europe with similar patterns

Important: combine all suspects and all topics into one search query rather than
searching for each suspect separately. This is more efficient and produces better results.

Cross-reference your web findings with the internal evidence analyzed by the
evidence analyst. Focus on discovering whether this is an isolated incident or
part of a larger criminal operation.
Expand Down
22 changes: 8 additions & 14 deletions project/Python-LangGraph/solution/investigator_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,21 +159,15 @@ def intelligence_researcher_node(state: AgentState) -> dict:
print("\n🔍 Intelligence Researcher starting web search...")

try:
suspects = [s.strip() for s in state["suspect_names"].split(",")]
intelligence_results = []

for suspect in suspects:
print(f" Searching public records for: {suspect}")
query = f"{suspect} criminal record art theft security technician Europe background check"
result = call_sonar_pro_search(query)
intelligence_results.append(f"Background check for {suspect}:\n{result}")

print(" Searching for similar art theft incidents...")
pattern_query = "museum art theft insider job no forced entry Europe similar incidents criminal network"
pattern_result = call_sonar_pro_search(pattern_query)
intelligence_results.append(f"Similar Art Theft Patterns:\n{pattern_result}")
print(f" Searching public records for: {state['suspect_names']}")
query = (
f"Background check for suspects {state['suspect_names']}: "
f"criminal record, art theft involvement, security technician background, Europe. "
f"Also include similar museum art theft incidents with no forced entry, insider job patterns, criminal networks in Europe."
)
result = call_sonar_pro_search(query)

raw_results = "Intelligence Research Complete:\n\n" + "\n\n".join(intelligence_results)
raw_results = f"Intelligence Research Complete:\n\n{result}"

response = model.invoke([
SystemMessage(content=WEB_RESEARCHER_AGENT["prompt"]),
Expand Down
6 changes: 5 additions & 1 deletion project/Python/solution/config/tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ analyze_evidence_task:
research_criminal_network:
description: >
Search the web for intelligence about the three suspects ({suspect_names}) and
related crimes. Use the call_sonar_pro_search tool to find:
related crimes. Use the call_sonar_pro_search tool to find all of the following
in a SINGLE search query that includes all suspect names together:
1. Public criminal records or prior convictions for each suspect
2. Similar art theft incidents with the same modus operandi (insider job, no forced entry)
3. Connections to known art theft rings or criminal networks
4. News reports or public information about any of the suspects
5. Recent museum heists in Europe with similar patterns

Important: combine all suspects and all topics into one search query rather than
searching for each suspect separately. This is more efficient and produces better results.

Cross-reference your web findings with the internal evidence analyzed by the
evidence analyst. Focus on discovering whether this is an isolated incident or
part of a larger criminal operation.
Expand Down