diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 0000000..0a3d04c --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,113 @@ +# CodeRabbit AI Configuration for ContextForge Memory +# https://docs.coderabbit.ai/guides/code-review-best-practices/ + +# Top-level tone instructions (max 250 chars) +tone_instructions: "Professional tone focusing on security, performance, code quality, best practices, and documentation" + +# Review configuration +reviews: + # Optional: Consider enabling additional external review tools in CodeRabbit UI + # such as gitleaks (secrets scanning), semgrep (SAST), and checkov (IaC scanning) + # for broader security coverage. These are configured in the CodeRabbit UI, not here. + # Path filters for excluding files and directories + path_filters: + - "!**/*.pyc" + - "!**/__pycache__/**" + - "!**/.pytest_cache/**" + - "!**/node_modules/**" + - "!**/.venv/**" + - "!**/venv/**" + - "!**/data/**" + - "!**/logs/**" + - "!**/*.log" + - "!**/safety-results.json" + - "!**/audit-results.json" + - "!**/.coverage" + - "!**/coverage.xml" + - "!**/dist/**" + - "!**/build/**" + - "!**/.mypy_cache/**" + + # Path-specific review instructions + path_instructions: + # API and main application code + - path: "src/**/*.py" + instructions: | + Focus on: + - API design and RESTful principles + - Error handling and validation + - Security considerations (input validation, authentication) + - Performance implications + - Type hints and documentation + - FastAPI best practices + + # Client libraries + - path: "clients/**/*" + instructions: | + Focus on: + - API client design patterns + - Error handling and retry logic + - Type safety and interfaces + - Documentation and examples + - Cross-platform compatibility + + # CI/CD and workflows + - path: ".github/**/*" + instructions: | + Focus on: + - Security best practices + - Workflow efficiency + - Proper permissions and secrets handling + - Dependabot configuration + - Security scanning setup + + # Infrastructure-as-Code and container security (canonical rule) + - path: "{**/*.tf,**/Dockerfile,**/Dockerfile.*,**/docker-compose.yml,**/docker-compose.*.yml,helm/**/*,k8s/**/*,kubernetes/**/*}" + instructions: | + Focus on: + - IaC security and misconfigurations (least privilege, restricted policies) + - Safe defaults (no hard-coded secrets, pinned images, versioned modules) + - Container best practices (non-root user, slim base images, healthchecks) + - Network exposure and port/security group rules + - Kubernetes/Helm best practices (resource limits, probes, RBAC) + + # Documentation (markdown files in root and docs directory) + - path: "**/*.md" + instructions: | + Focus on: + - Clarity and completeness + - Up-to-date information + - Proper markdown formatting + - Security policy accuracy + - Contribution guidelines + + # Configuration files + - path: "requirements.txt" + instructions: | + Focus on: + - Dependency security and versions + - Configuration best practices + - Security implications + - Proper formatting and structure + + - path: "pyproject.toml" + instructions: | + Focus on: + - Dependency security and versions + - Configuration best practices + - Security implications + - Proper formatting and structure + + - path: "*.yaml" + instructions: | + Focus on: + - Configuration best practices + - Security implications + - Proper formatting and structure + + - path: "*.yml" + instructions: | + Focus on: + - Configuration best practices + - Security implications + - Proper formatting and structure \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cc57e3..ebaf300 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,19 +22,16 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt - pip install safety pip-audit - - name: Update vulnerable dependencies - run: | - pip install --upgrade pip - pip install --upgrade starlette - name: Lint run: | ruff check src black --check src - name: Security audit + id: security-audit + continue-on-error: true run: | - safety check --json > safety-results.json || true - pip-audit --desc --format=json --output=audit-results.json || true + safety scan --json > safety-results.json + pip-audit --desc --format=json --output=audit-results.json - name: Upload security audit results if: always() uses: actions/upload-artifact@v4 @@ -43,6 +40,24 @@ jobs: path: | safety-results.json audit-results.json + - name: Security audit failure notification + if: failure() && steps.security-audit.outcome == 'failure' + run: | + echo "::warning::Security audit failed! Check the security-audit-results artifact for details." + echo "::group::Safety scan results" + if [ -f safety-results.json ]; then + cat safety-results.json + else + echo "safety-results.json not found" + fi + echo "::endgroup::" + echo "::group::Pip audit results" + if [ -f audit-results.json ]; then + cat audit-results.json + else + echo "audit-results.json not found" + fi + echo "::endgroup::" - name: Import smoke test run: | python - << 'PY' diff --git a/.gitignore b/.gitignore index 56b5149..ea38d40 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,8 @@ node_modules/ logs/ data/ +# Security scan artifacts +safety-results.json +audit-results.json + diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 97e4e4e..92bd81d 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,13 +2,20 @@ ## Our Pledge -We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation. +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. -We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. ## Our Standards -Examples of behavior that contributes to a positive environment for our community include: +Examples of behavior that contributes to a positive environment for our +community include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences @@ -18,59 +25,102 @@ Examples of behavior that contributes to a positive environment for our communit Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or advances of any kind +* The use of sexualized language or imagery, and sexual attention or advances + of any kind * Trolling, insulting or derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting ## Enforcement Responsibilities -Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. -Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for +moderation decisions when appropriate. ## Scope -This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [conduct@virtualagentics.com](mailto:conduct@virtualagentics.com). All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[conduct@virtualagentics.com](mailto:conduct@virtualagentics.com). All +complaints will be reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the reporter of any incident. +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. ## Enforcement Guidelines -Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: ### 1. Correction -**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. -**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. ### 2. Warning + **Community Impact**: A violation through a single incident or series of actions. -**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. ### 3. Temporary Ban -**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. -**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. ### 4. Permanent Ban -**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. -**Consequence**: A permanent ban from any sort of public interaction within the community. +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. -Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. +Community Impact Guidelines were inspired by [Mozilla's code of conduct +enforcement ladder][Mozilla CoC]. -For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d87f1b9..366dabd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,10 +1,12 @@ # Contributing to ContextForge Memory -Thank you for your interest in contributing to ContextForge Memory! This document provides guidelines for contributing to the project. +Thank you for your interest in contributing to ContextForge Memory! This +document provides guidelines for contributing to the project. ## Code of Conduct -This project adheres to our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. +This project adheres to our [Code of Conduct](CODE_OF_CONDUCT.md). By +participating, you are expected to uphold this code. ## Getting Started @@ -36,6 +38,7 @@ python -m pytest ### Branch Naming Use descriptive branch names: + - `feature/add-new-endpoint` - `bugfix/fix-search-filtering` - `docs/update-readme` @@ -43,12 +46,14 @@ Use descriptive branch names: ### Commit Messages Write clear, descriptive commit messages: + - Use present tense ("Add feature" not "Added feature") - Capitalize the first letter - No period at the end - Reference issues when applicable Examples: + - `Add support for custom metadata validation` - `Fix search results ordering bug (#123)` - `Update API documentation` @@ -58,11 +63,13 @@ Examples: ### Before Submitting 1. **Run Tests**: Ensure all tests pass + ```bash python -m pytest ``` 2. **Run Linting**: Fix any linting issues + ```bash ruff check src black src @@ -177,4 +184,5 @@ If you have questions about contributing, please: ## Thank You -Thank you for contributing to ContextForge Memory! Your contributions help make this project better for everyone. +Thank you for contributing to ContextForge Memory! Your contributions help make +this project better for everyone. diff --git a/README.md b/README.md index d10b727..a276514 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,24 @@ -## ContextForge Memory (v0) +# ContextForge Memory (v0) -Lightweight external memory layer providing store, search, and embed APIs for multi-repo reuse (Brainstorm, Cursor, and others). +Lightweight external memory layer providing store, search, and embed APIs for +multi-repo reuse (Brainstorm, Cursor, and others). + +## Features -### Features - Versioned API: `/v0/` with `store`, `search`, `embed`. - Deterministic, minimal embedding (hash-based) for baseline functionality. - Pluggable storage (default: JSONL on disk). -### Quickstart +## Quickstart + ```bash python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt uvicorn src.contextforge_memory.main:app --host 0.0.0.0 --port 8085 ``` -### API Endpoints +## API Endpoints + - `GET /v0/health` - `POST /v0/store` - `POST /v0/search` @@ -22,11 +26,11 @@ uvicorn src.contextforge_memory.main:app --host 0.0.0.0 --port 8085 See `openapi/openapi-v0.yaml` for schemas. -### Clients +## Clients + - Python: `clients/python/contextforge_client.py` - TypeScript: `clients/typescript/contextforgeClient.ts` -### CI -Basic import smoke in GitHub Actions (see `.github/workflows/ci.yml`). - +## CI +Basic import smoke in GitHub Actions (see `.github/workflows/ci.yml`). diff --git a/SECURITY.md b/SECURITY.md index 056d50a..b64e013 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -10,7 +10,9 @@ We currently support the following versions of ContextForge Memory: ## Reporting a Vulnerability -We take security vulnerabilities seriously. If you discover a security vulnerability in ContextForge Memory, please report it to us as described below. +We take security vulnerabilities seriously. If you discover a security +vulnerability in ContextForge Memory, please report it to us as described +below. ### How to Report @@ -35,7 +37,8 @@ When reporting a vulnerability, please include: ### Security Updates -Security updates will be released as patch versions (e.g., 0.1.1) and will be announced in the project's release notes. +Security updates will be released as patch versions (e.g., 0.1.1) and will be +announced in the project's release notes. ## Security Best Practices @@ -49,4 +52,6 @@ When using ContextForge Memory: ## Acknowledgments -We appreciate the security research community's efforts to help keep our software secure. We will acknowledge security researchers who responsibly disclose vulnerabilities to us. +We appreciate the security research community's efforts to help keep our +software secure. We will acknowledge security researchers who responsibly +disclose vulnerabilities to us. diff --git a/clients/python/contextforge_client.py b/clients/python/contextforge_client.py index 3c94b90..0343eea 100644 --- a/clients/python/contextforge_client.py +++ b/clients/python/contextforge_client.py @@ -15,11 +15,15 @@ def health(self) -> Dict[str, Any]: return r.json() def store(self, items: List[Dict[str, Any]]) -> Dict[str, Any]: - r = self._client.post(f"{self.base_url}/v0/store", json={"items": items}) + r = self._client.post( + f"{self.base_url}/v0/store", json={"items": items} + ) r.raise_for_status() return r.json() - def search(self, namespace: str, project_id: str, query: str, top_k: int = 5) -> Dict[str, Any]: + def search( + self, namespace: str, project_id: str, query: str, top_k: int = 5 + ) -> Dict[str, Any]: payload = { "namespace": namespace, "project_id": project_id, @@ -31,8 +35,8 @@ def search(self, namespace: str, project_id: str, query: str, top_k: int = 5) -> return r.json() def embed(self, texts: List[str]) -> Dict[str, Any]: - r = self._client.post(f"{self.base_url}/v0/embed", json={"texts": texts}) + r = self._client.post( + f"{self.base_url}/v0/embed", json={"texts": texts} + ) r.raise_for_status() return r.json() - - diff --git a/requirements.txt b/requirements.txt index f947920..29bc924 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fastapi>=0.115.0 +fastapi==0.119.0 uvicorn[standard]==0.30.6 pydantic==2.9.2 orjson==3.10.7 @@ -7,10 +7,8 @@ pytest==8.3.3 httpx==0.27.2 ruff==0.6.9 black==24.8.0 +starlette==0.48.0 safety==3.6.2 pip-audit==2.9.0 -# Security: Updated to latest versions to fix vulnerabilities -# pip>=25.0 (handled by upgrade in CI) -# starlette>=0.47.2 (handled by upgrade in CI) diff --git a/safety-results.json b/safety-results.json deleted file mode 100644 index 92a8ddc..0000000 --- a/safety-results.json +++ /dev/null @@ -1,1452 +0,0 @@ - - -+===========================================================================================================================================================================================+ - - -DEPRECATED: this command (`check`) has been DEPRECATED, and will be unsupported beyond 01 June 2024. - - -We highly encourage switching to the new `scan` command which is easier to use, more powerful, and can be set up to mimic the deprecated command if required. - - -+===========================================================================================================================================================================================+ - - -{ - "report_meta": { - "scan_target": "environment", - "scanned": [ - "/usr/lib/python3.12/lib-dynload", - "/usr/lib/python3.12", - "/home/bofh/projects/ConextForge_memory/.venv/bin", - "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages", - "/usr/lib/python312.zip", - "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - ], - "scanned_full_path": [ - "/home/bofh/projects/ConextForge_memory/.venv/bin", - "/usr/lib/python312.zip", - "/usr/lib/python3.12", - "/usr/lib/python3.12/lib-dynload", - "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages", - "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - ], - "target_languages": [ - "python" - ], - "policy_file": null, - "policy_file_source": "local", - "audit_and_monitor": false, - "api_key": false, - "account": "", - "local_database_path": null, - "safety_version": "3.6.2", - "timestamp": "2025-10-20 00:50:21", - "packages_found": 90, - "vulnerabilities_found": 0, - "vulnerabilities_ignored": 0, - "remediations_recommended": 0, - "telemetry": { - "safety_options": { - "json": { - "--json": 1 - } - }, - "safety_version": "3.6.2", - "safety_source": "cli", - "os_type": "Linux", - "os_release": "6.14.0-33-generic", - "os_description": "Linux-6.14.0-33-generic-x86_64-with-glibc2.39", - "python_version": "3.12.3", - "safety_command": "check" - }, - "git": { - "branch": "main", - "tag": "", - "commit": "da4bbd6ead174231d0c355ab87866560fa32f996", - "dirty": "True", - "origin": "git@github.com:VirtualAgentics/ConextForge_memory.git" - }, - "project": null, - "json_version": "1.1", - "remediations_attempted": 0, - "remediations_completed": 0, - "remediation_mode": "NON_INTERACTIVE" - }, - "scanned_packages": { - "annotated-types": { - "name": "annotated-types", - "version": "0.7.0", - "requirements": [ - { - "raw": "annotated-types==0.7.0", - "extras": [], - "marker": null, - "name": "annotated-types", - "specifier": "==0.7.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "anyio": { - "name": "anyio", - "version": "4.11.0", - "requirements": [ - { - "raw": "anyio==4.11.0", - "extras": [], - "marker": null, - "name": "anyio", - "specifier": "==4.11.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "authlib": { - "name": "authlib", - "version": "1.6.5", - "requirements": [ - { - "raw": "authlib==1.6.5", - "extras": [], - "marker": null, - "name": "authlib", - "specifier": "==1.6.5", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "black": { - "name": "black", - "version": "24.8.0", - "requirements": [ - { - "raw": "black==24.8.0", - "extras": [], - "marker": null, - "name": "black", - "specifier": "==24.8.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "boolean-py": { - "name": "boolean-py", - "version": "5.0", - "requirements": [ - { - "raw": "boolean-py==5.0", - "extras": [], - "marker": null, - "name": "boolean-py", - "specifier": "==5.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "cachecontrol": { - "name": "cachecontrol", - "version": "0.14.3", - "requirements": [ - { - "raw": "cachecontrol==0.14.3", - "extras": [], - "marker": null, - "name": "cachecontrol", - "specifier": "==0.14.3", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "certifi": { - "name": "certifi", - "version": "2025.10.5", - "requirements": [ - { - "raw": "certifi==2025.10.5", - "extras": [], - "marker": null, - "name": "certifi", - "specifier": "==2025.10.5", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "cffi": { - "name": "cffi", - "version": "2.0.0", - "requirements": [ - { - "raw": "cffi==2.0.0", - "extras": [], - "marker": null, - "name": "cffi", - "specifier": "==2.0.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "charset-normalizer": { - "name": "charset-normalizer", - "version": "3.4.4", - "requirements": [ - { - "raw": "charset-normalizer==3.4.4", - "extras": [], - "marker": null, - "name": "charset-normalizer", - "specifier": "==3.4.4", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "click": { - "name": "click", - "version": "8.3.0", - "requirements": [ - { - "raw": "click==8.3.0", - "extras": [], - "marker": null, - "name": "click", - "specifier": "==8.3.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "cryptography": { - "name": "cryptography", - "version": "46.0.3", - "requirements": [ - { - "raw": "cryptography==46.0.3", - "extras": [], - "marker": null, - "name": "cryptography", - "specifier": "==46.0.3", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "cyclonedx-python-lib": { - "name": "cyclonedx-python-lib", - "version": "9.1.0", - "requirements": [ - { - "raw": "cyclonedx-python-lib==9.1.0", - "extras": [], - "marker": null, - "name": "cyclonedx-python-lib", - "specifier": "==9.1.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "defusedxml": { - "name": "defusedxml", - "version": "0.7.1", - "requirements": [ - { - "raw": "defusedxml==0.7.1", - "extras": [], - "marker": null, - "name": "defusedxml", - "specifier": "==0.7.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "dparse": { - "name": "dparse", - "version": "0.6.4", - "requirements": [ - { - "raw": "dparse==0.6.4", - "extras": [], - "marker": null, - "name": "dparse", - "specifier": "==0.6.4", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "fastapi": { - "name": "fastapi", - "version": "0.119.0", - "requirements": [ - { - "raw": "fastapi==0.119.0", - "extras": [], - "marker": null, - "name": "fastapi", - "specifier": "==0.119.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "filelock": { - "name": "filelock", - "version": "3.20.0", - "requirements": [ - { - "raw": "filelock==3.20.0", - "extras": [], - "marker": null, - "name": "filelock", - "specifier": "==3.20.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "h11": { - "name": "h11", - "version": "0.16.0", - "requirements": [ - { - "raw": "h11==0.16.0", - "extras": [], - "marker": null, - "name": "h11", - "specifier": "==0.16.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "httpcore": { - "name": "httpcore", - "version": "1.0.9", - "requirements": [ - { - "raw": "httpcore==1.0.9", - "extras": [], - "marker": null, - "name": "httpcore", - "specifier": "==1.0.9", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "httptools": { - "name": "httptools", - "version": "0.7.1", - "requirements": [ - { - "raw": "httptools==0.7.1", - "extras": [], - "marker": null, - "name": "httptools", - "specifier": "==0.7.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "httpx": { - "name": "httpx", - "version": "0.27.2", - "requirements": [ - { - "raw": "httpx==0.27.2", - "extras": [], - "marker": null, - "name": "httpx", - "specifier": "==0.27.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "idna": { - "name": "idna", - "version": "3.11", - "requirements": [ - { - "raw": "idna==3.11", - "extras": [], - "marker": null, - "name": "idna", - "specifier": "==3.11", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "iniconfig": { - "name": "iniconfig", - "version": "2.3.0", - "requirements": [ - { - "raw": "iniconfig==2.3.0", - "extras": [], - "marker": null, - "name": "iniconfig", - "specifier": "==2.3.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "jinja2": { - "name": "jinja2", - "version": "3.1.6", - "requirements": [ - { - "raw": "jinja2==3.1.6", - "extras": [], - "marker": null, - "name": "jinja2", - "specifier": "==3.1.6", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "joblib": { - "name": "joblib", - "version": "1.5.2", - "requirements": [ - { - "raw": "joblib==1.5.2", - "extras": [], - "marker": null, - "name": "joblib", - "specifier": "==1.5.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "license-expression": { - "name": "license-expression", - "version": "30.4.4", - "requirements": [ - { - "raw": "license-expression==30.4.4", - "extras": [], - "marker": null, - "name": "license-expression", - "specifier": "==30.4.4", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "markdown-it-py": { - "name": "markdown-it-py", - "version": "4.0.0", - "requirements": [ - { - "raw": "markdown-it-py==4.0.0", - "extras": [], - "marker": null, - "name": "markdown-it-py", - "specifier": "==4.0.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "markupsafe": { - "name": "markupsafe", - "version": "3.0.3", - "requirements": [ - { - "raw": "markupsafe==3.0.3", - "extras": [], - "marker": null, - "name": "markupsafe", - "specifier": "==3.0.3", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "marshmallow": { - "name": "marshmallow", - "version": "4.0.1", - "requirements": [ - { - "raw": "marshmallow==4.0.1", - "extras": [], - "marker": null, - "name": "marshmallow", - "specifier": "==4.0.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "mdurl": { - "name": "mdurl", - "version": "0.1.2", - "requirements": [ - { - "raw": "mdurl==0.1.2", - "extras": [], - "marker": null, - "name": "mdurl", - "specifier": "==0.1.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "msgpack": { - "name": "msgpack", - "version": "1.1.2", - "requirements": [ - { - "raw": "msgpack==1.1.2", - "extras": [], - "marker": null, - "name": "msgpack", - "specifier": "==1.1.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "mypy-extensions": { - "name": "mypy-extensions", - "version": "1.1.0", - "requirements": [ - { - "raw": "mypy-extensions==1.1.0", - "extras": [], - "marker": null, - "name": "mypy-extensions", - "specifier": "==1.1.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "nltk": { - "name": "nltk", - "version": "3.9.2", - "requirements": [ - { - "raw": "nltk==3.9.2", - "extras": [], - "marker": null, - "name": "nltk", - "specifier": "==3.9.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "numpy": { - "name": "numpy", - "version": "2.1.1", - "requirements": [ - { - "raw": "numpy==2.1.1", - "extras": [], - "marker": null, - "name": "numpy", - "specifier": "==2.1.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "orjson": { - "name": "orjson", - "version": "3.10.7", - "requirements": [ - { - "raw": "orjson==3.10.7", - "extras": [], - "marker": null, - "name": "orjson", - "specifier": "==3.10.7", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "packageurl-python": { - "name": "packageurl-python", - "version": "0.17.5", - "requirements": [ - { - "raw": "packageurl-python==0.17.5", - "extras": [], - "marker": null, - "name": "packageurl-python", - "specifier": "==0.17.5", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "packaging": { - "name": "packaging", - "version": "25.0", - "requirements": [ - { - "raw": "packaging==25.0", - "extras": [], - "marker": null, - "name": "packaging", - "specifier": "==25.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pathspec": { - "name": "pathspec", - "version": "0.12.1", - "requirements": [ - { - "raw": "pathspec==0.12.1", - "extras": [], - "marker": null, - "name": "pathspec", - "specifier": "==0.12.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pip": { - "name": "pip", - "version": "25.2", - "requirements": [ - { - "raw": "pip==25.2", - "extras": [], - "marker": null, - "name": "pip", - "specifier": "==25.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pip-api": { - "name": "pip-api", - "version": "0.0.34", - "requirements": [ - { - "raw": "pip-api==0.0.34", - "extras": [], - "marker": null, - "name": "pip-api", - "specifier": "==0.0.34", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pip-audit": { - "name": "pip-audit", - "version": "2.9.0", - "requirements": [ - { - "raw": "pip-audit==2.9.0", - "extras": [], - "marker": null, - "name": "pip-audit", - "specifier": "==2.9.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pip-requirements-parser": { - "name": "pip-requirements-parser", - "version": "32.0.1", - "requirements": [ - { - "raw": "pip-requirements-parser==32.0.1", - "extras": [], - "marker": null, - "name": "pip-requirements-parser", - "specifier": "==32.0.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "platformdirs": { - "name": "platformdirs", - "version": "4.5.0", - "requirements": [ - { - "raw": "platformdirs==4.5.0", - "extras": [], - "marker": null, - "name": "platformdirs", - "specifier": "==4.5.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pluggy": { - "name": "pluggy", - "version": "1.6.0", - "requirements": [ - { - "raw": "pluggy==1.6.0", - "extras": [], - "marker": null, - "name": "pluggy", - "specifier": "==1.6.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "psutil": { - "name": "psutil", - "version": "7.1.1", - "requirements": [ - { - "raw": "psutil==7.1.1", - "extras": [], - "marker": null, - "name": "psutil", - "specifier": "==7.1.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "py-serializable": { - "name": "py-serializable", - "version": "2.1.0", - "requirements": [ - { - "raw": "py-serializable==2.1.0", - "extras": [], - "marker": null, - "name": "py-serializable", - "specifier": "==2.1.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pycparser": { - "name": "pycparser", - "version": "2.23", - "requirements": [ - { - "raw": "pycparser==2.23", - "extras": [], - "marker": null, - "name": "pycparser", - "specifier": "==2.23", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pydantic": { - "name": "pydantic", - "version": "2.9.2", - "requirements": [ - { - "raw": "pydantic==2.9.2", - "extras": [], - "marker": null, - "name": "pydantic", - "specifier": "==2.9.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pydantic-core": { - "name": "pydantic-core", - "version": "2.23.4", - "requirements": [ - { - "raw": "pydantic-core==2.23.4", - "extras": [], - "marker": null, - "name": "pydantic-core", - "specifier": "==2.23.4", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pygments": { - "name": "pygments", - "version": "2.19.2", - "requirements": [ - { - "raw": "pygments==2.19.2", - "extras": [], - "marker": null, - "name": "pygments", - "specifier": "==2.19.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pyparsing": { - "name": "pyparsing", - "version": "3.2.5", - "requirements": [ - { - "raw": "pyparsing==3.2.5", - "extras": [], - "marker": null, - "name": "pyparsing", - "specifier": "==3.2.5", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pytest": { - "name": "pytest", - "version": "8.3.3", - "requirements": [ - { - "raw": "pytest==8.3.3", - "extras": [], - "marker": null, - "name": "pytest", - "specifier": "==8.3.3", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "python-dotenv": { - "name": "python-dotenv", - "version": "1.1.1", - "requirements": [ - { - "raw": "python-dotenv==1.1.1", - "extras": [], - "marker": null, - "name": "python-dotenv", - "specifier": "==1.1.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "pyyaml": { - "name": "pyyaml", - "version": "6.0.3", - "requirements": [ - { - "raw": "pyyaml==6.0.3", - "extras": [], - "marker": null, - "name": "pyyaml", - "specifier": "==6.0.3", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "regex": { - "name": "regex", - "version": "2025.9.18", - "requirements": [ - { - "raw": "regex==2025.9.18", - "extras": [], - "marker": null, - "name": "regex", - "specifier": "==2025.9.18", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "requests": { - "name": "requests", - "version": "2.32.5", - "requirements": [ - { - "raw": "requests==2.32.5", - "extras": [], - "marker": null, - "name": "requests", - "specifier": "==2.32.5", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "rich": { - "name": "rich", - "version": "14.2.0", - "requirements": [ - { - "raw": "rich==14.2.0", - "extras": [], - "marker": null, - "name": "rich", - "specifier": "==14.2.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "ruamel.yaml": { - "name": "ruamel.yaml", - "version": "0.18.15", - "requirements": [ - { - "raw": "ruamel.yaml==0.18.15", - "extras": [], - "marker": null, - "name": "ruamel.yaml", - "specifier": "==0.18.15", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "ruamel.yaml.clib": { - "name": "ruamel.yaml.clib", - "version": "0.2.14", - "requirements": [ - { - "raw": "ruamel.yaml.clib==0.2.14", - "extras": [], - "marker": null, - "name": "ruamel.yaml.clib", - "specifier": "==0.2.14", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "ruff": { - "name": "ruff", - "version": "0.6.9", - "requirements": [ - { - "raw": "ruff==0.6.9", - "extras": [], - "marker": null, - "name": "ruff", - "specifier": "==0.6.9", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "safety": { - "name": "safety", - "version": "3.6.2", - "requirements": [ - { - "raw": "safety==3.6.2", - "extras": [], - "marker": null, - "name": "safety", - "specifier": "==3.6.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "safety-schemas": { - "name": "safety-schemas", - "version": "0.0.16", - "requirements": [ - { - "raw": "safety-schemas==0.0.16", - "extras": [], - "marker": null, - "name": "safety-schemas", - "specifier": "==0.0.16", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "setuptools": { - "name": "setuptools", - "version": "80.9.0", - "requirements": [ - { - "raw": "setuptools==80.9.0", - "extras": [], - "marker": null, - "name": "setuptools", - "specifier": "==80.9.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "shellingham": { - "name": "shellingham", - "version": "1.5.4", - "requirements": [ - { - "raw": "shellingham==1.5.4", - "extras": [], - "marker": null, - "name": "shellingham", - "specifier": "==1.5.4", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "sniffio": { - "name": "sniffio", - "version": "1.3.1", - "requirements": [ - { - "raw": "sniffio==1.3.1", - "extras": [], - "marker": null, - "name": "sniffio", - "specifier": "==1.3.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "sortedcontainers": { - "name": "sortedcontainers", - "version": "2.4.0", - "requirements": [ - { - "raw": "sortedcontainers==2.4.0", - "extras": [], - "marker": null, - "name": "sortedcontainers", - "specifier": "==2.4.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "starlette": { - "name": "starlette", - "version": "0.48.0", - "requirements": [ - { - "raw": "starlette==0.48.0", - "extras": [], - "marker": null, - "name": "starlette", - "specifier": "==0.48.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "tenacity": { - "name": "tenacity", - "version": "9.1.2", - "requirements": [ - { - "raw": "tenacity==9.1.2", - "extras": [], - "marker": null, - "name": "tenacity", - "specifier": "==9.1.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "toml": { - "name": "toml", - "version": "0.10.2", - "requirements": [ - { - "raw": "toml==0.10.2", - "extras": [], - "marker": null, - "name": "toml", - "specifier": "==0.10.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "tomlkit": { - "name": "tomlkit", - "version": "0.13.3", - "requirements": [ - { - "raw": "tomlkit==0.13.3", - "extras": [], - "marker": null, - "name": "tomlkit", - "specifier": "==0.13.3", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "tqdm": { - "name": "tqdm", - "version": "4.67.1", - "requirements": [ - { - "raw": "tqdm==4.67.1", - "extras": [], - "marker": null, - "name": "tqdm", - "specifier": "==4.67.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "typer": { - "name": "typer", - "version": "0.19.2", - "requirements": [ - { - "raw": "typer==0.19.2", - "extras": [], - "marker": null, - "name": "typer", - "specifier": "==0.19.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "typing-extensions": { - "name": "typing-extensions", - "version": "4.15.0", - "requirements": [ - { - "raw": "typing-extensions==4.15.0", - "extras": [], - "marker": null, - "name": "typing-extensions", - "specifier": "==4.15.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "urllib3": { - "name": "urllib3", - "version": "2.5.0", - "requirements": [ - { - "raw": "urllib3==2.5.0", - "extras": [], - "marker": null, - "name": "urllib3", - "specifier": "==2.5.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "uvicorn": { - "name": "uvicorn", - "version": "0.30.6", - "requirements": [ - { - "raw": "uvicorn==0.30.6", - "extras": [], - "marker": null, - "name": "uvicorn", - "specifier": "==0.30.6", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "uvloop": { - "name": "uvloop", - "version": "0.22.1", - "requirements": [ - { - "raw": "uvloop==0.22.1", - "extras": [], - "marker": null, - "name": "uvloop", - "specifier": "==0.22.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "watchfiles": { - "name": "watchfiles", - "version": "1.1.1", - "requirements": [ - { - "raw": "watchfiles==1.1.1", - "extras": [], - "marker": null, - "name": "watchfiles", - "specifier": "==1.1.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "websockets": { - "name": "websockets", - "version": "15.0.1", - "requirements": [ - { - "raw": "websockets==15.0.1", - "extras": [], - "marker": null, - "name": "websockets", - "specifier": "==15.0.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages" - } - ] - }, - "autocommand": { - "name": "autocommand", - "version": "2.2.2", - "requirements": [ - { - "raw": "autocommand==2.2.2", - "extras": [], - "marker": null, - "name": "autocommand", - "specifier": "==2.2.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "backports.tarfile": { - "name": "backports.tarfile", - "version": "1.2.0", - "requirements": [ - { - "raw": "backports.tarfile==1.2.0", - "extras": [], - "marker": null, - "name": "backports.tarfile", - "specifier": "==1.2.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "importlib-metadata": { - "name": "importlib-metadata", - "version": "8.0.0", - "requirements": [ - { - "raw": "importlib-metadata==8.0.0", - "extras": [], - "marker": null, - "name": "importlib-metadata", - "specifier": "==8.0.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "inflect": { - "name": "inflect", - "version": "7.3.1", - "requirements": [ - { - "raw": "inflect==7.3.1", - "extras": [], - "marker": null, - "name": "inflect", - "specifier": "==7.3.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "jaraco.collections": { - "name": "jaraco.collections", - "version": "5.1.0", - "requirements": [ - { - "raw": "jaraco.collections==5.1.0", - "extras": [], - "marker": null, - "name": "jaraco.collections", - "specifier": "==5.1.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "jaraco.context": { - "name": "jaraco.context", - "version": "5.3.0", - "requirements": [ - { - "raw": "jaraco.context==5.3.0", - "extras": [], - "marker": null, - "name": "jaraco.context", - "specifier": "==5.3.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "jaraco.functools": { - "name": "jaraco.functools", - "version": "4.0.1", - "requirements": [ - { - "raw": "jaraco.functools==4.0.1", - "extras": [], - "marker": null, - "name": "jaraco.functools", - "specifier": "==4.0.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "jaraco.text": { - "name": "jaraco.text", - "version": "3.12.1", - "requirements": [ - { - "raw": "jaraco.text==3.12.1", - "extras": [], - "marker": null, - "name": "jaraco.text", - "specifier": "==3.12.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "more-itertools": { - "name": "more-itertools", - "version": "10.3.0", - "requirements": [ - { - "raw": "more-itertools==10.3.0", - "extras": [], - "marker": null, - "name": "more-itertools", - "specifier": "==10.3.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "tomli": { - "name": "tomli", - "version": "2.0.1", - "requirements": [ - { - "raw": "tomli==2.0.1", - "extras": [], - "marker": null, - "name": "tomli", - "specifier": "==2.0.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "typeguard": { - "name": "typeguard", - "version": "4.3.0", - "requirements": [ - { - "raw": "typeguard==4.3.0", - "extras": [], - "marker": null, - "name": "typeguard", - "specifier": "==4.3.0", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "wheel": { - "name": "wheel", - "version": "0.45.1", - "requirements": [ - { - "raw": "wheel==0.45.1", - "extras": [], - "marker": null, - "name": "wheel", - "specifier": "==0.45.1", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - }, - "zipp": { - "name": "zipp", - "version": "3.19.2", - "requirements": [ - { - "raw": "zipp==3.19.2", - "extras": [], - "marker": null, - "name": "zipp", - "specifier": "==3.19.2", - "url": null, - "found": "/home/bofh/projects/ConextForge_memory/.venv/lib/python3.12/site-packages/setuptools/_vendor" - } - ] - } - }, - "affected_packages": {}, - "announcements": [], - "vulnerabilities": [], - "ignored_vulnerabilities": [], - "remediations": {}, - "remediations_results": { - "vulnerabilities_fixed": [], - "remediations_applied": {}, - "remediations_skipped": {} - } -} - - -+===========================================================================================================================================================================================+ - - -DEPRECATED: this command (`check`) has been DEPRECATED, and will be unsupported beyond 01 June 2024. - - -We highly encourage switching to the new `scan` command which is easier to use, more powerful, and can be set up to mimic the deprecated command if required. - - -+===========================================================================================================================================================================================+ - - diff --git a/src/contextforge_memory/main.py b/src/contextforge_memory/main.py index 211c991..5fd0b00 100644 --- a/src/contextforge_memory/main.py +++ b/src/contextforge_memory/main.py @@ -87,10 +87,8 @@ def search(req: SearchRequest) -> SearchResponse: return SearchResponse(results=results) query_vec = _embed_text(req.query) - def score(a: List[float], b: List[float]) -> float: - # Simple L2 distance inverted - return -sum((x - y) ** 2 for x, y in zip(a, b)) - + # Store items with their precomputed embeddings + items_with_embeddings: List[tuple[MemoryItem, List[float]]] = [] with bucket.open("r", encoding="utf-8") as f: for line in f: data = orjson.loads(line) @@ -99,16 +97,18 @@ def score(a: List[float], b: List[float]) -> float: or data.get("project_id") != req.project_id ): continue - item_vec = _embed_text(data.get("text", "")) - data["_score"] = score(query_vec, item_vec) - results.append( - MemoryItem(**{k: v for k, v in data.items() if k != "_score"}) - ) - - # Sort by score descending based on cached scores; recompute on the fly for simplicity - results.sort( - key=lambda it: -sum( - (x - y) ** 2 for x, y in zip(_embed_text(req.query), _embed_text(it.text)) + item = MemoryItem(**data) + # Compute embedding once during the initial loop + embedding = _embed_text(item.text) + items_with_embeddings.append((item, embedding)) + + # Sort by score descending using precomputed embeddings + items_with_embeddings.sort( + key=lambda item_embed: -sum( + (x - y) ** 2 for x, y in zip(query_vec, item_embed[1]) ) ) - return SearchResponse(results=results[: max(1, req.top_k)]) + + # Extract just the MemoryItem objects for the response + results = [item for item, _ in items_with_embeddings[: max(1, req.top_k)]] + return SearchResponse(results=results)