Main Question
How does the system find the right context before sending a question to the LLM?
Fellow 3 Role
Fellow 3 owns the most inference-related part of Week 2.
This fellow builds the retrieval layer that prepares context for future LLM inference.
Branch
feature/m01w02-search-context
Files Owned
src/python/local_first_ai/storage/search_context.py
assets/screenshots/month-01-week-02/fellow-3-search-context.png
Implementation Specification
Build APIs that search and prepare context.
search_context_items(keyword)
search_context_by_type(context_type, keyword)
get_top_context_for_prompt(keyword, limit=5)
prepare_context_for_inference(keyword, limit=5)
Example search:
User question:
What did we decide about SQLite?
Keyword:
SQLite
Relevant context returned:
- Database choice: We chose SQLite because it is local and works offline.
- Week 2 goal: Build a Local Context Store.
- Previous conversation: User asked how local memory connects to inference.
The output for inference should be formatted like:
Relevant Local Context:
[1] Type: config_decision
Title: Database choice
Content: We chose SQLite because it is local, lightweight, and works offline.
[2] Type: project_note
Title: Week 2 goal
Content: Week 2 builds the Local Context Store for local-first memory.
What Fellow 3 Must Prove
Fellow 3 should prove that:
- Search works on title.
- Search works on content.
- Search can filter by context_type.
- Search returns useful results.
- Search returns empty result when there is no match.
- Retrieved context can be formatted for prompt building.
- Fetch timing can be roughly measured.
Main Question
How does the system find the right context before sending a question to the LLM?
Fellow 3 Role
Fellow 3 owns the most inference-related part of Week 2.
This fellow builds the retrieval layer that prepares context for future LLM inference.
Branch
feature/m01w02-search-context
Files Owned
src/python/local_first_ai/storage/search_context.py
assets/screenshots/month-01-week-02/fellow-3-search-context.png
Implementation Specification
Build APIs that search and prepare context.
search_context_items(keyword)
search_context_by_type(context_type, keyword)
get_top_context_for_prompt(keyword, limit=5)
prepare_context_for_inference(keyword, limit=5)
Example search:
User question:
What did we decide about SQLite?
Keyword:
SQLite
Relevant context returned:
The output for inference should be formatted like:
Relevant Local Context:
[1] Type: config_decision
Title: Database choice
Content: We chose SQLite because it is local, lightweight, and works offline.
[2] Type: project_note
Title: Week 2 goal
Content: Week 2 builds the Local Context Store for local-first memory.
What Fellow 3 Must Prove
Fellow 3 should prove that: