Skip to content

[DOCS] Memory: per-project fact organization, recall filtering, and entry caps #348

Closed

Description

@edenreich

Summary

The CLI's persistent memory is now organized by project (inference-gateway/cli#759, closes inference-gateway/cli#758). The memory documentation needs updating to cover the new layout, write semantics, recall filtering, and configuration knobs.

What changed:

  • Project facts live in per-project subdirectories: <project-slug>/<slug>.md (e.g. inference-gateway-cli/build-commands.md); global facts stay at the memory dir root. Legacy flat files keep working as global facts - no migration.
  • The project is detected automatically: git remote origin -> org/repo, fallback cwd basename, else global.
  • Fact frontmatter records metadata.project (human-readable org/repo) and metadata.session (the session that last wrote the fact).
  • Memory write gained an optional project argument. Defaults by type: user facts are global; feedback/project/reference facts go under the detected project; passing global forces a global fact; an org/repo value files it under another project.
  • name accepts slug (global) or project/slug (project fact), exactly as shown in the MEMORY.md index.
  • The index injected at session start is filtered to current-project + global entries, with one summary line naming other projects; the full index remains available via a Memory read with no name.
  • New config: memory.max_entry_chars (per-fact write cap, default 2000, env INFER_MEMORY_MAX_ENTRY_CHARS; 0 means default). The injected-index cap memory.max_chars default dropped 4000 -> 2000 (env INFER_MEMORY_MAX_CHARS).
  • Existing users keep the old Memory tool description in prompts.yaml until they run infer init --overwrite.

Example fact file:

---
name: build-commands
description: how to build the CLI
metadata:
  type: project
  project: inference-gateway/cli
  session: channel-telegram-12345
---

Affected pages: the CLI memory documentation (memory concepts/configuration page) and the configuration reference for memory.yaml keys and INFER_MEMORY_* env vars.

Source: inference-gateway/cli#759 (implements inference-gateway/cli#758).

Acceptance Criteria

  • Memory docs describe the per-project directory layout, global vs project facts, and backward compatibility of legacy flat files
  • Memory tool docs cover the project argument, per-type defaults, and the project/slug name format
  • Configuration reference documents memory.max_entry_chars and the new memory.max_chars default (2000), including env overrides
  • Frontmatter fields metadata.project and metadata.session are documented with an example

Activity

  1. added
    documentation
    on Jul 6, 2026
  2. added theissue type on Jul 6, 2026
  3. moved this to Todo in 2026on Jul 6, 2026
  4. edenreich commented on Jul 6, 2026

    @edenreich
    ContributorAuthor

    @infer Can you work on this?

  5. inference-gateway-maintainer commented on Jul 6, 2026

    @inference-gateway-maintainer
    Contributor

    Model: ollama_cloud/deepseek-v4-flash · View Job

    Todos

    • Explore the docs repo structure to find relevant memory documentation files
    • Update memory concepts/configuration page with per-project layout, global vs project facts, backward compatibility
    • Update Memory tool docs with project argument, per-type defaults, project/slug name format
    • Update configuration reference for memory.max_entry_chars and memory.max_chars default (2000), env overrides
    • Document frontmatter fields metadata.project and metadata.session with example
    • Verify final state of the file

    Pull Request

    #350

    ⚠️ Infer Result: Stopped early

    The agent finished without pushing its work. The runner salvaged it into the pull request linked above — review it and mark it ready, or close it if it is not useful.

    All acceptance criteria from the issue have been fully addressed. The changes are complete.

    Model: ollama_cloud/deepseek-v4-flash · Exit Code: 0 · Duration: 1m 23s

    Tokens: 953,223 in · 4,814 out · 958,037 total (14 requests)

    Tool calls: 13 total · 100% success rate

    Triggered by edenreich · Infer Action

  6. added a commit that references this issue on Jul 6, 2026
    8dca0cd
  7. moved this from Todo to Done in 2026on Jul 6, 2026
  8. inference-gateway-releaser commented on Jul 9, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.9.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationreleased

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions