版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
CompleteRoadmaptoBecomeanAgenticAIEngineerin2026
InterviewQuestions&AnswersbyTopic
LamhotSiagian
PhDStudent•AIEvaluationEngineer•AIEngineerMachineLearning•DataScience&AI/ML/in/lamhotsiagian
lamhotsiagian2025@
January19,2026
Thisdocumentturnsthe2026AgenticAIlearningroadmapintopracticalinterviewpractice.Eachsectionincludes10commoninterviewquestionswithmodelanswersandafewsmallcodeexamples.
AgenticAIEngineerRoadmap(2026)
InterviewQ&A
i
Contents
TOC\o"1-1"\h\z\u
HowtoUseThisRoadmap
1
PythonFundamentals(forAgenticAI) 2
LLMFundamentals
4
PickaFramework(LangChain/LangGraphvsCrewAIvsAutoGen)
6
AdvancedFrameworkConcepts(LCEL,Runnables,Workflows,Multi-Agent)
8
MemoryManagement(Short-Term,Long-Term,Checkpointing)
10
ToolIntegration(CustomTools,Connectors,Decorators)
12
RAGSystems(VectorStores,Embeddings,RetrievalStrategies)
14
Agents&Multi-Agents(ReAct,Supervisors,Communication)
16
BuildReal-WorldProjects(FastAPI,Streamlit/UI,Docker,AWS)
18
QuickChecklist:TheRightOrdertoLearn(2026)
20
AgenticAIEngineerRoadmap(2026)
InterviewQ&A
PAGE
10
HowtoUseThisRoadmap
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.
PythonFundamentals(forAgenticAI)
Question:WhyisPythonthedefaultlanguageforAgenticAIengineering?
Answer:PythonhasamatureecosystemforAPIs,dataprocessing,andML(e.g.,FastAPI,Pydantic,NumPy,PyTorch)andexcellentdeveloperergonomics.Mostagentframeworksandtooling(LangChain/LangGraph,CrewAI,AutoGen,vectorDBclients)providefirst-classPythonsupport.Ininterviews,emphasizethatPythonletsyourapidlyprototypeandthenhardensystemswithtyping,tests,andpackaging.
Question: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.
Question:WhatPythonfeaturesmattermostforbuildingrobustagents?
Answer:Typehints(mypy/pyright),dataclassesorPydanticmodelsforschemas,contextmanagersforresourcesafety,async/awaitforIO-heavytoolcalls,andexceptionsforexpliciterrorhandling.OOPisusefulfortooladapters,butcompositionandsmallpurefunctionsoftenscalebetter.Alsoimportant:logging,retries/backoff,anddependencyinjectionfortestability.
Question:HowdoyoudesignacleanAPIclientfortools(REST/GraphQL)?
Answer:Definerequest/responsemodels(Pydantic),centralizeauthandbaseURL,implementtimeouts,retries,andidempotencywherepossible.Exposesmallmethodsalignedtobusinessactions,notrawendpoints.LogcorrelationIDsfortracingacrossagentsteps.Ininterviews,mentionprotectingsecretswithenvvarsorasecretmanagerandneverprintingtokens.
Question:WhenwouldyouusesynchronousvsasynchronousPythonforagents?
Answer:Iftoolsaremostlynetworkcalls(search,DB,externalAPIs),asynccanimprovethroughputandlatencybyrunningcallsconcurrently.IfyourworkloadisCPU-bound(embed-dinglargebatcheslocally),multiprocessingorbackgroundworkersmaybebetter.Manyagentappsmixboth:asyncfortoolcalls,andajobqueueforheavypreprocessing/indexing.
Question:ShowaminimalexampleofatypedtoolinputschemainPython.
Answer:Agoodpatternistovalidatetoolinputsbeforetheagentrunsthetool.
frompydanticimportBaseModel,Field
classWeatherArgs(BaseModel):
city:str=Field(...,min_length=2)
units:str=Field("metric",pattern="^(metric|imperial)$")
Typedschemasreducehallucinatedparametersandgiveclearerrorsyoucanroutebacktotheagentforself-repair.
Question:Howdoyoutestagenticcodewhereoutputsareprobabilistic?
Answer:Testdeterministiclayers(parsers,tooladapters,routingrules)withunittests.ForLLMsteps,use“golden”promptswithsnapshots,andevaluatewithmetricslikeexactmatch,
JSONschemavalidity,orrubric-basedscoring.Addintegrationteststhatmocktoolsandcontrolseeds/temperature.Thegoalistodetectregressions,nottoproveperfectcorrectness.
Question:WhatarecommonPythonpitfallsinproductionagentapps?
Answer:Unboundedretriescausingstorms,missingtimeouts,leakingfilehandles/sockets,globalstatesharedacrossrequests,andweakinputvalidation.Anotherpitfallismixingpromptlogicwithbusinesslogicsochangesbecomerisky.Finally,lackingobservability(structuredlogs,traces)makesdebugging“agentwentweird”almostimpossible.
Question:Howdoyoumanageconfigurationacrosslocal/dev/prod?
Answer:Useasingleconfigobjectloadedfromenvvars(andoptionallyaconfigfile),validatedbyPydantic.Keepsecretsoutofsourcecontrol.Versionconfigswithinfrastructure(Terraform/CloudFormation)anddocumentrequiredvariables.Ininterviews,mentionfeatureflagsforsafelyrollingoutnewpromptsoragentpolicies.
Question:ExplaindependencymanagementandreproducibilityinPythonforML/agents.
Answer:Usealockfileapproach(e.g.,uv/poetry/pip-tools)soversionsarepinned.Separateruntimedepsfromdev/testdeps.BuildDockerimageswithpinnedOSpackages.Reproducibil-itymattersbecausesmalllibrarychangescanaltertokenization,HTTPclients,orvectorDBbehavior,whichchangesagentoutputs.
LLMFundamentals
Question:Insimpleterms,howdoesanLLMgeneratetext?
Answer:AnLLMpredictsthenexttokengivenprevioustokens.Itconvertstextintotokens,mapstokenstoembeddings,appliestransformerlayerswithattentiontocomputecontextualrepresentations,andthenproducesaprobabilitydistributionoverthenexttoken.Generationrepeatsuntilastopcondition.Foragents,thekeyisthat“reasoning”ispattern-basedprediction,soyoumustprovidestructure,tools,andconstraints.
Question:Whataretokens,andwhydotheymatterforengineering?
Answer:Tokensarethemodel’sdiscreteunits(oftensubwordpieces).Theyaffectcost,latency,andhowmuchcontextyoucanprovide.Tokenlimitsforcetradeoffs:whatinstructions,memory,andretrieveddocsfit.Engineersoptimizeprompts,retrieval,andsummariestostaywithincontextwhilepreservingtherightevidence.
Question:Explainthecontextwindowanditspracticalimpactonagents.
Answer:Thecontextwindowisthemaximumtokensthemodelcanattendtoatonce.Ifyouexceedit,themodeltruncatesoryoumustsummarize.Practically,agentsneedmemorystrategies(summaries,retrieval,compression)andcarefultooloutputfiltering.Ininterviews,mention“contextbudgeting”andprotectingcriticalsysteminstructionsfrombeingpushedout.
Question:Whatispromptingbeyond“writeagoodprompt”?
Answer:Promptingisinterfacedesign:specifyrole,task,constraints,outputschema,andexamples.Foragents,youalsodefinetool-usepolicies(whentocalltools,howtociteevidence,howtohandleuncertainty).Goodpromptsreduceambiguityandmakefailuremodespredictable.Youshouldalsoversionpromptslikecodeandtestthem.
Question:Describetemperature,top-p,andwhydeterministicsettingsmatter.
Answer:Temperaturecontrolsrandomness;highermeansmorediverseoutputs.Top-p(nucleussampling)restrictstokenchoicestoaprobabilitymass.Forproductionagents,youoftenpreferlowerrandomnessforreliability,especiallywhenproducingJSONormakingtoolcalls.Youmightincreaserandomnessforbrainstormingbutnotforaction-takingflows.
Question:Whatisfunctioncalling(toolcalling),andwhyisituseful?
Answer:Functioncallingletsthemodeloutputastructuredtoolinvocation(name+argu-ments)insteadoffree-formtext.Yoursystemexecutesthetoolandreturnsresultstothemodel.Thismakesagentsmorereliablebecausetoolshandleexactcomputation,retrieval,andsideeffects.Italsoenablesvalidation(schemas)andsaferexecution(allowlists,sandboxes).
Question:HowdoyoupreventpromptinjectionwhenusingtoolsandRAG?
Answer:Treatretrievedtextasuntrusted.Useastrictsystempolicy:neverfollowinstructionsfromdocuments;onlyextractfacts.Separatetooloutputsfromsysteminstructionsandadda“contentprovenance”tag.Validatetoolargumentsandrestricttoolcapabilities.Alsoapplycontentfiltersandallowlistsforsensitiveactions.
Question:Whatishallucination,andhowdoyoureduceitinagentsystems?
Answer:Hallucinationisconfident-soundingtextnotgroundedintruth.Reduceitbyusingtoolsforfactualqueries,RAGwithcitations,constrainedoutputs(schemas),andexplicit
“abstain”rules.Addverificationloops:cross-checksources,runasecond-passcritic,ortestagainstaknowledgebase.Inproduction,measurehallucinationrateswithevaluationsets.
Question:Explainembeddingsandwhytheyenablesemanticretrieval.
Answer:Embeddingsmaptexttovectorswheresemanticsimilaritycorrespondstogeometriccloseness.Thisallowsapproximatenearest-neighborsearchtoretrieverelevantchunksevenifkeywordsdiffer.Engineerschooseembeddingmodelsbasedondomain,language,cost,andvectordimension.Youalsoneedchunkingstrategiessoembeddingsrepresentcoherentmeaning.
Question:WhatarethemainrisksofLLMappsinproduction?
Answer:Reliability(unexpectedoutputs),security(promptinjection,dataleaks),privacy(PIIexposure),cost/latencyspikes,andevaluationdrift.Agentsaddrisksbecausetheycantakeactionsthroughtools.Mitigationsincludepolicylayers,least-privilegetools,auditlogs,offlineevaluation,andstagedrolloutswithmonitoring.
PickaFramework(LangChain/LangGraphvsCrewAIvsAutoGen)
Question: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.
Question:WhyisLangGraphoftenrecommendedforproductionagents?
Answer:Itmodelsagentbehaviorasagraphwithnodes(steps)andedges(transitions),whichiseasiertoreasonaboutthanimplicitloops.Youcancheckpointstate,enforcepoliciesatboundaries,andaddretries.Thisimprovesdebuggabilityandpreventsrunawayconversations.Italsosupportshuman-in-the-looppatternsmorenaturally.
Question:Whatisthebiggestanti-patternwhenadoptingaframework?
Answer:Copy-pastingdemocodeandtreatingtheframeworkasthearchitecture.Frameworksareimplementationtools;architectureisyourstatemodel,toolboundaries,datacontracts,andsafetyrules.Ifyouskipfundamentals(schemas,errorhandling,evaluation),frameworkswillamplifychaos.Interviewerslovehearing“Istartsmallandhardenlayers.”
Question:Howdoyouhandlevendorlock-inconcerns?
Answer:AbstracttheLLMandembeddingprovidersbehindinterfaces.Avoidembeddingprovider-specificfeaturesunlessneeded.Keepprompts,schemas,andevaluationsetsportable.Ifusingaframework,isolateitinalayersocorebusinesslogicdoesn’tdependonit.Thenyoucanswapframeworksorproviderswithfewerchanges.
Question:Whatdoes“state”meaninanagentgraph?
Answer:Stateisthestructureddatathatflowsthroughsteps:userinput,conversationhistory,retrieveddocuments,toolresults,anddecisions.Goodstatedesignistypedandminimal.Itenablesreproducibility(replayarun),observability(inspecteachfield),andsafety(validatetransitions).Poorstatedesignleadstohiddencouplingandbrittlebehavior.
Question:Explainhowyouwouldimplementarouterthatchoosestools.
Answer:Useapolicy:eitherrules(keywords,intents)oranLLM-basedclassifierconstrainedtoasmalllabelset.Thenvalidatethechosentoolandargumentsagainstschemas.Logdecisionsandconfidence.Arobustpatternis:Router(decide)→ToolExecutor(act)→Verifier(check)beforeresponding.
Question:Howdoframeworkshelpwithoutputstructure(JSON,schemas)?
Answer:Theyprovideparsers,outputconstraints,andutilitiestoenforcestructuredoutputs.Evenwithoutbuilt-inhelpers,youcanwrapoutputswithPydanticvalidation.Ifparsingfails,theframeworkcanroutetoarepairstep.Ininterviews,mentionfail-closedbehavior:ifschemavalidationfails,donotexecuteactions.
Question:Howdoyoudebugagentsinsideaframework?
Answer:Startwithtraces:prompts,toolcalls,inputs/outputs,latency,andtokenusage.Reproducewithafixedseed/temperature.Thenisolatefailure:wasitretrieval,routing,tool
error,orpromptambiguity?Framework-specificdebuggershelp,butthecoreisobservability+replay.
Question:Whatisagoodmigrationpathfromanotebookdemotoproduction?
Answer:Extractcodeintoapackage,addconfigurationmanagement,andwraptheagentbehindanAPI.Introducetypedschemas,errorhandling,retries,andratelimits.Addevaluationharnesseswithasmallgoldendataset.Finallycontainerizeanddeploywithmonitoring.Thisstagedpathprevents“bigrewrite”failures.
Question:Whatisyourdefault“minimalstack”foragenticprototypes?
Answer:Python+FastAPI,asingleagentloop,asmallsetoftoolswithstrictschemas,avectorstore(orevenin-memory)forRAG,andbasictracing/logging.Whenbehaviorstabilizes,movetoanexplicitgraph(LangGraph),addaUI(Streamlit),andimplementevaluations.Thekeyisminimalmovingpartsatfirst.
AdvancedFrameworkConcepts(LCEL,Runnables,Workflows,Multi-Agent)
Question:WhatisLCELandwhydoengineersuseit?
Answer:LCEL(LangChainExpressionLanguage)composescomponents(prompts,models,parsers,tools)intopipelines.Itencouragesmodularity:youcanswapamodelorparserwithoutrewritingeverything.Italsomakescomplexchainsreadableandtestable.Ininterviews,highlightcompositionandobservabilitybenefits.
Question:Whatare“runnables”conceptually?
Answer:Arunnableisaunitthattakesinput,producesoutput,andcanbecomposedwithotherrunnables.Thinkofitasafunctionalpipelinebuildingblock.Thishelpsyoustandardizeexecution,logging,retries,andconcurrency.EvenoutsideLangChain,thesameideaapplies:uniforminterfacesforsteps.
Question:Howdoyoudesignaworkflowthatincludesretriesandfallbacks?
Answer:Classifyfailures(tooltimeoutvsinvalidargsvsmodelparsingerror).Fortransientfailures,retrywithexponentialbackoff.Forpersistentfailures,fallbacktosimplertoolsoraskaclarifyingquestion.Ingraphs,modelthisexplicitly:erroredge→repairnode→re-try.Logeachattempttoavoidinfiniteloops.
Question:Explain“multi-agent”vs“singleagentwithtools.”
Answer:Singleagentwithtoolsisonedecision-makercallingexternalfunctions.Multi-agentsplitsresponsibilities:e.g.,planner,retriever,executor,critic.Thiscanimprovespecializationandsafetybutincreasescoordinationcomplexity.Interviewerswanttohearthatyouonlygomulti-agentwhenthetasktrulybenefitsfromdecomposition.
Question:Whatisa“workflow”comparedtoa“chain”?
Answer:Achainisusuallylinear:stepAthenBthenC.Aworkflowincludesbranching,loops,humanapprovalsteps,anddifferentpathsfordifferentconditions.Agenticsystemsoftenneedworkflowsbecauserealtaskshaveuncertaintyandpartialfailures.LangGraph-likestatemachinesareanaturalfit.
Question:Howdoyoupreventagentsfromloopingforever?
Answer:Addmaximumsteps,timebudgets,and“stopconditions”basedontaskcompletionsignals.Trackrepeatedtoolcallsorrepeatedreasoningpatterns.Implementawatchdogthatforcesescalation:asktheuser,orreturnpartialresults.Inagraph,enforcetheseviastatecountersandguardedges.
Question:Whatis“structuredoutput”andwhyisitcriticalforagents?
Answer:Structuredoutputmeansthemodelproducesmachine-validateddata(JSONcon-formingtoaschema).Itpreventsbrittlestringparsingandreduceshallucinatedparameters.Italsoenablessafetoolexecution:onlyrunifschemavalidationpasses.Foragenticproducts,structuredoutputisoftenthedifferencebetweenademoandareliablesystem.
Question:Howdoyoudesigna“critic”orverifierstep?
Answer:Defineexplicitcriteria:citationpresent,toolresultsused,JSONvalid,constraintsmet.Usedeterministicchecksfirst(schemavalidation,regex,businessrules).Optionallyadd
anLLMjudgewitharubric,butkeepitasasecondlayer.Ifverificationfails,routetoarepairsteporaskforclarification.
Question:Whatarethetradeoffsofparallelizingagentsteps?
Answer:Paralleltoolcallsreducelatencybutcanwastecostifmanycallsareunnecessary.ParallelLLMcallsimprovequalityvia“self-consistency”butincreaseexpense.Youshouldparallelizewhereuncertaintyishighandresultsarereusable,andserializewheredecisionsdependonpriorresults.Alwayscapconcurrencyandhandleratelimits.
Question:Howdoyouhandlelong-runningtasks(minutes/hours)withagents?
Answer:Useasyncjobswithpersistentstate(DB/queue)andcheckpointaftereachstep.EmitprogresseventstotheUI.Designidempotenttoolcallssoretriesdon’tduplicatesideeffects.Forworkflows,model“resumefromcheckpoint”sothesystemcanrecoverafterrestarts.
MemoryManagement(Short-Term,Long-Term,Checkpointing)
Question:Whatisthedifferencebetweenshort-termandlong-termmemoryinagenticAI?
Answer:Short-termmemoryistheimmediateconversation/contextwindow:recentturns,tooloutputs,currenttaskstate.Long-termmemoryisstoredexternally:databases,vectorstores,userprofiles,summaries.Short-termisfastbutlimited;long-termisscalablebutneedsretrievalandrelevancefiltering.Engineeringischoosingwhattostoreandwhentoretrieve.
Question:Whenshouldyoustorememoryastextsummariesvsembeddings?
Answer:Usesummariesfor“whathappened”inasession(decisions,commitments,preferences).Useembeddingsforlargeknowledgewhereyouneedsemanticretrieval(notes,docs,pasttickets).Oftenyoucombineboth:asummaryforquickcontextplusembeddingsfordetailedrecall.Alsoconsiderstructuredmemory(key-value)forstablefactslikeauser’spreferredunitsorlanguage.
Question:Whatischeckpointingandwhyisitimportant?
Answer:Checkpointingsavesworkflowstateafterstepssoyoucanresumeafterfailures,timeouts,orhumanapprovals.It’scriticalforlong-runningagentsandforauditability.Agoodcheckpointincludesinputs,toolcalls,outputs,andaversionofprompts/policies.Thisenablesreplayanddebugging.
Question:Howdoyoupreventmemoryfromcausingprivacyorsecurityissues?
Answer:Applydataminimization:storeonlywhatyouneed.Encryptatrest,restrictaccessbytenant,andsetretentionpolicies.Avoidstoringsecrets,credentials,orsensitivePII.Ifyoumuststoreuser-specificmemory,giveuserstransparencyandcontrols.Alsosanitizetooloutputsbeforesaving.
Question:Whatis“contextbudgeting”formemory?
Answer:It’sdecidinghowmuchofthecontextwindowtoallocatetoinstructions,recentchat,retrieveddocs,andmemory.Youcanenforcebudgets:e.g.,max30%forretrieveddocs,max20%formemorysummary.Whenexceedingbudgets,compress:summarize,deduplicate,anddroplow-valuecontent.Abudgetpreventscriticalinstructionsfrombeingcrowdedout.
Question:Howdoyouevaluatewhethermemoryhelpsorhurts?
Answer:RunA/Btestswithandwithoutmemoryandcomparetasksuccess,hallucinationrate,andusersatisfaction.Memorycanhurtbyintroducingoutdatedorirrelevantfacts.Usefreshnessscoringandconflictresolutionrules.Ininterviews,mentionmonitoring“memoryhitrate”and“memory-inducederror”cases.
Question:Explain“recency”vs“relevance”inmemoryretrieval.
Answer:Recencyprioritizesnewerinfo;relevanceprioritizessemanticsimilarity.Inpracticeyoubalanceboth:retrievetopsemanticmatches,thenre-rankbyrecencyandtrust.Foruserpreferences,recencycanmatter(peoplechangetheirmind).Forstablefacts,relevancedominates.
Question:Howdoyouimplementmemoryformulti-agentsystems?
Answer:Decidewhatissharedvsprivate.Sharedmemorymightincludeataskplanandverifiedfacts;privatememorymightincludeaspecialistagent’sintermediatenotes.Use
structuredstatepassedthroughthegraphastheprimary“truth,”andstorelong-termartifactsexternally.Alwaysincludeprovenance:whereeachmemorycamefromandwhen.
Question:Whatarecommonfailuremodesoflong-termmemory?
Answer:Retrievingirrelevantchunks,storingnoisyorunverifiedinformation,andfeedbackloopswherehallucinationsgetstoredasmemory.Also:stalepreferencesandconflictingmemories.Mitigatewithvalidation(storeonlyverifiedfacts),decay/expiration,anda“donotstore”policyforuncertaincontent.Agoodruleis“onlystorewhatyoucanjustify.”
Question:Howdoyouhandleusercorrectionstomemory?
Answer:Treatusercorrectionsashighpriority.Updatestructuredmemoryfieldsandmarkoldentriesasdeprecatedratherthandeletingblindly(forauditability).Ifusingembeddings,storeanewcorrectivenoteandre-rankbyrecency.ExposeasimpleUI/commandforuserstoviewandeditwhatisremembered.
ToolIntegration(CustomTools,Connectors,Decorators)
Question:Whatmakesatool“agent-friendly”?
Answer:Clearname,narrowpurpose,typedinputschema,deterministicoutput,andfastfailure.Toolsshouldreturnstructureddata,notlongnarratives.Theyshouldenforcetimeoutsandreturnhelpfulerrorcodes.Agent-friendlytoolsareeasytotestandsafetocallrepeatedly.
Question:Howdoyousafelyexposetoolsthathavesideeffects(email,purchases,deletes)?
Answer:Useleastprivilegeandseparate“read”toolsfrom“write”tools.Requireexplicitconfirmationsforirreversibleactions.Addpolicychecksandhuman-in-the-loopapprovals.Logeveryactionwithinputs,outputs,anduseridentity.Ininterviews,emphasizethattheagentshouldneverdirectlyexecutehigh-riskactionswithoutguardrails.
Question:Explaintheroleofanallowlistandsandboxfortools.
Answer:Anallowlistlimitswhichtoolsthemodelcancall.Asandboxlimitswhatthosetoolscando(e.g.,restrictedfilesystem,networkegressrules).Togethertheyreducedamagefromhallucinatedtoolcallsorpromptinjection.Itisstandardtoblockarbitrarycodeexecutionunlesstheenvironmentisfullyisolatedandaudited.
Question:Howdoyoudesigntooloutputstominimizecontextbloat?
Answer:Returnonlywhattheagentneeds:concisefieldsandsummaries.Providepaginationor“top-k”results.StripHTML,logs,andirrelevantmetadata.Ifneeded,storelargerawoutputsexternallyandreturnashortreferenceID.Thiskeepsthecontextwindowfocusedandcheaper.
Question:Showaminimalexampleofacustomtoolwrapperfunction.
Answer:Keepitdeterministic,validated,andtimeout-safe.
importhttpx
frompydanticimportBaseModel
classSearchArgs(BaseModel):q:str
k:int=5
asyncdefweb_search(args:SearchArgs)->dict:
asyncwithhttpx.AsyncClient(timeout=10.0)asclient:
r=awaitclient.get("/search",params=args.model_dump())r.raise_for_status()
returnr.json()
Evenifyourframeworkhasdecorators,theengineeringprinciplesarethesame.
Question:Howdoyouhandletoolerrorssotheagentcanrecover?
Answer:Returnstructurederrors:code,message,andretryableflag.Forretryablefailures(timeouts),attemptagainwithbackoff.Fornon-retryableerrors(validation),askthemodeltorepairinputs.Alwayscapretriesandexposetheerrortologs/traces.Anagentthatcannotself-repairshoulddegradegracefullyandasktheuser.
Question:Whatisthedifferencebetween“tools”and“plugins/connectors”?
Answer:Toolsarecallablefunctionsinyourruntime.Connectors/pluginsoftenwrapexternalserviceswithauthanddiscovery(GoogleDrive,Slack,Jira).EngineeringconcernsincludeOAuthflows,tokenrefresh,andpermissionscopes.Ininterviews,stresspermissionboundaries:theagentcanonlyaccesswhattheuserauthorized.
Question:Howdoyouversiontoolsandkeepbackwardcompatibility?
Answer:TreattoolslikeAPIs.Versionschemas(e.g.,tool_v1,tool_v2)orsupportoptionalfields.Deprecategraduallyandmonitorusage.Inagents,pintoolversionsperworkflowsobehaviorisstable.Thispreventssilentbreakageswhentoolsevolve.
Question:Howdoyoupreventthemodelfromcallingtoolsunnecessarily?
Answer:Useexplicittool-usepolicies:“callatoolonlywhenyouneedexternaltruth.”Addaclassifierstepthatchooses“answerdirectly”vs“usetool.”Penalizeunnecessarytoolcallsinevaluation.Alsokeeptoolsexpensivebydefault:theagentlearnsthattoolsarescarceresources.
Question:Whatobservabilitysignalsaremostimportantfortoolintegration?
Answer:Toollatency,errorratebytool,retries,requestvolume,andoutputsizes.Alsotrackwhichtoolcallscorrelatewithsuccessfultaskcompletion.Addtracespanspertoolcallandincludesanitizedarguments.Thishelpsyoufindthebottlenecktoolorthetoolthatcausesmostagentfailures.
RAGSystems(VectorStores,Embeddings,RetrievalStrategies)
Question:WhatproblemdoesRAGsolveinagenticAI?
Answer:RAG(Retrieval-AugmentedGeneration)injectsexternalknowledgeintothepromptbyretrievingrelevantdocuments.Itreduceshallucinationsandenablesup-to-dateorprivateknowledgewithoutretraining.Foragentsystems,RAGalsoprovidesevidencefor
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 分布式光伏电站运维管理
- 医院会计核算和财务管理
- 苎麻面料印染固色工艺规范
- 临床列净类药物建议停用情况
- 2027届山东省济宁市任城区化学九上期中教学质量检测模拟试题含解析
- 合肥松芝万象城DE栋住宅项目营销方案40p
- 广东省廉江市实验学校2027届九年级化学第一学期期中综合测试模拟试题含解析
- 中考中《西游记》相关试题及答案
- (新)导游员聘用合同书
- 源自太空授课的物理试题和答案
- MIDASM32数字调音台说明书
- 10KV高压柜日常检查表模板
- 小学数学人教版五年级上册全册《新课预习单》(直接打印每生一份预习用)
- 子宫内膜癌的放射治疗
- 幼儿园教职工岗位安全培训
- 统编版小学六年级道德与法治上册 第二单元 我 学历案设计
- (人教2024版)九年级化学新教材新教材培训 课件(新标题、新框架、新内容、新理念、新思路)
- GB/T 44317-2024热塑性塑料内衬油管
- 酒店英语会话(第六版)教案全套 李永生 unit 1 Room Reservations -Unit 15 Handling Problems and Complaints
- DLT5196-2016 火力发电厂石灰石-石膏湿法烟气脱硫系统设计规程
- YYT 0294.1-2016 外科器械金属材料 第1部分:不锈钢
评论
0/150
提交评论