Tech Dive (@techhdive) header
Tech Dive (@techhdive) profile picture

helping engineers understand how systems scale, fail & recover in production.

Joined March 2023
Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)Photo by Tech Dive (@techhdive)
corporate parties are just a way to make employees feel they're at a great place in exchange for free alcohol and dinner once every 6 months.
1
1
51
Tech Dive retweeted
if your agent does multiple operations, then you need a failure strategy as well. let's say your agent: - creates an order - reserves the item - charges the user - schedules delivery now let's say scheduling delivery fails, but the user has already been charged. you can't treat all these operations as a single transaction. instead, each operation should have a corresponding compensating operation. for example: - create order ➡️ cancel order - reserve item ➡️ release item - process payment ➡️ initiate refund this way, if a later step fails, you execute the required compensating operations for the steps that were already successful. one thing to understand is that this isn't a db rollback. it's another business operation and that operation can fail too.
6
1
4
183
would employees who resigned because Jensen was no longer the CEO be rehired?
2
117
regardless of whether you're building an ecommerce, social media or AI application, debugging a failed request starts with tracing its entire path. this is what observability is. in AI applications such as RAG systems, it's not different. if you're getting incorrect answers, you need to know what happened at each step of the pipeline. so you should be able to inspect things like: - the original and rewritten query - retrieved chunk IDs, relevance scores and ranks - results before and after reranking - exact context passed to the LLM - latency at each stage of the pipeline - errors and retry attempts as you debug more and more, you'll get to know what else you need to add to your tracing. so when something goes wrong in your RAG pipeline, you should be able to identify whether: - retrieval failed - context construction failed - generation failed - or something went wrong at another stage more granular your traces are, easier it becomes to understand what happened at each step and find the actual issue.
3
5
103
if you keep vibe coding long enough, you'll definitely forget how to program
Unpopular opinion: if you keep vibe coding long enough, you'll accidentally learn how to program.
2
5
156
keep your day fun, because even if you are worried or stressed, it won't add much value to your day. either do what is causing the stress or just forget about it and enjoy. don't get stuck in between.
3
158
when building APIs, we validate the input data before processing it. but with AI agents, people stop at checking whether the LLM returned valid JSON. this is wrong because the response format could be correct, but the actual values still need separate validation. this is a basic backend rule. before processing any request, you need to validate the data as per your business rules and make sure no important information is missing. checking schema correctness is necessary, but you can't ignore the actual information being returned. if you don't validate it, you could end up corrupting your database or providing incorrect output.
5
6
279
i'm sure you don't want to make this mistake in your RAG application. in your RAG application, if you want users to view only the information they have access to, then your access check must happen before the retrieved content is passed to the LLM. if you first retrieve the information and let the LLM remove the restricted content for the user, then you've already exposed that information to the model. there's no guarantee that it won't use it when generating the final answer. the right flow is: - authenticate the user - resolve their permissions on the backend - apply access control during retrieval - retrieve only the documents they're authorized to access - pass those documents to the LLM this is the flow you want to follow. to do this, you need to handle how chunks are tagged with access permission meaning access control metadata should be stored with every chunk so you can filter them during retrieval. this way, access control is enforced during retrieval itself, rather than relying on the LLM to filter out restricted information.
1
1
60
Tech Dive retweeted
you use embedding models to convert text into vectors. to store these vectors for fast retrieval, you can use chroma db or postgres with the pgvector extension. when a user asks a question, you convert the query into a vector using the same embedding model and compare it against the stored vectors to find the closest matches. these matches can then be used as relevant context for the LLM before it generates a response. that's the basic idea behind retrieval augmented generation (RAG)
1
1
63
average people don't even try to escape their current miserable life. if you are trying, you are not average for sure
1
48
when you provide a long context to an LLM and the relevant information sit somewhere in the middle. the model may not use it as effectively, even though you've provided all that context. more context ≠ better response. apart from this, as you provide more context to your LLM, cost and latency also start to matter. a good way to decide: - small dataset that rarely changes: use a long context window, its simpler and easier to manage. - large dataset that changes frequently: use rag to fetch only the information needed. - questions requiring information from multiple documents: use a hybrid approach. retrieve relevant information using RAG, include some surrounding context and let the LLM reason over it. it's a decision about what information the model actually needs, how much it will cost to send and how well it uses what you send.
5
3
36
having a proactive frontend team is a must. when they don't fully understand how the payload changes across different scenarios, it literally drags the entire team behind. overall product delivery does get delayed. the same applies to backend, but i've experienced this recently with the frontend team.
1
4
even if your AI agent passes evaluation, does that mean it's reliable? not as a rule. agent behaviour can vary between runs. the same task can succeed once and can fail the next time and its because of inconsistent model decisions, tool responses and execution path. so even if your evaluation passes in the first run that's just not the end. for this reason, agent evaluation includes multiple runs. for customer facing applications consistency is something you would not like to compromise on. a practical approach is : - run the same evaluation task multiple times - track success and failure cases across all runs - measure the variation in results - investigate the task where it behaves inconsistently if agent succeed in first run, it shows it can complete the task and if it behaves as expected continuously across multiple runs, then you have more confidence in its reliability.
1
2
20
how you are being perceived at your workplace is quite evident by the fact that how well people listen you.
2
39
when should you actually introduce multiple agents into your system? the thing is a single agent with the right tools can handle many workflows without adding any complexity of multi-agent architecture. so when do we need multiple agents in our system? there are a few patterns - parallel agents : you use it when a task can be divided into multiple independent sub tasks. - orchestrator : you use it when you want to delegate subtasks to individual specialised agents, like inspect codebase agent, implementation agent , etc in a coding agent - handover to next agent : when one agent passes its output to another agent, which then takes over the next part of the task but having additional agents do add more model calls, latency, token usage and coordination overhead. also you need to take care of context sharing and conflicting outputs. that's why i would start with a single agent and introduce more when there is a clear reason.
2
4
84
If your employer mandates a certain number of hours in the office, say 8 hours and you get your work done in 5 or 6, you end up just sitting around to clock the remaining hours. and if get into a relationship then hitting 8 or even 10 hours becomes easy.
1
50
to build an evaluation dataset for your AI agent, you need to think about how to test different possible behaviours. say you're building a refund agent. your dataset should cover things like: - eligible refunds - expired refund windows - missing order details - failed verification - service failures - and many other scenarios each test case should define the initial state, expected outcome and conditions for success. you also need to verify what actually happened. was the refund processed? was the amount correct? were all the required checks completed? you should also validate the execution path and check if the agent followed the expected steps. start with 20-30 case of critical user flows and known failures, then expand the dataset as you come across new scenarios.
3
2
74
If you are passing an unfinished task to another engineer, make sure you cover these 6 things: - current state: what's working and what's not? - what you've tried: what approaches have you already explored? - evidence: relevant logs, dashboards, pr links or error messages. - what you've ruled out: which possible causes can the next person stop investigating? - what's still unknown: where exactly are you stuck? - next step: what would you investigate or try next? one more thing is to clearly separate what you've verified from what you suspect. this makes it easier for the next person to pick things up without starting from scratch.
1
33
how do you decide the right chunk size for your RAG pipeline? chunk size affects retrieval quality and how you split documents into chunks matters. if a chunk is too small, it may contain useful information but lose important context from the paragraph. if the chunk size is too large, it may combine multiple unrelated topics into a single embedding, which can reduce retrieval accuracy. there are different ways to approach this: - fixed size chunking: split chunks using a defined token or character limit. - recursive chunking: try splitting paragraphs first, then lines, sentences or words until the chunks fit the configured size. - structure aware chunking: use document structure, such as headings and sections, to create meaningful chunks. - semantic chunking: use semantic similarity between sentences to identify topic changes and decide where to split. also, to preserve context, a portion of one chunk is repeated in the next. this is called chunk overlap. each approach has its own tradeoffs. you should choose based on your use case and test different chunk sizes and strategies against actual queries to see what works best.
5
3
81
when evaluating an agent, there can be multiple ways to complete the same task. for example, a customer support agent processing a refund needs to: - retrieve order details - check refund policy - verify eligibility - process refund if approved now your evaluation expects these exact tool calls in the exact order. but your agent independently checks the refund policy and retrieves order details. the task was completed correctly, but your evaluation marks it as a failure because the agent took a different path. so you need to evaluate things like: - outcome: if the user's task was completed correctly - constraints: if the agent respected permissions, policies and required conditions - trajectory: if the tool calls were reasonable and necessary this doesn't mean tool order never matters, but when there are multiple ways to do it, all are fine. it's simple: don't enforce one expected path when multiple paths are valid.
2
1
137