Skip to content

Commit 96135d4

Browse files
committed
docs: remove all Redis references, update documentation
- Remove docs/redis-caching.md - Update README.md (architecture, env vars, tech stack) - Update docs/README.md and docs/docker-setup.md - Update docker-compose.yml (remove redis service) - Rename RedisCache to MemoryCache in code - Update tests to remove redis mocks
1 parent 83a8875 commit 96135d4

17 files changed

+242
-323
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,4 @@ repos:
2323
- id: mypy
2424
additional_dependencies:
2525
- pydantic
26-
- types-redis
2726
args: [--ignore-missing-imports]

README.md

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The agent autonomously:
100100
│ └─────────────────────────────────────────────────────────────────┘ │
101101
│ │
102102
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
103-
│ │ Qdrant │ │ Redis │ │ Groq │ │
103+
│ │ Qdrant │ │ In-Memory │ │ Groq │ │
104104
│ │ Vector DB │ │ Cache │ │ LLM API │ │
105105
│ └─────────────┘ └─────────────┘ └─────────────┘ │
106106
│ │
@@ -194,11 +194,8 @@ The agent autonomously:
194194
│ │ │ │ Port 8000 │ │ Polling │ │ Port 6333 │ │ │ │
195195
│ │ │ └──────┬──────┘ └──────┬──────┘ └─────────────┘ │ │ │
196196
│ │ │ │ │ │ │ │
197-
│ │ │ │ Internal │ ┌─────────────┐ │ │ │
198-
│ │ │ │◄── Network ──┤ │ Redis │ │ │ │
199-
│ │ │ │ │ │ (Cache) │ │ │ │
200-
│ │ │ │ │ │ Port 6379 │ │ │ │
201-
│ │ │ │ │ └─────────────┘ │ │ │
197+
│ │ │ │ Internal │ │ │ │
198+
│ │ │ │◄── Network ──┤ │ │ │
202199
│ │ │ │ │ │ │ │
203200
│ │ └─────────┼────────────────┼──────────────────────────────┘ │ │
204201
│ │ │ │ │ │
@@ -298,7 +295,7 @@ cp .env.example .env
298295

299296
```bash
300297
# Start infrastructure
301-
docker-compose up -d qdrant redis
298+
docker-compose up -d qdrant
302299

303300
# Start API server
304301
uvicorn src.api.main:app --reload --port 8000
@@ -389,7 +386,6 @@ uv run mypy src/
389386
| `GROQ_API_KEY` | Yes | Groq API key (free tier) |
390387
| `TELEGRAM_BOT_TOKEN` | Yes | Telegram bot token |
391388
| `QDRANT_URL` | No | Qdrant URL (default: localhost:6333) |
392-
| `REDIS_URL` | No | Redis URL (default: localhost:6379) |
393389
| `AZURE_OPENAI_*` | No | Azure OpenAI credentials (optional) |
394390
| `LANGCHAIN_API_KEY` | No | LangSmith tracing (optional) |
395391

@@ -451,7 +447,7 @@ terraform apply
451447
| **Orchestration** | LangGraph, LangChain |
452448
| **RAG** | Qdrant, BM25, Hybrid Search, Reranking |
453449
| **Data Sources** | Yahoo Finance, SEC EDGAR, Reddit, DuckDuckGo |
454-
| **Backend** | FastAPI, Pydantic, Redis |
450+
| **Backend** | FastAPI, Pydantic |
455451
| **Bot** | python-telegram-bot |
456452
| **Infrastructure** | Docker, Azure Container Apps, Terraform |
457453
| **CI/CD** | GitHub Actions |

docker-compose.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ services:
1616
- AZURE_OPENAI_DEPLOYMENT=${AZURE_OPENAI_DEPLOYMENT:-}
1717
# Infrastructure
1818
- QDRANT_URL=http://qdrant:6333
19-
- REDIS_URL=redis://redis:6379
2019
# App settings
2120
- APP_ENV=${APP_ENV:-development}
2221
- LOG_LEVEL=${LOG_LEVEL:-INFO}
@@ -28,8 +27,6 @@ services:
2827
depends_on:
2928
qdrant:
3029
condition: service_healthy
31-
redis:
32-
condition: service_healthy
3330
restart: unless-stopped
3431
healthcheck:
3532
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
@@ -80,23 +77,5 @@ services:
8077
retries: 3
8178
start_period: 5s
8279

83-
# ===========================================
84-
# Cache
85-
# ===========================================
86-
redis:
87-
image: redis:7-alpine
88-
ports:
89-
- "6379:6379"
90-
volumes:
91-
- redis_data:/data
92-
restart: unless-stopped
93-
command: redis-server --appendonly yes
94-
healthcheck:
95-
test: ["CMD", "redis-cli", "ping"]
96-
interval: 10s
97-
timeout: 5s
98-
retries: 3
99-
10080
volumes:
10181
qdrant_data:
102-
redis_data:

docs/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Technical documentation for the Equity Research Agent.
1313
| [Embeddings & RAG](embeddings-rag.md) | Hybrid search, reranking |
1414
| [Qdrant Vector Database](qdrant-vector-database.md) | Vector store setup |
1515
| [Financial Data Tools](financial-data-tools.md) | yfinance, SEC EDGAR |
16-
| [Redis Caching](redis-caching.md) | Cache configuration |
1716
| [Docker Setup](docker-setup.md) | Local development with Docker |
1817
| [Azure Deployment](azure-deployment.md) | Production deployment |
1918
| [CI/CD Setup](ci-cd-setup.md) | GitHub Actions pipelines |
@@ -89,6 +88,6 @@ Technical documentation for the Equity Research Agent.
8988
| Search | Hybrid (BM25 + dense + RRF) |
9089
| API | FastAPI |
9190
| Bot | python-telegram-bot |
92-
| Cache | Redis |
91+
| Cache | In-memory (with TTL) |
9392
| Infra | Docker, Azure Container Apps |
9493
| CI/CD | GitHub Actions |

docs/docker-setup.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
The project uses Docker Compose to orchestrate multiple services:
66

77
```
8-
┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐
9-
│ API │────▶│ Qdrant │ │ Redis │ │ Telegram │
10-
│ (FastAPI) │ │ (Vectors) │ │ (Cache) │ │ Bot │
11-
│ :8000 │ │ :6333/:6334 │ │ :6379 │ │ (polling) │
12-
└─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘
8+
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
9+
│ API │────▶│ Qdrant │ │ Telegram │
10+
│ (FastAPI) │ │ (Vectors) │ │ Bot │
11+
│ :8000 │ │ :6333/:6334 │ │ (polling) │
12+
└─────────────┘ └─────────────┘ └─────────────┘
1313
```
1414

1515
## Services
@@ -28,11 +28,9 @@ api:
2828
environment:
2929
- GROQ_API_KEY=${GROQ_API_KEY}
3030
- QDRANT_URL=http://qdrant:6333
31-
- REDIS_URL=redis://redis:6379
3231
- API_SECRET_KEY=${API_SECRET_KEY}
3332
depends_on:
3433
- qdrant
35-
- redis
3634
```
3735
3836
### telegram-bot
@@ -66,20 +64,6 @@ qdrant:
6664
- qdrant_data:/qdrant/storage
6765
```
6866
69-
### redis (Cache)
70-
71-
Cache for API responses.
72-
73-
```yaml
74-
redis:
75-
image: redis:7-alpine
76-
ports:
77-
- "6379:6379"
78-
volumes:
79-
- redis_data:/data
80-
command: redis-server --appendonly yes
81-
```
82-
8367
## Commands
8468
8569
### Start All Services
@@ -158,16 +142,12 @@ CMD ["python", "-m", "src.telegram.bot"]
158142
| Volume | Service | Contents |
159143
|--------|---------|----------|
160144
| `qdrant_data` | qdrant | Vector collections |
161-
| `redis_data` | redis | Persisted cache (AOF) |
162145

163146
### Backup Data
164147

165148
```bash
166149
# Qdrant
167150
docker cp equity-research-agent-qdrant-1:/qdrant/storage ./backup/qdrant
168-
169-
# Redis
170-
docker cp equity-research-agent-redis-1:/data ./backup/redis
171151
```
172152

173153
## Environment Variables
@@ -215,8 +195,16 @@ api:
215195
restart: unless-stopped
216196
```
217197
198+
## Caching
199+
200+
The API uses an in-memory cache with TTL for API responses. This provides:
201+
- Fast response times for repeated queries
202+
- No external dependencies
203+
- Automatic cleanup of expired entries
204+
205+
For high-traffic production deployments, consider adding Redis or Memcached.
206+
218207
## Resources
219208
220209
- [Docker Compose Documentation](https://docs.docker.com/compose/)
221210
- [Qdrant Docker](https://qdrant.tech/documentation/quick-start/)
222-
- [Redis Docker](https://hub.docker.com/_/redis)

docs/redis-caching.md

Lines changed: 0 additions & 117 deletions
This file was deleted.

src/tools/search_tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from duckduckgo_search import DDGS
88
from tenacity import retry, stop_after_attempt, wait_exponential
99

10-
from src.utils.cache import RedisCache, get_cache
10+
from src.utils.cache import MemoryCache, get_cache
1111
from src.utils.rate_limiter import search_limiter
1212

1313
logger = structlog.get_logger()
@@ -64,11 +64,11 @@ class DuckDuckGoSearchTool:
6464
to avoid being blocked.
6565
"""
6666

67-
def __init__(self, cache: RedisCache | None = None) -> None:
67+
def __init__(self, cache: MemoryCache | None = None) -> None:
6868
"""Initialize DuckDuckGo search tool.
6969
7070
Args:
71-
cache: Optional Redis cache instance
71+
cache: Optional cache instance
7272
"""
7373
self._cache = cache or get_cache()
7474
self._ddgs = DDGS()

src/tools/yfinance_tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from tenacity import retry, stop_after_attempt, wait_exponential
1010

1111
from src.config import get_settings
12-
from src.utils.cache import RedisCache, get_cache
12+
from src.utils.cache import MemoryCache, get_cache
1313
from src.utils.rate_limiter import yfinance_limiter
1414

1515
logger = structlog.get_logger()
@@ -96,11 +96,11 @@ class YFinanceTool:
9696
Handles NaN values and API errors gracefully.
9797
"""
9898

99-
def __init__(self, cache: RedisCache | None = None) -> None:
99+
def __init__(self, cache: MemoryCache | None = None) -> None:
100100
"""Initialize YFinance tool.
101101
102102
Args:
103-
cache: Optional Redis cache instance
103+
cache: Optional cache instance
104104
"""
105105
self._cache = cache or get_cache()
106106
self._settings = get_settings()

src/utils/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Utility modules."""
22

3-
from src.utils.cache import RedisCache, get_cache
3+
from src.utils.cache import MemoryCache, get_cache
44
from src.utils.rate_limiter import RateLimiter
55

6-
__all__ = ["RedisCache", "get_cache", "RateLimiter"]
6+
__all__ = ["MemoryCache", "get_cache", "RateLimiter"]

0 commit comments

Comments
 (0)