text stringlengths 0 59.1k |
|---|
### Memory Management |
To make it remember conversations: |
```tsx |
import { LibSQLStorage } from "@voltagent/core"; |
const memoryStorage = new LibSQLStorage({ |
// configuration |
}); |
const agent = new Agent({ |
// ... other config |
memory: memoryStorage, |
}); |
``` |
And _voilà_! Now the agent stores previous conversations. |
:::tip Memory System |
Memory is the most precious part of agents. It brings consistency to the user relationship and allows personalization. |
::: |
<ZoomableMermaid |
chart={` |
%%{init: {'theme':'base', 'themeVariables': {'primaryColor': '#10b981', 'primaryTextColor': '#10b981', 'primaryBorderColor': '#10b981', 'lineColor': '#10b981', 'secondaryColor': '#ecfdf5', 'tertiaryColor': '#d1fae5', 'background': '#ffffff', 'mainBkg': '#ecfdf5', 'secondBkg': '#d1fae5', 'tertiaryBkg': '#a7f3d0'}}}%% |
sequenceDiagram |
participant U as User |
participant A as Agent |
participant M as Memory |
participant DB as Database |
Note over U,DB: First Conversation |
U->>A: Hello I'm Alex |
A->>M: Save conversation |
M->>DB: INSERT conversation |
A->>U: Hello Alex nice to meet you |
Note over U,DB: Second Conversation 1 hour later |
U->>A: What did we talk about yesterday? |
A->>M: Get user history |
M->>DB: SELECT conversations WHERE user Alex |
DB-->>M: Previous conversations |
M-->>A: Past conversations |
A->>U: Hello Alex! We met yesterday welcome back |
`} |
/> |
Without memory, each conversation must start all over again. Even if the user says "we talked about this yesterday," the agent would respond with "Who are you?" Terrible experience! |
### VoltOps LLM Observability Platform: Game Changer |
We built VoltOps LLM Observability Platform to solve a critical problem in agent development. With it, you can visually inspect your agents: |
- Preview conversation flows |
- Debug calls to tools |
- Track performance metrics |
- Catch mistakes with ease |
It's _vital_ to understand what your agent is doing in production. |
:::caution Important for Production |
Operating an agent in production without VoltOps LLM Observability Platform is akin to driving blindfolded. Use it definitely for debugging and optimization. |
::: |
## Best Practices (From My Experience) |
:::important Critical Success Factors |
These are practices acquired from my experience; guidelines you absolutely must follow to be successful with agent projects: |
::: |
**Define your agent's personality well.** |
Instead of generic statements like "be helpful," get concrete. "Be a patient, friendly assistant who gives complete explanations" is so much better. Paint the personality of the agent alive. |
**Choose tools wisely.** |
Steer clear of the trap of supplying tools for everyone. Include only the features that you really need. Too many tools confuse the agent, too few leave the agent wanting. |
**Never leave out error handling.** |
APIs can fail, network outages can happen, you can hit rate limits. The agent has to handle these situations _gracefully_. Otherwise, the user experience is terrible. |
**Monitor costs at all times.** |
Each tool call translates to tokens, tokens translate to money. You will be shocked when you get the bill if you release without monitoring. I have been a victim of this in the past. |
**Test, test, test!** |
Think about edge cases. Plan what happens when the agent encounters bizarre scenarios. Take your mind to the "What if the user does something idiotic?" place and experiment. |
## The Future: Where Is This Going? |
**Hint: It's Not One Agent**: |
Not just one agent, but agents talking to other agents. One researches, another analyzes, a third writes reports. |
**More Powerful Reasoning**: |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.