@@ -1,6 +1,6 @@
11 # AGENTS.md
22
3-This is a personal assistant project, that renders a simple assistant chat layout as a web page, and provides access to an agentic model running locally via ollama. The project uses Next.js for it's typescript framework TailwindCSS for it's styling, and Ollama's typescript/javascript library itself for querying the model. This project is also responsible for augmenting the model's prompt with search results from DuckDuckGo.
3+This is a personal assistant project, that renders a simple assistant chat layout as a web page, and provides access to an agentic model running locally via ollama. The project uses Next.js for it's typescript framework TailwindCSS for it's styling, and Ollama's typescript/javascript library itself for querying the model.
44
55 ## Project Commands
66
@@ -73,7 +73,7 @@ Agents MUST use only these existing dependencies. Do NOT add new dependencies wi
7373 3. **Naming Conventions**:
7474 - Functions: `camelCase` (e.g., `fetchOllamaResponse`, `sendMessage`)
7575 - Components: `PascalCase` (e.g., `Home`, `RootLayout`)
76- - Interfaces: `PascalCase` (e.g., `DuckDuckGoResult`)
76+ - Interfaces: `PascalCase` (e.g., `OllamaMessage`, `OllamaResponse`)
7777 - Constants: `UPPER_SNAKE_CASE` or `camelCase` depending on scope
7878
7979 4. **TypeScript Types**:
@@ -137,7 +137,6 @@ Agents MUST use only these existing dependencies. Do NOT add new dependencies wi
137137 │ ├── db/
138138 │ │ ├── index.ts # Database connection and setup
139139 │ │ └── schema.ts # Drizzle ORM schema definitions
140-│ ├── duckduckgo.ts # DuckDuckGo API wrapper
141140 │ └── ollama.ts # Ollama API wrapper
142141 ├── drizzle/ # Generated migration files
143142 │ ├── meta/ # Migration metadata
@@ -155,29 +154,25 @@ Agents MUST use only these existing dependencies. Do NOT add new dependencies wi
155154 ### UI Style
156155
157156 - Always ensure support for both light and dark modes
158-- Use slate color palette for backgrounds and text (not gray or stone)
159-- Default text colors: `text-slate-800 dark:text-slate-200` (set on topmost container to cascade)
160-- Background colors: `bg-slate-200/300` for light mode, `bg-slate-900/950` for dark mode
157+- Use stone color palette for backgrounds and text (not gray or slate)
158+- Default text colors: `text-stone-800 dark:text-stone-200` (set on topmost container to cascade)
159+- Container backgrounds: `bg-stone-100` for light mode, `bg-stone-950` for dark mode
160+- Child component backgrounds: `bg-stone-200` for light mode, `bg-stone-900` for dark mode
161+- User message backgrounds: `bg-stone-300` for light mode, `bg-stone-800` for dark mode
162+- Assistant message backgrounds: `bg-stone-200` for light mode, `bg-stone-900` for dark mode
161163 - Don't use round corners
162164 - The UI should always fit to the available space
163-- Primary colors: emerald-500 for dark mode, emerald-900 for light mode
164-- Alternate colors: indigo at an appropriate shade for current mode
165+- Primary colors: green-500 for dark mode, green-900 for light mode
166+- margins and paddings shouldn't stack, use gaps when possible
165167
166168 ### Ollama Integration
167169
168170 - Default model: `gpt-oss`
169-- Function: `fetchOllamaResponse(prompt: string, model?: string)`
170-- Returns: Promise<string> with the model's response
171+- Function: `fetchOllamaResponse(messages: OllamaMessage[], model?: string)`
172+- Returns: Promise<OllamaResponse> with `{ content: string, generationTimeMs: number }`
173+- Uses `ollama.chat()` API with full conversation history
171174 - Located in: `src/lib/ollama.ts`
172175
173-### DuckDuckGo Integration
174-
175-- Endpoint: `https://api.duckduckgo.com/`
176-- Function: `fetchDuckDuckGo(query: string)`
177-- Returns: Promise<DuckDuckGoResult[]>
178-- Interface: `{ title: string; snippet: string; url: string }`
179-- Located in: `src/lib/duckduckgo.ts`
180-
181176 ### Database Integration (Drizzle ORM)
182177
183178 - **Database**: SQLite using better-sqlite3
@@ -196,11 +191,12 @@ Agents MUST use only these existing dependencies. Do NOT add new dependencies wi
196191
197192 ### Chat API Flow
198193
199-1. Client sends POST request to `/api/chat` with `{ message: string }`
200-2. API route fetches DuckDuckGo results for the message
201-3. API route builds prompt with message + search results
202-4. API route calls Ollama with the augmented prompt
203-5. API route returns `{ answer: string }`
194+1. Client sends POST request to `/api/chat` with `{ message: string, threadId: number }`
195+2. API route fetches previous messages from the thread
196+3. API route stores the user message
197+4. API route calls Ollama with the full conversation history
198+5. API route stores the assistant response with generation time
199+6. API route returns `{ answer: string }`
204200
205201 ## Development Workflow
206202