Posts

Featured

memory 2

my aim - makes notes for yourself that will help you to recall things in future,  don't go over explaining clearly, you are not writing a blog and your main goal is to understand yourself , you don't have to teach others.  What is LangGraph? LangGraph is an orchestration framework for building intelligent, stateful and multistep llm workflows. But what is orchestration framework, so its basically when we give a llm workflow, then langGraph try to represent that workflow in graph like this.  In each graph each node represent a task, that task can be anything like to call the llm, to make some decision making or tool task . and all these nodes are connected by edges, and these edges tells which node to execute next. LangGraph is not just limited to make graphs, it also gives many advanced features like parallelism , loops, branching, memory and resumability - making it ideal for agentic and production grade ai applications. LLM Workflow what is workflow? Workflow is a serie...

memory 1

 there are two types of memory - short term memory - only accessible within a thread only, agent manages this memory via state - so it goes in llm directly from state - long term memory - accessible in any thread, stored in databases, usually vector db - it first store the memory then goes to llm from stored db memory have three types - semantic memory- remembers the facts - episodic memory - remembers the previous steps, and decision history - procedural memory  - remembers the system instructions

How I Implemented Short Term memory in Kairo

Image
In short, we are storing summary in the database, we fetch summary from database before calling the agent, then pass that fetched summary to agent, agent response in context of that summary and then in background we summarise the new conversation ( user text, and ai response ) and push this new summary to the summary array in the database. Full steps fetch summary from database send that fetched summary to chat agent via context fetch the summary inside the agent in prompt  after getting ai response, summarise the ai response and user text and update the summary database - in background Step 1. Fetching the summary from database We are passing thread_id to get_summary function, using that thread_id we will find the summary in the database. If summary is present then return that fetched summary , if there is no any summary present with this thread id then we will return a blank string ' '. Step 2. Pass the fetched summary to Agent Summary that we get from get_summary, we will pa...

Time and Space Complexity

Image
What is Time Complexity? Time Complexity is rate of increase in time with respect to the input size. means on what rate, time is increasing when we increase the input size. for example if we double the input size then in what rate, time to execute that code will increase , will it also get doubled, will it get tripled. we call that rate the time complexity of our programme. we denoted it as big oh notation - o(  ) Rules of Time Complexity Always calculate time complexity in terms of worst case Avoid the constant values Ignore the lower bound Different types of Time Complexity Big oh ( o ) : worst case Theta (  ) : average case Omega ( ) : best case  Examples: What is Space Complexity ? Space complexity is the amount of memory an algorithm needs to run, as a function of the input size. It's also denoted by big oh notation (  ) Important Terms Auxiliary Space : the extra space used to solve the problem  Input Space : the space used to store the input For example ...