Một mục tích hợp AI trong kho dữ liệu GitHub của TopGit: assafelovic/tovana, 39 sao, nhóm AI Tools, Python. Memory management system to enhance AI agents with personalized, reasoned and context-aware responses
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Tovana is a library powered by Tovana that introduces a new approach to improving LLM reasoning through actionable insights (aka beliefs) derived from continuous interactions and long term memory.
🤔 Why Tovana?
Current LLMs face significant limitations in their ability to learn and adapt from user-specific interactions over time. While LLMs excel at processing vast amounts of data, they struggle with ongoing personalization and context-aware learning. This gap restricts their ability to provide truly adaptive and evolving AI experiences.
Our Memory manager aims to address these challenges by providing a comprehensive memory and belief management framework for AI agents. Its core concept revolves around converting experiences (events) into memories, which in turn shape beliefs. These beliefs then influence the agent's reasoning, responses, and actions.
By simulating human-like memory processes, GPT Memory enables more personalized, adaptive, and context-aware AI interactions. This framework bridges the gap between static knowledge bases and dynamic, experience-based learning, allowing AI agents to evolve their understanding and behavior over time.
🚀 Quick Start
Install Tovana:
pip install tovana
Use it in your project:
from tovana import MemoryManager
business_description = "a commerce shopping assistant"
# Initialize with your preferred LLM provider and API key (Refer to the documentation for specific models)
memory_manager = MemoryManager(api_key="provider-api-key",
provider="openai",
business_description=business_description,
include_beliefs=True)
Manage your LLMs memory with ongoing user conversation messages:
user_id = "user123"
message = "I just moved from New York to Paris for work."
# Update user memory
memory_manager.update_user_memory(user_id=user_id, message=message)
print(user_memory) # Output: {'location': 'Paris', 'previous_location': 'New York'}
# Get memory context for LLM
context = memory_manager.get_memory_context(user_id=user_id)
print(context) # Output: 'User Memory:\n location: Paris,\n previous_location: New York'
# Get beliefs
beliefs = memory_manager.get_beliefs(user_id=user_id)
print(beliefs) # Output: {"beliefs": "- Provide recommendations for products shipping to Paris"}
🏗️ Architecture
🧠 Belief Generation
GPT memory introduces a new approach to LLM reasoning: actionable beliefs generated from user memory. These beliefs provide personalized insights that can significantly enhance your agent's planning, reasoning and responses.
Examples
Input:
business_description: "a commerce site"
memory: {'pets': ['dog named charlie', 'horse named luna']}
Output:
{"beliefs": ",- suggest pet products for dogs and horses"}
Input:
business_description: "an AI therapist"
memory: {'pets': ['dog named charlie', 'horse named luna', 'sleep_time: 10pm']}
Output:
{"beliefs": ",- Suggest mediation at 9:30pm\n- Suggest spending time with Charlie and Luna for emotional well-being"}
🌟 Features
Feature
Status
Description
🧠 Human-like Memory
✅
Transform interactions into lasting memories and actionable beliefs
🔍 Smart Information Extraction
✅
Automatically capture and store relevant user details from conversations
💡 Dynamic Belief Generation
✅
Create personalized, context-aware insights to guide AI responses
🤖 LLM-Friendly Context
✅
Seamlessly integrate memory and beliefs into your AI's decision-making process
🔌 Easy Integration
✅
Plug into your AI applications with a straightforward API
🎭 Conflict Resolution
✅
Intelligently handle contradictions in user information
🌐 Flexible Architecture
✅
Designed to work with various LLM providers and models
📊 Memory Management
✅
Process events, store short-term and long-term memories, and manage beliefs
🔗 Advanced Association Creation
✅
Form connections between memories and beliefs for more nuanced understanding
🧵 Async Functionality
✅
Support for asynchronous operations to enhance performance in concurrent environments
⛁ Persistent Database Support
🔜
Integration with persistent databases for long-term storage and retrieval of memory data
🎛️ Custom Belief Generation
🔜
User-generated beliefs offering end-to-end flexibility in shaping the belief system reasoning
🛠️ API Reference
MemoryManager
get_memory(user_id: str) -> JSON: Fetch user memory
delete_memory(user_id: str) -> bool: Delete user memory
update_memory(user_id: str, message: str) -> JSON: Update memory with relevant information if found in message
batch_update_memory(user_id: str, messages: List[Dict[str, str]]) -> JSON: Update memory with relevant information if found in message
get_memory_context(user_id: str, message: Optiona[str]) -> str: Get formatted memory context, general or message specific
get_beliefs(user_id: str) -> str: Get actionable beliefs context
Batch Update Memory
Traditional per-message memory updates can be costly and inefficient, especially in longer conversations. They often miss crucial context, leading to suboptimal information retrieval.
Our batch memory update method addresses these challenges by processing entire conversations at once. This approach not only improves performance and reduces costs but also enhances the quality of extracted information. This results in a more coherent and accurate user memory, ultimately leading to better AI reasoning.
Example
user_id = "user123"
messages = [
{"role": "user", "content": "Hi, I'm planning a trip to Japan."},
{"role": "assistant", "content": "That's exciting! When are you planning to go?"},
{"role": "user", "content": "I'm thinking about next spring. I love sushi and technology."}
]
await memory_manager.batch_update_memory(user_id, messages)
Sync vs Async Updates
This library provides both synchronous and asynchronous update methods to cater to different use cases and application architectures:
Asynchronous Updates (AsyncMemoryManager): Ideal for applications built on asynchronous frameworks like FastAPI or asynchronous Python scripts. This allows for non-blocking memory updates, improving overall application performance, especially when dealing with I/O-bound operations or high-concurrency scenarios.
Synchronous Updates (MemoryManager): Suitable for traditional synchronous applications or when you need to ensure that memory updates are completed before proceeding with other operations. This can be useful in scripts or applications where the order of operations is critical.
By providing both options, our library offers flexibility, allowing to choose the most appropriate method based on your specific application requirements and architecture.
🤝 Contributing
We welcome contributions! Found a bug or have a feature idea? Open an issue or submit a pull request. Let's make Tovana even better together! 💪
📄 License
Tovana is Apache-2.0 licensed. See the LICENSE file for details.
Ready to empower your AI agents with memory-driven reasoning? Get started with GPT Memory! 🚀 If you find it useful, don't forget to star the repo! ⭐
assafelovic/tovana có 39 sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/assafelovic/tovana. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
assafelovic/tovana có phải mã nguồn mở không?
Có — assafelovic/tovana phát hành theo license MPL-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/assafelovic/tovana.
assafelovic/tovana có trang demo không?
Dự án có trang chủ ở https://tovana.dev. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
assafelovic/tovana là gì?
assafelovic/tovana (assafelovic/tovana) là dự án Python trên GitHub. Theo mô tả gốc: Memory management system to enhance AI agents with personalized, reasoned and context-aware responses
assafelovic/tovana so với các dự án AI Tools khác thế nào?
assafelovic/tovana được TopGit xếp vào nhóm AI Tools, với 39 sao GitHub và viết bằng Python. Xem trang chủ đề AI Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Cùng nhóm AI Tools còn repo nào?
assafelovic/tovana thuộc nhóm AI Tools trên TopGit, cùng 5 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về assafelovic/tovana ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/assafelovic/tovana là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về tovana?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về tovana.