MyTaskManager is an LLM-powered task management agent built with LangGraph that maintains structured user memory across conversations.
Instead of treating every conversation as an isolated interaction, MyTaskManager can remember important information about the user, manage tasks, and retain user-specific instructions. This enables more personalized, context-aware, and stateful interactions.
The project demonstrates how LLMs, LangGraph workflows, structured memory, tool calling, and schema validation can be combined to build a practical memory-enabled AI agent.
- π§ Long-Term Memory β Maintains useful information across conversations.
- π¬ Short-Term Conversational State β Preserves context within a conversation thread.
- π€ Profile Memory β Stores structured information about the user.
- β Task Memory β Creates and manages structured to-do items.
- βοΈ Instruction Memory β Remembers user-specific instructions and preferences for how tasks should be handled.
- π Conditional Agent Routing β Uses LangGraph to dynamically route memory operations.
- π§© Structured Memory Extraction β Uses Pydantic schemas for structured information.
- π Memory Updating β Updates existing memories instead of treating every interaction as a new memory.
- π οΈ Tool-Based Memory Management β Allows the LLM to determine when a memory operation is required.
- π Cyclic Agent Workflow β Updates memory and returns control to the agent for continued reasoning.
βββββββββββββββββββ
β User β
ββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββββ
β MyTaskManager β
β LangGraph β
βββββββββββ¬βββββββββββ
β
ββββββββββββ΄ββββββββββββ
β β
βΌ βΌ
Retrieve Memory User Request
β β
ββββββββββββΌβββββββββββ β
β β β β
βΌ βΌ βΌ β
Profile ToDo Instructions β
β β β β
ββββββββββββΌβββββββββββ β
β β
ββββββββββββ¬ββββββββββββ
βΌ
βββββββββββββββββ
β LLM β
β Reasoning β
βββββββββ¬ββββββββ
β
Memory Update Required?
β
ββββββββββββββββΌβββββββββββββββ
β β β
βΌ βΌ βΌ
Profile ToDo Instructions
Update Update Update
β β β
ββββββββββββββββΌβββββββββββββββ
βΌ
ββββββββββββββββββββββ
β Structured Memory β
β Update β
βββββββββββ¬βββββββββββ
β
βΌ
ββββββββββββββββ
βMyTaskManager β
ββββββββ¬ββββββββ
β
βΌ
Final Response
A key design principle of MyTaskManager is the separation between short-term conversational state and long-term user memory.
MyTaskManager
β
ββββββββββββββ΄βββββββββββββ
β β
βΌ βΌ
Short-Term State Long-Term Memory
β β
βΌ βββββββββΌβββββββββ
Conversation Profile ToDo Instructions
Short-term state contains information required to maintain the current conversational flow.
It is associated with the current LangGraph thread/conversation.
Long-term memory contains information that can remain useful beyond the current conversation.
MyTaskManager separates this information into different memory categories:
Profile
ToDo
Instructions
This separation makes memory easier to reason about, update, and retrieve.
Profile memory stores relatively stable information about the user.
Examples include:
Name
Location
Job
Interests
Connections
A structured schema allows the agent to represent this information consistently.
Example:
class Profile(BaseModel):
name: Optional[str]
location: Optional[str]
job: Optional[str]
connections: list[str]
interests: list[str]To-do memory represents actionable tasks and their current state.
A task can contain:
Task
Time to complete
Deadline
Possible solutions
Status
Supported task states include:
not started
in progress
done
archived
Example:
Task:
Complete RAG project
Deadline:
Friday
Status:
in progress
This allows the agent to maintain task context across conversations.
Instruction memory captures how the user wants the agent to behave.
For example:
"When I create a large task, break it into smaller subtasks."
This differs from profile memory.
Profile Memory
β
Facts about the user
To-Do Memory
β
Things the user needs to accomplish
Instruction Memory
β
How the agent should behave
This separation allows MyTaskManager to personalize its behavior over time.
The main agent follows a cyclic workflow.
User
β
LangGraph Agent
The agent receives the user's message along with relevant conversational context.
The agent accesses the user's stored memory categories:
Profile
ToDo
Instructions
The retrieved information becomes additional context for the LLM.
The LLM determines what should happen next.
Conceptually:
User Message
β
βΌ
LLM
β
ββββββββββ΄βββββββββ
β β
βΌ βΌ
No memory update Memory update
β β
βΌ βΌ
Reply Determine type
β
ββββββββΌβββββββ
βΌ βΌ βΌ
Profile ToDo Instructions
LangGraph routes the request to the appropriate memory-update node.
Memory Decision
β
βββ profile ββββββββΊ Profile Update
β
βββ todo βββββββββββΊ ToDo Update
β
βββ instructions ββΊ Instruction Update
The selected memory is updated using structured schemas rather than storing arbitrary unstructured text.
After the memory operation completes, the workflow returns to the main agent.
Memory Update
β
βΌ
Main Agent
β
βΌ
Final Response
This cyclic structure allows the agent to incorporate the newly updated memory into its subsequent reasoning.
MyTaskManager uses Pydantic models to define the structure of stored information.
This provides:
- Schema validation
- Consistent data representation
- Predictable LLM outputs
- Easier memory updates
- Better downstream processing
Instead of relying entirely on free-form text:
"Suman is interested in AI and has a project."
the system can represent information through structured fields.
Profile
βββ name
βββ location
βββ job
βββ interests
βββ connections
A simple LLM application follows:
User β LLM β Response
This becomes difficult when an application needs:
- State
- Memory
- Conditional routing
- Tool calls
- Multiple processing stages
- Iterative workflows
LangGraph allows these operations to be represented explicitly as a stateful graph.
ββββββββββββββββ
β Agent β
ββββββββ¬ββββββββ
β
βΌ
Decision Node
β
ββββββββΌβββββββ
βΌ βΌ βΌ
Profile ToDo Instructions
β β β
ββββββββΌβββββββ
βΌ
Agent
This makes the workflow easier to extend and debug.
| Technology | Role |
|---|---|
| Python | Core implementation |
| LangGraph | Stateful agent orchestration |
| LangChain | LLM application framework |
| OpenAI | Large Language Model |
| Pydantic | Structured schemas and validation |
| Trustcall | Structured memory extraction and updates |
| LangGraph Checkpointing | Short-term conversational state |
| LangGraph Store | Long-term memory |
| Jupyter Notebook | Development and experimentation |
MyTaskManager/
β
βββ mytaskmanager.ipynb
βββ README.md
βββ .gitignore
The primary implementation is currently provided in:
mytaskmanager.ipynb
git clone https://github.com/SKR18156592/MyTaskManager.git
cd MyTaskManagerpython -m venv .venvsource .venv/bin/activate.venv\Scripts\activatepip install langchain langgraph langchain-openai trustcall pydanticSet your OpenAI API key as an environment variable.
export OPENAI_API_KEY="your-api-key"setx OPENAI_API_KEY "your-api-key"Never commit API keys or .env files containing secrets to GitHub.
Open:
mytaskmanager.ipynb
using Jupyter Notebook, JupyterLab, or VS Code.
Run the cells sequentially to initialize the agent and interact with MyTaskManager.
User:
My name is Suman and I'm preparing for an AI Engineer role.
The agent can identify relevant profile information and store it as structured memory.
User:
Add "finish my RAG project" to my tasks.
The agent can create a structured to-do item.
User:
Whenever I have a large task, break it into smaller subtasks.
The agent can store this as an instruction.
User:
What should I work on today?
The agent can use previously stored task and user context to provide a personalized response.
MyTaskManager demonstrates practical implementation of:
- Large Language Models
- AI Agents
- Stateful AI workflows
- LangGraph
- LangChain
- Long-term memory
- Short-term conversational state
- Structured memory
- Pydantic schemas
- Tool calling
- Conditional routing
- Memory extraction
- Memory updating
- Personalized AI assistants
- Agentic workflow design
Short-term conversation state and long-term user memory serve different purposes.
Short-Term State
β
Current conversation
Long-Term Memory
β
Information useful across conversations
Rather than repeatedly passing the entire conversation history to the LLM, useful information can be extracted into structured memory.
Conversation
β
βΌ
Information Extraction
β
βΌ
Structured Memory
β
βΌ
Future Retrieval
The LLM handles semantic reasoning while LangGraph controls the execution flow.
LLM
β
Decide
β
LangGraph
β
Route
β
Execute Memory Operation
This separation makes the overall system more controllable.
The current architecture provides a foundation for a more production-oriented memory system.
Planned improvements include:
Move beyond an in-memory development store toward persistent storage.
In-Memory Store
β
Production Database
For larger memory collections, introduce embedding-based retrieval.
User Query
β
Embedding
β
Vector Search
β
Relevant Memories
β
LLM
Combine semantic retrieval with lexical retrieval for better recall.
Query
β
βββββββββ΄ββββββββ
βΌ βΌ
Semantic Search Keyword Search
β β
βββββββββ¬ββββββββ
βΌ
Reranking
β
βΌ
Relevant Memory
Detect whether newly extracted information already exists before creating another memory.
Handle contradictory information.
Existing:
Location = Delhi
New:
Location = Bengaluru
The memory system should determine whether the new information supersedes the old information.
Classify memories according to their usefulness:
High Importance
Medium Importance
Low Importance
Temporary
This can prevent unnecessary information from accumulating.
Some memories become stale and should eventually be removed or updated.
Examples:
Temporary deadline
Current project
Short-term preference
A production-grade memory system should be evaluated using metrics such as:
Memory Extraction Accuracy
Memory Update Accuracy
Memory Retrieval Precision
Memory Retrieval Recall
Duplicate Memory Rate
Conflict Resolution Accuracy
Latency
Token Usage
Most basic LLM applications follow:
Prompt β LLM β Response
MyTaskManager explores a more capable architecture:
User
β
βΌ
Stateful Agent
β
βββ Reason
βββ Retrieve Memory
βββ Decide
βββ Update Memory
βββ Respond
β
βΌ
Personalized Interaction
The goal is to move from a stateless chatbot toward a memory-enabled AI agent capable of maintaining useful context over time.
M.Tech β IIT Kharagpur
Interested in:
- Artificial Intelligence
- Machine Learning
- Generative AI
- Large Language Models
- AI Agents
- Retrieval-Augmented Generation
- Agent Memory Systems
GitHub: https://github.com/SKR18156592/MyTaskManager
If you find the project useful, consider giving it a β.
MyTaskManager is a LangGraph-based stateful AI task-management agent that combines LLM reasoning, structured long-term memory, conditional workflow orchestration, and personalized user context to create more capable conversational task management.