Skip to content

Commit 50e854f

Browse files
committed
Remove Azure AI Search (notes search) feature
- Delete notes CLI and Azure Search client implementations - Remove AZURE_SEARCH_* env vars and embedding constants from config and .env.example - Update config to stop validating/creating Azure Search client - Strip notes references from README, SETUP_CHECKLIST, and GitHub Copilot instructions - Remove notes subcommand from main CLI and adjust help text - Remove azure-search-documents dependency from pyproject and prune lockfile - Update tests to stop setting AZURE_SEARCH_* and tweak sample content accordingly
1 parent dff2e96 commit 50e854f

File tree

12 files changed

+8
-524
lines changed

12 files changed

+8
-524
lines changed

.env.example

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,11 @@ DIARY_PATH=/path/to/obsidian/vault
88
PLANNER_PATH=/path/to/planner
99

1010
# Required: Azure OpenAI configuration
11-
# Provides LLM for both 'brain diary' AND 'brain notes' commands
1211
AZURE_OPENAI_API_KEY=your-api-key-here
1312
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
1413
AZURE_OPENAI_DEPLOYMENT=gpt-4o
1514
AZURE_OPENAI_API_VERSION=2024-02-15-preview
1615

17-
# Required: Azure AI Search configuration (for 'brain notes' search)
18-
# Note: This is a separate Azure service with no local alternative
19-
AZURE_SEARCH_ENDPOINT=https://your-search-service.search.windows.net
20-
AZURE_SEARCH_API_KEY=your-search-api-key-here
21-
AZURE_SEARCH_INDEX_NAME=second-brain-notes
22-
2316
# Optional: Cost Tracking Configuration
2417
BRAIN_COST_DB_PATH=~/.brain/costs.db
2518

.github/copilot-instructions.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ AI-powered journaling system with markdown entries, semantic backlinks, and LLM-
1010
- Testing: pytest with 57 tests, 47% coverage
1111
- CLI: typer (add_completion=False) + rich
1212
- LLM: Azure OpenAI (required)
13-
- Search: Azure AI Search for book notes
1413

1514
## Architecture
1615

@@ -24,7 +23,6 @@ Core functionality with comprehensive type hints and dataclasses:
2423
- `entry_manager.py` - Entry I/O and parsing (93% coverage)
2524
- `llm_client.py` - Abstract LLM interface (73% coverage)
2625
- `azure_openai_client.py` - Azure OpenAI client (40% coverage)
27-
- `notes_search_client.py` - Book notes search (100% coverage)
2826
- `llm_analysis.py` - Atomic LLM operations: entities, backlinks, tags (17% coverage)
2927
- `report_generator.py` - Report orchestration (18% coverage)
3028
- `template_generator.py` - AI prompt generation (42% coverage)
@@ -35,7 +33,6 @@ User-facing commands with typer:
3533
- `main.py` - Root CLI entry point (92% coverage)
3634
- `diary_commands.py` - Diary management (23% coverage)
3735
- `plan_commands.py` - Daily planning with LLM task extraction (49% coverage)
38-
- `notes_commands.py` - Book notes search (44% coverage)
3936

4037
## Common Commands
4138

@@ -52,13 +49,6 @@ uv run brain diary patterns 7 # Statistical patterns
5249
uv run brain diary list # List all entries
5350
uv run brain diary refresh 30 # Regenerate links for last 30 days
5451

55-
# Notes commands (Azure AI Search)
56-
uv run brain notes search "topic"
57-
uv run brain notes search "query" --top 5
58-
uv run brain notes search "query" --semantic
59-
uv run brain notes search "query" --detailed
60-
uv run brain notes status
61-
6252
# Development
6353
uv sync # Install dependencies
6454
uv add <package> # Add dependency
@@ -80,12 +70,6 @@ uv run pytest tests/ --cov # With coverage
8070
- `AZURE_OPENAI_API_VERSION` - Default: 2024-02-15-preview
8171
-**Full functionality:** Diary prompts, task extraction, semantic analysis, backlinks, tags, reports
8272

83-
**Azure AI Search (required for `brain notes` search only):**
84-
- `AZURE_SEARCH_ENDPOINT` - Search service endpoint
85-
- `AZURE_SEARCH_API_KEY` - API key
86-
- `AZURE_SEARCH_INDEX_NAME` - Index name (default: second-brain-notes)
87-
- ⚠️ **No local alternative:** This is a separate Azure service.
88-
8973
## Entry Structure
9074

9175
Two entry types with specific formats:
@@ -160,8 +144,7 @@ Two entry types with specific formats:
160144
```
161145
CLI Layer (brain_cli/)
162146
├── diary_commands.py → report_generator.py, llm_analysis.py
163-
├── plan_commands.py → extract_tasks_from_diary() → LLM
164-
└── notes_commands.py → notes_search_client.py
147+
└── plan_commands.py → extract_tasks_from_diary() → LLM
165148
166149
report_generator.py (orchestration)
167150
↓ uses
@@ -197,12 +180,12 @@ llm_client.py → azure_openai_client.py
197180
- Removed scheduler/daemon system (312 lines, 0% coverage)
198181
- Removed todos command (redundant with plan command)
199182
- Removed `generate_planning_prompts()` - plans no longer have prompts
200-
- Total code reduction: ~600 lines
183+
- Removed notes search functionality (238 lines) - focused on journaling/planning only
184+
- Total code reduction: ~838 lines
201185

202186
**Module Improvements:**
203187
- Renamed `analysis.py``report_generator.py` (clearer purpose)
204188
- Renamed `azure_client.py``azure_openai_client.py` (clarity)
205-
- Renamed `azure_search_client.py``notes_search_client.py` (clarity)
206189
- Moved plan command from diary to separate `plan_commands.py` module
207190
- Updated `EntryManager` to accept separate diary_path and planner_path
208191

README.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Tests](https://github.com/madebygps/second-brain/actions/workflows/test.yml/badge.svg)](https://github.com/madebygps/second-brain/actions/workflows/test.yml)
44

5-
AI-powered personal knowledge system with daily planning, reflective journaling, semantic backlinks, and intelligent book notes search.
5+
AI-powered personal knowledge system with daily planning, reflective journaling, and semantic backlinks.
66

77
## Installation
88

@@ -55,10 +55,6 @@ uv run brain --help
5555
- Automatic topic tags and temporal connections
5656
- Obsidian-compatible markdown format
5757

58-
**Notes Search** (`brain notes`)
59-
- Semantic and text search of book notes via Azure AI Search
60-
- Rich formatted results with highlights
61-
6258
**Cost Tracking** (`brain cost`)
6359
- Real-time Azure OpenAI usage tracking in local SQLite database
6460
- Comprehensive metadata: temperature, max_tokens, prompt/response lengths
@@ -88,9 +84,6 @@ brain plan create today
8884

8985
# Evening: Create your reflection entry (saves to DIARY_PATH)
9086
brain diary create today
91-
92-
# Search your book notes
93-
brain notes search "discipline"
9487
```
9588

9689
> **Note:** The `.env` file is automatically searched in `~/.config/brain/.env`, `~/.brain/.env`, or current directory.
@@ -114,11 +107,6 @@ brain diary list 7 # List recent entries
114107
brain diary report 30 # Memory trace report (activities & connections)
115108
brain diary patterns 7 # Emotional & psychological patterns
116109

117-
# Notes search
118-
brain notes search "topic" # Search book notes
119-
brain notes search "topic" --semantic --detailed
120-
brain notes status # Check connection
121-
122110
# Cost tracking and analysis
123111
brain cost summary # Usage summary for last 30 days
124112
brain cost trends 30 # Daily cost trends
@@ -157,11 +145,6 @@ Create `~/.config/brain/.env` with these settings:
157145
- `AZURE_OPENAI_DEPLOYMENT` - Deployment name (default: gpt-4o)
158146
- `AZURE_OPENAI_API_VERSION` - API version (default: 2024-02-15-preview)
159147

160-
**Azure AI Search** (required for notes search):
161-
- `AZURE_SEARCH_ENDPOINT` - Azure AI Search service endpoint
162-
- `AZURE_SEARCH_API_KEY` - Azure AI Search API key
163-
- `AZURE_SEARCH_INDEX_NAME` - Search index name (default: second-brain-notes)
164-
165148
**Logging & Cost Tracking** (optional configuration):
166149
- `BRAIN_COST_DB_PATH` - Path to cost tracking database (default: ~/.brain/costs.db)
167150
- `BRAIN_LOG_LEVEL` - Logging level: DEBUG, INFO, WARNING, ERROR (default: INFO)
@@ -229,7 +212,6 @@ After writing, run `brain diary link today` to add semantic backlinks:
229212
- Task extraction from diary entries
230213
- Semantic backlinks and tags
231214
- Analysis reports and patterns
232-
- **Azure AI Search** - Required for book notes search functionality only
233215

234216
## Development
235217

SETUP_CHECKLIST.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ AZURE_OPENAI_API_KEY=your-api-key-here
7676
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
7777
AZURE_OPENAI_DEPLOYMENT=gpt-4o
7878
AZURE_OPENAI_API_VERSION=2024-02-15-preview
79-
80-
# Required: Azure AI Search (for book notes search)
81-
AZURE_SEARCH_ENDPOINT=https://your-search-service.search.windows.net
82-
AZURE_SEARCH_API_KEY=your-search-api-key-here
83-
AZURE_SEARCH_INDEX_NAME=second-brain-notes
8479
```
8580

8681
**Optional variables** (with defaults):
@@ -107,16 +102,6 @@ BRAIN_LOG_FILE=~/.brain/logs/brain.log
107102
5. Go to **Model deployments**
108103
6. Copy your deployment name (e.g., "gpt-4o") → `AZURE_OPENAI_DEPLOYMENT`
109104

110-
#### Azure AI Search (Required for notes search)
111-
112-
1. Go to [Azure Portal](https://portal.azure.com)
113-
2. Navigate to your Azure AI Search resource
114-
3. Go to **Keys**
115-
4. Copy:
116-
- **Primary admin key**`AZURE_SEARCH_API_KEY`
117-
5. Copy the URL from Overview page → `AZURE_SEARCH_ENDPOINT`
118-
6. Go to **Indexes** and copy your index name → `AZURE_SEARCH_INDEX_NAME`
119-
120105
### Step 5: Test Configuration
121106

122107
Test that everything is configured correctly:
@@ -128,9 +113,6 @@ brain diary list
128113
# Test plan commands (uses PLANNER_PATH)
129114
brain plan create today
130115

131-
# Test notes search (uses Azure AI Search)
132-
brain notes status
133-
134116
# Test cost tracking (uses BRAIN_COST_DB_PATH)
135117
brain cost summary
136118
```
@@ -256,12 +238,7 @@ Once configured:
256238
brain diary patterns 7
257239
```
258240

259-
4. **Search your notes:**
260-
```bash
261-
brain notes search "topic"
262-
```
263-
264-
5. **Track costs:**
241+
4. **Track costs:**
265242
```bash
266243
brain cost summary
267244
brain cost trends 30

brain_cli/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
# Import subcommands
1010
from brain_cli.diary_commands import app as diary_app
11-
from brain_cli.notes_commands import app as notes_app
1211
from brain_cli.plan_commands import app as plan_app
1312

1413
# Import centralized logging
@@ -53,15 +52,14 @@ def main_callback(
5352

5453

5554
app = typer.Typer(
56-
help="Your AI-powered second brain for journaling with semantic backlinks and intelligent notes search",
55+
help="Your AI-powered second brain for journaling and planning with semantic backlinks",
5756
no_args_is_help=True,
5857
add_completion=False,
5958
callback=main_callback,
6059
)
6160

6261
# Register subcommands
6362
app.add_typer(diary_app, name="diary")
64-
app.add_typer(notes_app, name="notes")
6563
app.add_typer(plan_app, name="plan")
6664
app.add_typer(cost_app, name="cost")
6765

brain_cli/notes_commands.py

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

0 commit comments

Comments
 (0)