Redis
Redis (Remote Dictionary Server) is an open-source, in-memory key-value data store supporting multiple data structures including strings, lists, hashes, sets, and sorted sets. It is commonly used for caching, session management, message queuing, and real-time leaderboards. Redis is known for high performance and low latency, and supports data persistence, primary-replica replication, and cluster modes. It is widely adopted in internet backend architectures to improve system response speed and throughput.
Core Facts
Agent的记忆系统通常分为三个层次:工作记忆(当前对话上下文窗口)、短期记忆(近期交互历史)和长期记忆(通过向量数据库持久化存储)
Dify's core architecture adopts a microservices design, using Docker Compose to decouple and deploy components such as the API service, Worker, Web frontend, PostgreSQL, Redis, and vector database.
Enterprise-grade Agent systems typically introduce external memory modules (such as vector databases) to store long-term memory, in order to overcome context window limitations.
Timeline (last 90 days)
Financial idempotency must be anchored in the persistent storage layer, implemented through a unique constraint on transaction metadata, rather than in an application-layer Redis cache, because Redis keys may be evicted, the cluster may fail over, and the in-memory cache may be cleared during deployment.
In multi-instance or serverless environments, atomic increments (such as Redis's INCRBYFLOAT llmbrake:{month}:{customer} {cost}) should be used to achieve concurrency-safe cost storage, along with EXPIRE to automatically clean up old months' data.
Workers should derive the idempotency key from the workflow ID and step index, compute a SHA256 hash over run_id, step_index, and payload, check the in-memory key-value cache before executing side effects, and immediately return the cached result if the key already exists with a completed status.
Infrastructure software companies such as GitLab, Elastic, MongoDB, and Redis have all adopted or adjusted open-core or similar strategies.
n8n also provides memory solutions such as MongoDB Chat Memory, Postgres Chat Memory, and Redis, suitable for production scenarios that require persistence or cross-session memory.
RAG成本优化杠杆包括:嵌入模型换用本地BGE可省90%以上,向量数据库自托管可省80%,简单查询路由到小模型可省50-80%,高频查询加Redis缓存可省30-60%
LangGraph 应用的扩展方面建议保持节点无状态以支持水平扩展,用 Celery 或 RQ 做异步队列,对重复查询做 Redis 缓存。
When implementing a distributed lock with Redis, releasing the lock should use a Lua script to verify the holder's identity so as to avoid mistakenly deleting someone else's lock.
Infrastructure-level software such as Nginx, Redis and HAProxy is all written in the C language.
The "event-driven + non-blocking I/O" model is the key to why C projects such as Nginx and Redis can support high concurrency with extremely low resources.
40 more timeline events
All Facts (20)
Agent的记忆系统通常分为三个层次:工作记忆(当前对话上下文窗口)、短期记忆(近期交互历史)和长期记忆(通过向量数据库持久化存储)
80%VerifiedDify's core architecture adopts a microservices design, using Docker Compose to decouple and deploy components such as the API service, Worker, Web frontend, PostgreSQL, Redis, and vector database.
80%VerifiedEnterprise-grade Agent systems typically introduce external memory modules (such as vector databases) to store long-term memory, in order to overcome context window limitations.
75%VerifiedMongoDB is a document-oriented NoSQL database that stores data in a JSON-like BSON format.
70%VerifiedSession Service manages short-term memory at the conversation level (message history, tool call results, and intermediate reasoning states), while Memory Bank provides long-term memory capabilities across sessions.
65%VerifiedSalvatore Sanfilippo created the Redis project in 2009, originally to solve performance problems he encountered while developing the real-time web analytics system LLOOGG.
65%VerifiedLangGraph's long-term storage supports multiple backends, including PostgreSQL for structured data, vector databases such as Pinecone and Chroma for semantic retrieval, and Redis for high-speed caching.
65%UnverifiedRAGFlow基于Docker容器化部署,启动后运行五个容器:Redis、MinIO、MySQL、Elasticsearch和RAGFlow Server
95%UnverifiedCelery的核心架构由Producer、Broker和Worker三个组件构成,Broker通常使用Redis或RabbitMQ
95%Unverifiedantirez stepped down as Redis maintainer in 2020
90%Unverified防止重复扣费的幂等性实现方案包括数据库唯一约束、状态机检查、Redis分布式锁和乐观锁版本号
90%UnverifiedRedis 6.0后引入了I/O多线程,但命令执行仍然是单线程的
90%UnverifiedRedis的SCAN命令使用反向二进制迭代(reverse binary iteration)的游标推进算法
90%UnverifiedRedis 7.0后将紧凑内存编码格式统一为listpack
90%UnverifiedRedis在4.0版本(2017年)引入了模块系统(Modules API),允许第三方通过动态加载方式扩展自定义数据类型
90%UnverifiedRedis此前在KEYS和SCAN命令中使用的是简单的glob风格模式匹配,仅支持*、?、[]等通配符
90%Unverified请求频率限制可借助Redis原子操作或Kong、Nginx等网关中间件实现
90%UnverifiedRedis和Memcached等内存数据库存在的根本原因是数据库的磁盘I/O是性能瓶颈
90%Unverified热加载(Hot Reload)可以通过将配置存储在数据库或Redis中,配置变更时通过消息队列或轮询机制触发内存刷新来实现
90%UnverifiedHashiCorp、Redis等公司已将开源协议从Apache/MIT切换为BUSL等限制性协议
90%