版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
CompleteRoadmaptoBecomeanAgenticAIEngineer
in2026
InterviewQuestions&AnswersbyTopic
LamhotSiagian
PhDStudent•AIEvaluationEngineer•AIEngineer
MachineLearning•DataScience&AI/ML
/in/lamhotsiagian
lamhotsiagian2025@
January19,2026
Thisdocumentturnsthe2026AgenticAIlearningroadmapintopracticalinterviewpractice.Eachsection
includes10commoninterviewquestionswithmodelanswersandafewsmallcodeexamples.
AgenticAIEngineerRoadmap(2026)InterviewQ&A
i
Contents
1HowtoUseThisRoadmap
1
2PythonFundamentals(forAgenticAI)
2
3LLMFundamentals
4
4PickaFramework(LangChain/LangGraphvsCrewAIvsAutoGen)
6
5AdvancedFrameworkConcepts(LCEL,Runnables,Workflows,Multi-Agent)
8
6MemoryManagement(Short-Term,Long-Term,Checkpointing)
10
7ToolIntegration(CustomTools,Connectors,Decorators)
12
8RAGSystems(VectorStores,Embeddings,RetrievalStrategies)
14
9Agents&Multi-Agents(ReAct,Supervisors,Communication)
16
10BuildReal-WorldProjects(FastAPI,Streamlit/UI,Docker,AWS)
18
11QuickChecklist:TheRightOrdertoLearn(2026)
20
AgenticAIEngineerRoadmap(2026)InterviewQ&A
1
1HowtoUseThisRoadmap
Thisroadmapfollowsa“foundation-first”order:learncoreprogramming,thenLLMconcepts,thenframeworks,thenadvancedagentarchitecture,thenproductiondeployment.
Howtopractice:foreachtopic,(1)readthequestions,(2)rewriteanswersinyourownwords,(3)implementatleastonesmallprojectpersection,and(4)keepnotesoffailuresandfixes—thatiswhatinterviewerswanttohear.
Scope:ThequestionsfocusonAgenticAIengineeringforsoftwareproducts:tool-usingLLMapps,multi-agentworkflows,RAG,memory,evaluation,anddeployment.
AgenticAIEngineerRoadmap(2026)InterviewQ&A
2
2PythonFundamentals(forAgenticAI)
1.1Question:WhyisPythonthedefaultlanguageforAgenticAIengineering?
Answer:PythonhasamatureecosystemforAPIs,dataprocessing,andML(e.g.,FastAPI,Pydantic,NumPy,PyTorch)andexcellentdeveloperergonomics.Mostagentframeworksandtooling(LangChain/LangGraph,CrewAI,AutoGen,vectorDBclients)providefirst-classPythonsupport.Ininterviews,emphasizethatPythonletsyourapidlyprototypeandthenhardensystemswithtyping,tests,andpackaging.
1.2Question:ExplainhowyouwouldstructureaPythonprojectforanagenticsystem.
Answer:Usealayeredstructure:app/(API/UIentrypoints),core/(domainlogic,prompts,policies),agents/(agentgraphs,routers),tools/(toolwrappers,schemas),rag/(chunking,retrieval),eval/(tests,goldensets),andinfra/(Docker,configs).Addpyproject.toml,typedinterfaces,andunit/integrationtests.Thegoalisseparationsofconcernssoprompts/toolscanevolvewithoutbreakingdeployment.
1.3Question:WhatPythonfeaturesmattermostforbuildingrobustagents?
Answer:Typehints(mypy/pyright),dataclassesorPydanticmodelsforschemas,contextmanagersforresourcesafety,async/awaitforIO-heavytoolcalls,andexceptionsforexpliciterrorhandling.OOPisusefulfortooladapters,butcompositionandsmallpurefunctionsoftenscalebetter.Alsoimportant:logging,retries/backoff,anddependencyinjectionfortestability.
1.4Question:HowdoyoudesignacleanAPIclientfortools(REST/GraphQL)?
Answer:Definerequest/responsemodels(Pydantic),centralizeauthandbaseURL,implementtimeouts,retries,andidempotencywherepossible.Exposesmallmethodsalignedtobusinessactions,notrawendpoints.LogcorrelationIDsfortracingacrossagentsteps.Ininterviews,mentionprotectingsecretswithenvvarsorasecretmanagerandneverprintingtokens.
1.5Question:WhenwouldyouusesynchronousvsasynchronousPythonforagents?
Answer:Iftoolsaremostlynetworkcalls(search,DB,externalAPIs),asynccanimprovethroughputandlatencybyrunningcallsconcurrently.IfyourworkloadisCPU-bound(embed-dinglargebatcheslocally),multiprocessingorbackgroundworkersmaybebetter.Manyagentappsmixboth:asyncfortoolcalls,andajobqueueforheavypreprocessing/indexing.
1.6Question:ShowaminimalexampleofatypedtoolinputschemainPython.
Answer:Agoodpatternistovalidatetoolinputsbeforetheagentrunsthetool.
frompydanticimportBaseModel,Field
classWeatherArgs(BaseModel):
city:str=Field(...,min_length=2)
units:str=Field("metric",pattern="^(metric|imperial)$")
Typedschemasreducehallucinatedparametersandgiveclearerrorsyoucanroutebacktotheagentforself-repair.
1.7Question:Howdoyoutestagenticcodewhereoutputsareprobabilistic?
Answer:Testdeterministiclayers(parsers,tooladapters,routingrules)withunittests.ForLLMsteps,use“golden”promptswithsnapshots,andevaluatewithmetricslikeexactmatch,
AgenticAIEngineerRoadmap(2026)InterviewQ&A
3
JSONschemavalidity,orrubric-basedscoring.Addintegrationteststhatmocktoolsandcontrolseeds/temperature.Thegoalistodetectregressions,nottoproveperfectcorrectness.
1.8Question:WhatarecommonPythonpitfallsinproductionagentapps?
Answer:Unboundedretriescausingstorms,missingtimeouts,leakingfilehandles/sockets,globalstatesharedacrossrequests,andweakinputvalidation.Anotherpitfallismixingpromptlogicwithbusinesslogicsochangesbecomerisky.Finally,lackingobservability(structuredlogs,traces)makesdebugging“agentwentweird”almostimpossible.
1.9Question:Howdoyoumanageconfigurationacrosslocal/dev/prod?
Answer:Useasingleconfigobjectloadedfromenvvars(andoptionallyaconfigfile),validatedbyPydantic.Keepsecretsoutofsourcecontrol.Versionconfigswithinfrastructure(Terraform/CloudFormation)anddocumentrequiredvariables.Ininterviews,mentionfeatureflagsforsafelyrollingoutnewpromptsoragentpolicies.
1.10Question:ExplaindependencymanagementandreproducibilityinPythonforML/agents.
Answer:Usealockfileapproach(e.g.,uv/poetry/pip-tools)soversionsarepinned.Separateruntimedepsfromdev/testdeps.BuildDockerimageswithpinnedOSpackages.Reproducibil-itymattersbecausesmalllibrarychangescanaltertokenization,
HTTPclients
,orvectorDBbehavior,whichchangesagentoutputs.
AgenticAIEngineerRoadmap(2026)InterviewQ&A
4
3LLMFundamentals
2.1Question:Insimpleterms,howdoesanLLMgeneratetext?
Answer:AnLLMpredictsthenexttokengivenprevioustokens.Itconvertstextintotokens,mapstokenstoembeddings,appliestransformerlayerswithattentiontocomputecontextualrepresentations,andthenproducesaprobabilitydistributionoverthenexttoken.Generationrepeatsuntilastopcondition.Foragents,thekeyisthat“reasoning”ispattern-basedprediction,soyoumustprovidestructure,tools,andconstraints.
2.2Question:Whataretokens,andwhydotheymatterforengineering?
Answer:Tokensarethemodel’sdiscreteunits(oftensubwordpieces).Theyaffectcost,latency,andhowmuchcontextyoucanprovide.Tokenlimitsforcetradeoffs:whatinstructions,memory,andretrieveddocsfit.Engineersoptimizeprompts,retrieval,andsummariestostaywithincontextwhilepreservingtherightevidence.
2.3Question:Explainthecontextwindowanditspracticalimpactonagents.
Answer:Thecontextwindowisthemaximumtokensthemodelcanattendtoatonce.Ifyouexceedit,themodeltruncatesoryoumustsummarize.Practically,agentsneedmemorystrategies(summaries,retrieval,compression)andcarefultooloutputfiltering.Ininterviews,mention“contextbudgeting”andprotectingcriticalsysteminstructionsfrombeingpushedout.
2.4Question:Whatispromptingbeyond“writeagoodprompt”?
Answer:Promptingisinterfacedesign:specifyrole,task,constraints,outputschema,andexamples.Foragents,youalsodefinetool-usepolicies(whentocalltools,howtociteevidence,howtohandleuncertainty).Goodpromptsreduceambiguityandmakefailuremodespredictable.Youshouldalsoversionpromptslikecodeandtestthem.
2.5Question:Describetemperature,top-p,andwhydeterministicsettingsmatter.
Answer:Temperaturecontrolsrandomness;highermeansmorediverseoutputs.Top-p(nucleussampling)restrictstokenchoicestoaprobabilitymass.Forproductionagents,youoftenpreferlowerrandomnessforreliability,especiallywhenproducingJSONormakingtoolcalls.Youmightincreaserandomnessforbrainstormingbutnotforaction-takingflows.
2.6Question:Whatisfunctioncalling(toolcalling),andwhyisituseful?
Answer:Functioncallingletsthemodeloutputastructuredtoolinvocation(name+argu-ments)insteadoffree-formtext.Yoursystemexecutesthetoolandreturnsresultstothemodel.Thismakesagentsmorereliablebecausetoolshandleexactcomputation,retrieval,andsideeffects.Italsoenablesvalidation(schemas)andsaferexecution(allowlists,sandboxes).
2.7Question:HowdoyoupreventpromptinjectionwhenusingtoolsandRAG?
Answer:Treatretrievedtextasuntrusted.Useastrictsystempolicy:neverfollowinstructionsfromdocuments;onlyextractfacts.Separatetooloutputsfromsysteminstructionsandadda“contentprovenance”tag.Validatetoolargumentsandrestricttoolcapabilities.Alsoapplycontentfiltersandallowlistsforsensitiveactions.
2.8Question:Whatishallucination,andhowdoyoureduceitinagentsystems?
Answer:Hallucinationisconfident-soundingtextnotgroundedintruth.Reduceitbyusingtoolsforfactualqueries,RAGwithcitations,constrainedoutputs(schemas),andexplicit
AgenticAIEngineerRoadmap(2026)InterviewQ&A
5
“abstain”rules.Addverificationloops:cross-checksources,runasecond-passcritic,ortestagainstaknowledgebase.Inproduction,measurehallucinationrateswithevaluationsets.
2.9Question:Explainembeddingsandwhytheyenablesemanticretrieval.
Answer:Embeddingsmaptexttovectorswheresemanticsimilaritycorrespondstogeometriccloseness.Thisallowsapproximatenearest-neighborsearchtoretrieverelevantchunksevenifkeywordsdiffer.Engineerschooseembeddingmodelsbasedondomain,language,cost,andvectordimension.Youalsoneedchunkingstrategiessoembeddingsrepresentcoherentmeaning.
2.10Question:WhatarethemainrisksofLLMappsinproduction?
Answer:Reliability(unexpectedoutputs),security(promptinjection,dataleaks),privacy(PIIexposure),cost/latencyspikes,andevaluationdrift.Agentsaddrisksbecausetheycantakeactionsthroughtools.Mitigationsincludepolicylayers,least-privilegetools,auditlogs,offlineevaluation,andstagedrolloutswithmonitoring.
AgenticAIEngineerRoadmap(2026)InterviewQ&A
6
4PickaFramework(LangChain/LangGraphvsCrewAIvsAutoGen)
3.1Question:HowdoyouchoosebetweenLangChain+LangGraph,CrewAI,andAutoGen?
Answer:Startfromrequirements:deterministicworkflowsvsconversationalautonomy,numberofagents,toolcomplexity,andobservabilityneeds.LangGraphisstrongforexplicitstatemachines/graphs,retries,andlong-runningworkflows.CrewAIisopinionatedfor“role-based”multi-agentcollaboration.AutoGenisflexibleforagent-to-agentchatpatterns.Ininterviews,sayyouprototypequicklybutstabilizewithexplicitgraphsandtests.
3.2Question:WhyisLangGraphoftenrecommendedforproductionagents?
Answer:Itmodelsagentbehaviorasagraphwithnodes(steps)andedges(transitions),whichiseasiertoreasonaboutthanimplicitloops.Youcancheckpointstate,enforcepoliciesatboundaries,andaddretries.Thisimprovesdebuggabilityandpreventsrunawayconversations.Italsosupportshuman-in-the-looppatternsmorenaturally.
3.3Question:Whatisthebiggestanti-patternwhenadoptingaframework?
Answer:Copy-pastingdemocodeandtreatingtheframeworkasthearchitecture.Frameworksareimplementationtools;architectureisyourstatemodel,toolboundaries,datacontracts,andsafetyrules.Ifyouskipfundamentals(schemas,errorhandling,evaluation),frameworkswillamplifychaos.Interviewerslovehearing“Istartsmallandhardenlayers.”
3.4Question:Howdoyouhandlevendorlock-inconcerns?
Answer:AbstracttheLLMandembeddingprovidersbehindinterfaces.Avoidembeddingprovider-specificfeaturesunlessneeded.Keepprompts,schemas,andevaluationsetsportable.Ifusingaframework,isolateitinalayersocorebusinesslogicdoesn’tdependonit.Thenyoucanswapframeworksorproviderswithfewerchanges.
3.5Question:Whatdoes“state”meaninanagentgraph?
Answer:Stateisthestructureddatathatflowsthroughsteps:userinput,conversationhistory,retrieveddocuments,toolresults,anddecisions.Goodstatedesignistypedandminimal.Itenablesreproducibility(replayarun),observability(inspecteachfield),andsafety(validatetransitions).Poorstatedesignleadstohiddencouplingandbrittlebehavior.
3.6Question:Explainhowyouwouldimplementarouterthatchoosestools.
Answer:Useapolicy:eitherrules(keywords,intents)oranLLM-basedclassifierconstrainedtoasmalllabelset.Thenvalidatethechosentoolandargumentsagainstschemas.Logdecisionsandconfidence.Arobustpatternis:Router(decide)→ToolExecutor(act)→Verifier(check)beforeresponding.
3.7Question:Howdoframeworkshelpwithoutputstructure(JSON,schemas)?
Answer:Theyprovideparsers,outputconstraints,andutilitiestoenforcestructuredoutputs.Evenwithoutbuilt-inhelpers,youcanwrapoutputswithPydanticvalidation.Ifparsingfails,theframeworkcanroutetoarepairstep.Ininterviews,mentionfail-closedbehavior:ifschemavalidationfails,donotexecuteactions.
3.8Question:Howdoyoudebugagentsinsideaframework?
Answer:Startwithtraces:prompts,toolcalls,inputs/outputs,latency,andtokenusage.Reproducewithafixedseed/temperature.Thenisolatefailure:wasitretrieval,routing,tool
AgenticAIEngineerRoadmap(2026)InterviewQ&A
7
error,orpromptambiguity?Framework-specificdebuggershelp,butthecoreisobservability+replay.
3.9Question:Whatisagoodmigrationpathfromanotebookdemotoproduction?
Answer:Extractcodeintoapackage,addconfigurationmanagement,andwraptheagentbehindanAPI.Introducetypedschemas,errorhandling,retries,andratelimits.Addevaluationharnesseswithasmallgoldendataset.Finallycontainerizeanddeploywithmonitoring.Thisstagedpathprevents“bigrewrite”failures.
3.10Question:Whatisyourdefault“minimalstack”foragenticprototypes?
Answer:Python+FastAPI,asingleagentloop,asmallsetoftoolswithstrictschemas,avectorstore(orevenin-memory)forRAG,andbasictracing/logging.Whenbehaviorstabilizes,movetoanexplicitgraph(LangGraph),addaUI(Streamlit),andimplementevaluations.Thekeyisminimalmovingpartsatfirst.
AgenticAIEngineerRoadmap(2026)InterviewQ&A
8
5AdvancedFrameworkConcepts(LCEL,Runnables,Workflows,Multi-Agent)
4.1Question:WhatisLCELandwhydoengineersuseit?
Answer:LCEL(LangChainExpressionLanguage)composescomponents(prompts,models,parsers,tools)intopipelines.Itencouragesmodularity:youcanswapamodelorparserwithoutrewritingeverything.Italsomakescomplexchainsreadableandtestable.Ininterviews,highlightcompositionandobservabilitybenefits.
4.2Question:Whatare“runnables”conceptually?
Answer:Arunnableisaunitthattakesinput,producesoutput,andcanbecomposedwithotherrunnables.Thinkofitasafunctionalpipelinebuildingblock.Thishelpsyoustandardizeexecution,logging,retries,andconcurrency.EvenoutsideLangChain,thesameideaapplies:uniforminterfacesforsteps.
4.3Question:Howdoyoudesignaworkflowthatincludesretriesandfallbacks?
Answer:Classifyfailures(tooltimeoutvsinvalidargsvsmodelparsingerror).Fortransientfailures,retrywithexponentialbackoff.Forpersistentfailures,fallbacktosimplertoolsoraskaclarifyingquestion.Ingraphs,modelthisexplicitly:erroredge→repairnode→re-try.Logeachattempttoavoidinfiniteloops.
4.4Question:Explain“multi-agent”vs“singleagentwithtools.”
Answer:Singleagentwithtoolsisonedecision-makercallingexternalfunctions.Multi-agentsplitsresponsibilities:e.g.,planner,retriever,executor,critic.Thiscanimprovespecializationandsafetybutincreasescoordinationcomplexity.Interviewerswanttohearthatyouonlygomulti-agentwhenthetasktrulybenefitsfromdecomposition.
4.5Question:Whatisa“workflow”comparedtoa“chain”?
Answer:Achainisusuallylinear:stepAthenBthenC.Aworkflowincludesbranching,loops,humanapprovalsteps,anddifferentpathsfordifferentconditions.Agenticsystemsoftenneedworkflowsbecauserealtaskshaveuncertaintyandpartialfailures.LangGraph-likestatemachinesareanaturalfit.
4.6Question:Howdoyoupreventagentsfromloopingforever?
Answer:Addmaximumsteps,timebudgets,and“stopconditions”basedontaskcompletionsignals.Trackrepeatedtoolcallsorrepeatedreasoningpatterns.Implementawatchdogthatforcesescalation:asktheuser,orreturnpartialresults.Inagraph,enforcetheseviastatecountersandguardedges.
4.7Question:Whatis“structuredoutput”andwhyisitcriticalforagents?
Answer:Structuredoutputmeansthemodelproducesmachine-validateddata(JSONcon-formingtoaschema).Itpreventsbrittlestringparsingandreduceshallucinatedparameters.Italsoenablessafetoolexecution:onlyrunifschemavalidationpasses.Foragenticproducts,structuredoutputisoftenthedifferencebetweenademoandareliablesystem.
4.8Question:Howdoyoudesigna“critic”orverifierstep?
Answer:Defineexplicitcriteria:citationpresent,toolresultsused,JSONvalid,constraintsmet.Usedeterministicchecksfirst(schemavalidation,regex,businessrules).Optionallyadd
AgenticAIEngineerRoadmap(2026)InterviewQ&A
9
anLLMjudgewitharubric,butkeepitasasecondlayer.Ifverificationfails,routetoarepairsteporaskforclarification.
4.9Question:Whatarethetradeoffsofparallelizingagentsteps?
Answer:Paralleltoolcallsreducelatencybutcanwastecostifmanycallsareunnecessary.ParallelLLMcallsimprovequalityvia“self-consistency”butincreaseexpense.Youshouldparallelizewhereuncertaintyishighandresultsarereusable,andserializewheredecisionsdependonpriorresults.Alwayscapconcurrencyandhandleratelimits.
4.10Question:Howdoyouhandlelong-runningtasks(minutes/hours)withagents?
Answer:Useasyncjobswithpersistentstate(DB/queue)andcheckpointaftereachstep.EmitprogresseventstotheUI.Designidempotenttoolcallssoretriesdon’tduplicatesideeffects.Forworkflows,model“resumefromcheckpoint”sothesystemcanrecoverafterrestarts.
10
AgenticAIEngineerRoadmap(2026)InterviewQ&A
6MemoryManagement(Short-Term,Long-Term,Checkpointing)
5.1Question:Whatisthedifferencebetweenshort-termandlong-termmemoryinagenticAI?Answer:Short-termmemoryistheimmediateconversation/contextwindow:recentturns,tooloutputs,currenttaskstate.Long-termmemoryisstoredexternally:databases,vectorstores,userprofiles,summaries.Short-termisfastbutlimited;long-termisscalablebutneedsretrievalandrelevancefiltering.Engineeringischoosingwhattostoreandwhentoretrieve.
5.2Question:Whenshouldyoustorememoryastextsummariesvsembeddings?
Answer:Usesummariesfor“whathappened”inasession(decisions,commitments,preferences).Useembeddingsforlargeknowledgewhereyouneedsemanticretrieval(notes,docs,pasttickets).Oftenyoucombineboth:asummaryforquickcontextplusembeddingsfordetailedrecall.Alsoconsiderstructuredmemory(key-value)forstablefactslikeauser’spreferredunitsorlanguage.
5.3Question:Whatischeckpointingandwhyisitimportant?
Answer:Checkpointingsavesworkflowstateafterstepssoyoucanresumeafterfailures,timeouts,orhumanapprovals.It’scriticalforlong-runningagentsandforauditability.Agoodcheckpointincludesinputs,toolcalls,outputs,andaversionofprompts/policies.Thisenablesreplayanddebugging.
5.4Question:Howdoyoupreventmemoryfromcausingprivacyorsecurityissues?
Answer:Applydataminimization:storeonlywhatyouneed.Encryptatrest,restrictaccessbytenant,andsetretentionpolicies.Avoidstoringsecrets,credentials,orsensitivePII.Ifyoumuststoreuser-specificmemory,giveuserstransparencyandcontrols.Alsosanitizetooloutputsbeforesaving.
5.5Question:Whatis“contextbudgeting”formemory?
Answer:It’sdecidinghowmuchofthecontextwindowtoallocatetoinstructions,recentchat,retrieveddocs,andmemory.Youcanenforcebudgets:e.g.,max30%forretrieveddocs,max20%formemorysummary.Whenexceedingbudgets,compress:summarize,deduplicate,anddroplow-valuecontent.Abudgetpreventscriticalinstructionsfrombeingcrowdedout.
5.6Question:Howdoyouevaluatewhethermemoryhelpsorhurts?
Answer:RunA/Btestswithandwithoutmemoryandcomparetasksuccess,hallucinationrate,andusersatisfaction.Memorycanhurtbyintroducingoutdatedorirrelevantfacts.Usefreshnessscoringandconflictresolutionrules.Ininterviews,mentionmonitoring“memoryhitrate”and“memory-inducederror”cases.
5.7Question:Explain“recency”vs“relevance”inmemoryretrieval.
Answer:Recencyprioritizesnewerinfo;relevanceprioritizessemanticsimilarity.Inpracticeyoubalanceboth:retrievetopsemanticmatches,thenre-rankbyrecencyandtrust.Foruserpreferences,recencycanmatter(peoplechangetheirmind).Forstablefacts,relevancedominates.
5.8Question:Howdoyouimplementmemoryformulti-agentsystems?
Answer:Decidewhatissharedvsprivate.Sharedmemorymightincludeataskplanandverifiedfacts;privatememorymightincludeaspecialistagent’sintermediatenotes.Use
AgenticAIEngineerRoadmap(2026)InterviewQ&A
11
structuredstatepassedthroughthegraphastheprimary“truth,”andstorelong-termartifactsexternally.Alwaysincludeprovenance:whereeachmemorycamefromandwhen.
5.9Question:Whatarecommonfailuremodesoflong-termmemory?
Answer:Retrievingirrelevantchunks,storingnoisyorunverifiedinformation,andfeedbackloopswherehallucinationsgetstoredasmemory.Also:stalepreferencesandconflictingmemories.Mitigatewithvalidation(storeonlyverifiedfacts),decay/expiration,anda“donotstore”policyforuncertaincontent.Agoodruleis“onlystorewhatyoucanjustify.”
5.10Question:Howdoyouhandleusercorrectionstomemory?
Answer:Treatusercorrectionsashighpriority.Updatestructuredmemoryfieldsandmarkoldentriesasdeprecatedratherthandeletingblindly(forauditability).Ifusingembeddings,storeanewcorrectivenoteandre-rankbyrecency.ExposeasimpleUI/commandforuserstoviewandeditwhatisremembered.
AgenticAIEngineerRoadmap(2026)InterviewQ&A
12
7ToolIntegration(CustomTools,Connectors,Decorators)
6.1Question:Whatmakesatool“agent-friendly”?
Answer:Clearname,narrowpurpose,typedinputschema,deterministicoutput,andfastfailure.Toolsshouldreturnstructureddata,notlongnarratives.Theyshouldenforcetimeoutsandreturnhelpfulerrorcodes.Agent-friendlytoolsareeasytotestandsafetocallrepeatedly.
6.2Question:Howdoyousafelyexposetoolsthathavesideeffects(email,purchases,deletes)?
Answer:Useleastprivilegeandseparate“read”toolsfrom“write”tools.Requireexplicitconfirmationsforirreversibleactions.Addpolicychecksandhuman-in-the-loopapprovals.Logeveryactionwithinputs,outputs,anduseridentity.Ininterviews,emphasizethattheagentshouldneverdirectlyexecutehigh-riskactionswithoutguardrails.
6.3Question:Explaintheroleofanallowlistandsandboxfortools.
Answer:Anallowlistlimitswhichtoolsthemodelcancall.Asandboxlimitswhatthosetoolscando(e.g.,restrictedfilesystem,networkegressrules).Togethertheyreducedamagefromhallucinatedtoolcallsorpromptinjection.Itisstandardtoblockarbitrarycodeexecutionunlesstheenvironmentisfullyisolatedandaudited.
6.4Question:Howdoyoudesigntooloutputstominimizecontextbloat?
Answer:Returnonlywhattheagentneeds:concisefieldsandsummaries.Providepaginationor“top-k”results.StripHTML,logs,andirrelevantmetadata.Ifneeded,storelargerawoutputsexternallyandreturnashortreferenceID.Thiskeepsthecontextwindowfocusedandcheaper.
6.5Question:Showaminimalexampleofacustomtoolwrapperfunction.
Answer:Keepitdeterministic,validated,andtimeout-safe.
import
httpx
frompydanticimportBaseModel
classSearchArgs(BaseModel):
q:str
k:int=5
asyncdefweb_search(args:SearchArgs)->dict:
asyncwith
httpx.AsyncClient
(timeout=10.0)asc
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 山东银行业专业人员中级职业资格考试(专业实务银行管理)复习题库(2026年)
- 国家基层高血压、糖尿病防治管理指南培训考核试题及答案
- 2026年人民警察招录考试公安专业知识试题与答案
- 2026年注册测绘师之测绘管理与法律法规模考模拟试题(全优)
- 2026年中医药竞赛试题库附答案
- 2026年银行业专业人员初级职业资格考试(专业实务个人贷款)模拟题库及答案(广东省)
- 2026年网格员考试真题及答案
- 2026年适龄妇女两癌筛查业务培训试题
- 2026年驾照考试试题高速路问题及答案解析
- 2026年湖北工程技术高、中级专业技术职务水平能力测试(测绘工程)自测试题及答案
- 2026年十堰市郧阳区公开招聘事业单位工作人员75人备考题库及答案详解参考
- 煤矿重大事故隐患判定标准2026版解读
- 【期末复习】2025-2026学年八年级下册地理人教版期末综合测试卷
- 2026年人教版五年级下册道德与法治1-3单元知识点汇-总
- 2026年市场营销(网络营销)试题及答案
- 甲状腺髓样癌2025年CSCO指南
- 浅谈习惯性违章及对策措施
- 门窗企业生产制度
- GB 4053.2-2025固定式金属梯及平台安全要求第2部分:斜梯
- 杭州市钱塘区工业企业安全生产管理指导手册(一)
- DB41∕T 1836-2019 矿山地质环境恢复治理工程施工质量验收规范
评论
0/150
提交评论