Skip to content

Create Context item API for Local Context Store #4

Description

@Dumken1

Main Question

How does a local-first system capture useful context and store it locally?

Role

Fellow 1 owns the part where context enters the local memory system.
This is the entry point of the Local Context Store.

Branch

feature/m01w02-create-context

Files Owned

src/python/local_first_ai/storage/create_context.py
assets/screenshots/month-01-week-02/fellow-1-create-context.png

Implementation Specification

Build an API that creates context items.
create_context_item(
context_type,
title,
content,
source=None,
tags=None,
importance=1
)
This function should save a context item into the SQLite database.

Example context item:

context_type: config_decision
title: Database choice
content: We chose SQLite because it is local, lightweight, and works offline.
source: week-02-discussion
tags: sqlite,database,local-first
importance: 5

What you must Prove

What you should prove that:

  1. A context item can be created.
  2. The item receives a unique ID.
  3. The item stores context_type correctly.
  4. The item stores title and content correctly.
  5. The item stores created_at and updated_at.
  6. Empty title is rejected.
  7. Empty content is rejected.
  8. Invalid context_type is handled clearly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    points:size/mediumFlow Points: medium technical contribution, usually 30 points

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions