{"id":48308452,"url":"https://github.com/hmlendea/gpt-memory-store","last_synced_at":"2026-04-05T00:12:38.011Z","repository":{"id":344759074,"uuid":"1182939490","full_name":"hmlendea/gpt-memory-store","owner":"hmlendea","description":"Simple REST API for managing shared and persistent GPT memories through GPT Actions.","archived":false,"fork":false,"pushed_at":"2026-03-26T11:47:57.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-27T04:35:08.214Z","etag":null,"topics":["api","chatgpt","gpt","gpt-memory","memory-store","persistence","rest","rest-api","self-hosted"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmlendea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":"hmlendea","open_collective":null,"ko_fi":"hmlendea","tidelift":null,"community_bridge":null,"liberapay":"HMlendea","issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":"hmlendea","thanks_dev":null,"custom":"https://hmlendea.go.ro/fund.html"}},"created_at":"2026-03-16T05:30:20.000Z","updated_at":"2026-03-26T11:44:25.000Z","dependencies_parsed_at":"2026-03-16T19:03:37.710Z","dependency_job_id":null,"html_url":"https://github.com/hmlendea/gpt-memory-store","commit_stats":null,"previous_names":["hmlendea/gpt-memory-store"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hmlendea/gpt-memory-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fgpt-memory-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fgpt-memory-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fgpt-memory-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fgpt-memory-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmlendea","download_url":"https://codeload.github.com/hmlendea/gpt-memory-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmlendea%2Fgpt-memory-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31419555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","chatgpt","gpt","gpt-memory","memory-store","persistence","rest","rest-api","self-hosted"],"created_at":"2026-04-05T00:12:37.582Z","updated_at":"2026-04-05T00:12:38.004Z","avatar_url":"https://github.com/hmlendea.png","language":"C#","funding_links":["https://patreon.com/hmlendea","https://ko-fi.com/hmlendea","https://liberapay.com/HMlendea","https://buymeacoffee.com/hmlendea","https://hmlendea.go.ro/fund.html"],"categories":[],"sub_categories":[],"readme":"[![Donate](https://img.shields.io/badge/-%E2%99%A5%20Donate-%23ff69b4)](https://hmlendea.go.ro/fund.html) [![Latest GitHub release](https://img.shields.io/github/v/release/hmlendea/gpt-memory-store)](https://github.com/hmlendea/gpt-memory-store/releases/latest) [![Build Status](https://github.com/hmlendea/gpt-memory-store/actions/workflows/dotnet.yml/badge.svg)](https://github.com/hmlendea/gpt-memory-store/actions/workflows/dotnet.yml)\n\n# GPT Memory Store\n\nREST API for managing shared, persistent memories intended for GPT Actions and other API clients.\n\nThis service stores memory entries in a JSON file, exposes CRUD endpoints, and protects requests using the NuciAPI authorization.\n\n## Contents\n\n- [Overview](#overview)\n- [Features](#features)\n- [Architecture](#architecture)\n- [Requirements](#requirements)\n- [Configuration](#configuration)\n- [Run Locally](#run-locally)\n- [API](#api)\n\t- [Authentication](#authentication)\n\t- [Memory Schema](#memory-schema)\n\t- [Endpoints](#endpoints)\n\t- [Example Requests](#example-requests)\n- [Data Storage](#data-storage)\n- [Logging](#logging)\n- [Development Notes](#development-notes)\n- [Release](#release)\n- [License](#license)\n\n## Overview\n\nGPT Memory Store is an ASP.NET Core Web API application that provides:\n\n- Create memory records\n- Read one or all memory records\n- Update existing memory records\n- Delete memory records\n\nMemories are persisted to a file-based JSON repository and can be shared across sessions, users, or agents depending on how you deploy and secure the API.\n\n## Features\n\n- Lightweight JSON file persistence *(no database required)*\n- Clean CRUD controller at route `/Memories`\n- API Key based authorization via NuciAPI\n- Structured operation logging through NuciLog\n\n## Architecture\n\nThe project is organized in layers:\n\n- `Api/Controllers`: HTTP endpoints\n- `Api/Requests`: request DTOs\n- `Api/Responses`: response DTOs\n- `Service`: domain service and business logic\n- `DataAccess/DataObjects`: persistence data model\n- `Configuration`: strongly typed app settings\n- `Logging`: operation and key definitions for structured logs\n\nOn startup:\n\n1. Configuration objects are bound from `appsettings.json`.\n2. Services and repositories are registered in DI.\n3. The memory store file is created automatically if missing.\n4. Middleware pipeline enables exception handling, routing, and authorization.\n\n## Requirements\n\n- .NET SDK 10.0 (target framework is `net10.0`)\n- Linux, macOS, or Windows\n\nCheck SDK version:\n\n```bash\ndotnet --version\n```\n\n## Configuration\n\nMain settings are defined in `appsettings.json`:\n\n```json\n{\n\t\"securitySettings\": {\n\t\t\"apiKey\": \"[[GPT_MEMORY_STORE_API_KEY]]\"\n\t},\n\t\"dataStoreSettings\": {\n\t\t\"memoryStorePath\": \"Data/memories.json\"\n\t},\n\t\"nuciLoggerSettings\": {\n\t\t\"logFilePath\": \"logfile.log\",\n\t\t\"isFileOutputEnabled\": true\n\t}\n}\n```\n\nSettings reference:\n\n- `securitySettings.apiKey`: shared secret used by NuciAPI authorization.\n- `dataStoreSettings.memoryStorePath`: path to the JSON store file.\n- `nuciLoggerSettings.logFilePath`: output log file path.\n- `nuciLoggerSettings.isFileOutputEnabled`: toggles file logging.\n\nImportant:\n\n- Replace the placeholder API key with a strong secret before deploying.\n- The service creates the target directory and initializes the JSON store with `[]` when the file does not exist.\n\n## Run Locally\n\nRestore and build:\n\n```bash\ndotnet restore\ndotnet build\n```\n\nRun:\n\n```bash\ndotnet run\n```\n\nOptional custom URL:\n\n```bash\ndotnet run --urls \"http://127.0.0.1:5081\"\n```\n\n## API\n\n### Authentication\n\nAll endpoints are protected by NuciAPI authorization (`NuciApiAuthorisation.ApiKey(...)`).\n\nWhen calling the API from custom clients, include the required authentication data expected by your NuciAPI setup (API key). Using the NuciAPI.Client NuGet package is the most reliable approach.\n\nUnauthenticated requests return `403 Forbidden`.\n\n### Memory Schema\n\nLogical memory model exposed by responses:\n\n```json\n{\n\t\"id\": \"f95bc067-a568-414d-99dc-2663a01926e8\",\n\t\"createdDateTime\": \"2026-03-16T08:28:16.0238073+02:00\",\n\t\"updatedDateTime\": \"2026-03-16T08:29:40.6566852+02:00\",\n\t\"content\": \"Test memory\",\n\t\"source\": \"Test\",\n\t\"confidence\": 0.5\n}\n```\n\nField notes:\n\n- `id`: generated GUID by default on create.\n- `createdDateTime`: set at creation time.\n- `updatedDateTime`: null until updated.\n- `confidence`: decimal score (for example `0.0` to `1.0` by convention).\n\n### Endpoints\n\nBase route: `/Memories`\n\n| Method | Route | Description |\n|---|---|---|\n| `POST` | `/Memories` | Create a new memory |\n| `GET` | `/Memories` | Retrieve all memories |\n| `GET` | `/Memories/{id}` | Retrieve one memory by id |\n| `PUT` | `/Memories` | Update an existing memory |\n| `DELETE` | `/Memories/{id}` | Delete memory by id |\n\n### Example Requests\n\nNote: The details shown below are illustrative. Use your exact headers and values in real calls.\n\nCreate:\n\n```bash\ncurl -X POST \"http://127.0.0.1:5000/Memories\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Authorization: [[GPT_MEMORY_STORE_API_KEY]]\"\n\t-d '{\n\t\t\"content\": \"The user prefers concise technical answers.\",\n\t\t\"source\": \"profile-sync\",\n\t\t\"confidence\": 0.95\n\t}'\n```\n\nGet all:\n\n```bash\ncurl -X GET \"http://127.0.0.1:5000/Memories\" \\\n\t-H \"Authorization: [[GPT_MEMORY_STORE_API_KEY]]\"\n```\n\nGet by id:\n\n```bash\ncurl -X GET \"http://127.0.0.1:5000/Memories/f95bc067-a568-414d-99dc-2663a01926e8\" \\\n\t-H \"Authorization: [[GPT_MEMORY_STORE_API_KEY]]\"\n```\n\nUpdate:\n\n```bash\ncurl -X PUT \"http://127.0.0.1:5000/Memories\" \\\n\t-H \"Content-Type: application/json\" \\\n\t-H \"Authorization: [[GPT_MEMORY_STORE_API_KEY]]\"\n\t-d '{\n\t\t\"id\": \"f95bc067-a568-414d-99dc-2663a01926e8\",\n\t\t\"content\": \"The user prefers concise technical answers and code-first guidance.\",\n\t\t\"source\": \"profile-sync\",\n\t\t\"confidence\": 0.97\n\t}'\n```\n\nDelete:\n\n```bash\ncurl -X DELETE \"http://127.0.0.1:5000/Memories/f95bc067-a568-414d-99dc-2663a01926e8\" \\\n\t-H \"Authorization: [[GPT_MEMORY_STORE_API_KEY]]\"\n```\n\n## Data Storage\n\nThe repository is file based (`JsonRepository\u003cGptMemoryDataObject\u003e`), using the path from `dataStoreSettings.memoryStorePath`.\n\nPersistence format example (`Data/memories.json`):\n\n```json\n[\n\t{\n\t\t\"date\": null,\n\t\t\"createdTimestamp\": \"2026-03-16T08:28:16.0238073+02:00\",\n\t\t\"updatedTimestamp\": \"2026-03-16T08:29:40.6566852+02:00\",\n\t\t\"content\": \"Test memory\",\n\t\t\"source\": \"Test\",\n\t\t\"confidence\": 0.5,\n\t\t\"id\": \"f95bc067-a568-414d-99dc-2663a01926e8\"\n\t}\n]\n```\n\n## Logging\n\nThe service logs operation lifecycle events for:\n\n- `CreateMemory`\n- `GetMemories`\n- `GetMemory`\n- `UpdateMemory`\n- `DeleteMemory`\n\nEach operation writes started/success/failure events with useful context keys (id, source, confidence, count, and more).\n\n## Development Notes\n\n- `PUT /Memories` preserves `createdDateTime` from the existing record and updates `updatedDateTime` to the current time.\n- `POST /Memories` currently ignores any incoming `id` field and generates a new GUID from the domain model default.\n- Static file middleware is enabled. If `wwwroot` is missing, startup may log a warning, but API endpoints continue to work.\n\n## Release\n\nThis repository includes `release.sh`, which delegates to an external .NET release script:\n\n```bash\n./release.sh v1.0.0\n```\n\n## License\n\nLicensed under GNU GPL v3. See `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmlendea%2Fgpt-memory-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmlendea%2Fgpt-memory-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmlendea%2Fgpt-memory-store/lists"}