let's think step by step in depth on how to create from scratch a langchain framework…
- User
let's think step by step in depth on how to create from scratch a langchain framework called ATBmemoryAGI that will be an intelliggent memory management system to empower ai assistants so they become self improving , learn and evolve from past interactions with users , here is the logic of the framweork "Case Study: Contextual Memory in Action
To better understand the Contextual Memory module and its practical application, let's consider a hypothetical scenario where CrewAI is used to manage a software development project.
- Scenario
Imagine you are the project manager of a software development team working on a new mobile application. You have decided to use CrewAI to help manage the project, assign tasks, and provide contextual information to team members.
- Initial Setup
You set up CrewAI with the necessary memory modules: Short-Term Memory, Long-Term Memory, and Entity Memory. You also configure the Contextual Memory module to interact with these memory modules.
- Task Assignment
One of the tasks in your project is to implement a new feature in the mobile application. You assign this task to a team member, Alice, using CrewAI. The task description is as follows:
Task: Implement the new 'Share Location' feature in the mobile application.- Contextual Memory in Action
When Alice receives the task, she wants to understand the context and any relevant information related to the task. She uses the Contextual Memory module to build the context for the task.
a.
build_context_for_task: Alice calls thebuild_context_for_taskmethod with the task description and an empty context string. The method creates a query by combining the task description and the context string:query = f"{task.description} {context}".strip() # query = "Implement the new 'Share Location' feature in the mobile application"b.
_fetch_ltm_context: The method calls_fetch_ltm_contextto retrieve historical data or insights from Long-Term Memory related to the task. The Long-Term Memory module searches for relevant information and returns the following results:Historical Data: - The 'Share Location' feature was discussed in the project kickoff meeting. - The feature should use the device's GPS to share the user's location with their contacts.c.
_fetch_stm_context: The method then calls_fetch_stm_contextto retrieve recent relevant insights from Short-Term Memory. The Short-Term Memory module searches for relevant information and returns the following results:Recent Insights: - The 'Share Location' feature should be implemented using the device's native location services. - The feature should include a privacy setting to allow users to control who can see their location. - Assistant
- User
start building
- Assistant
- User
i one to use sqlite, start building the project from scratch
- Assistant
- User
start creating the scripts in details using langchain
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.