### Docker Quick Start: Setup Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Clone the repository, navigate to the directory, and start the services using Docker Compose. ```bash git clone https://github.com/MihaiBuilds/memory-vault.git cd memory-vault docker compose up -d ``` -------------------------------- ### No-Docker Quick Start: Setup Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Clone the repository, set up a Python virtual environment, install dependencies, configure environment variables, and run migrations. ```bash # Clone git clone https://github.com/MihaiBuilds/memory-vault.git cd memory-vault # Create virtual environment python -m venv .venv source .venv/bin/activate # Install dependencies pip install -e . # Configure cp .env.example .env # Edit .env with your PostgreSQL credentials # Run migrations memory-vault migrate # Verify memory-vault status ``` -------------------------------- ### Docker Quick Start: Search Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Perform a search query within Memory Vault when using the Docker setup. ```bash docker compose exec app memory-vault search "your query here" ``` -------------------------------- ### Set Up and Run Dashboard Development Server Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Navigate to the web directory, install Node.js dependencies, and start the Vite development server for the dashboard. It proxies API requests to the backend. ```bash cd web npm install npm run dev ``` -------------------------------- ### Docker Quick Start: Ingest File Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Ingest a file into Memory Vault using the Docker Compose setup. Specify the file path and the target space. ```bash docker compose exec app memory-vault ingest /path/to/file.md --space default ``` -------------------------------- ### Start Dockerized PostgreSQL Database Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Start only the PostgreSQL database using Docker Compose. The application itself will run locally for faster iteration. ```bash docker compose up -d db ``` -------------------------------- ### Docker Quick Start: Check Status Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Verify that Memory Vault is running correctly by checking its status within the Docker environment. ```bash docker compose exec app memory-vault status ``` -------------------------------- ### Run Backend API in Development Mode Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Start the Memory Vault API in development mode using uvicorn, enabling hot-reloading for faster iteration. ```bash uvicorn src.api.app:app --reload --port 8000 ``` -------------------------------- ### Clone Repository and Set Up Python Virtual Environment Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Clone the Memory Vault repository and set up a Python virtual environment for development. This includes installing development dependencies. ```bash git clone https://github.com/MihaiBuilds/memory-vault.git cd memory-vault python3 -m venv .venv source .venv/bin/activate pip install -e ".[dev]" ``` -------------------------------- ### GET /api/spaces Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Lists all available memory spaces, including their respective chunk counts. ```APIDOC ## GET /api/spaces ### Description List memory spaces with chunk counts ### Method GET ### Endpoint /api/spaces ### Parameters ### Request Example ### Response #### Success Response (200) - **spaces** (array) - A list of memory spaces, each with a chunk count. #### Response Example { "spaces": [ { "id": "space-1", "name": "Project Alpha", "chunk_count": 150 } ] } ``` -------------------------------- ### Perform Hybrid Search Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Example of performing a hybrid search query. Specify the query string, target spaces, and the desired number of results. ```bash curl -X POST http://localhost:8000/api/search \ -H "Authorization: Bearer $MV_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "query": "how does hybrid search work", "spaces": ["default"], "limit": 5 }' ``` -------------------------------- ### Docker Compose Setup for Memory Vault Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Defines the database (PostgreSQL with pgvector) and the memory-vault application services for local development using Docker Compose. ```yaml services: db: image: pgvector/pgvector:pg16 command: - postgres - -c - maintenance_work_mem=1GB volumes: - pgdata:/var/lib/postgresql/data app: build: . image: memory-vault-app:latest ports: ["8000:8000"] depends_on: db: { condition: service_healthy } ``` -------------------------------- ### Create a New Token Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Command to create a new bearer token, typically used after revoking an old one or for initial setup. ```bash # Create a new one docker compose exec app memory-vault token create dashboard ``` -------------------------------- ### Authenticate API Request Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Send a bearer token in the Authorization header to authenticate API requests. This example shows how to list memory spaces. ```bash curl -H "Authorization: Bearer mv_..." http://localhost:8000/api/spaces ``` -------------------------------- ### GET /api/graph/visualize Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Provides a payload of nodes and edges optimized for visualization. ```APIDOC ## GET /api/graph/visualize ### Description Node + edge payload sized for visualization ### Method GET ### Endpoint /api/graph/visualize ### Parameters ### Request Example ### Response #### Success Response (200) - **nodes** (array) - A list of nodes for visualization. - **edges** (array) - A list of edges for visualization. #### Response Example { "nodes": [ { "id": "entity-1", "label": "Project Alpha" } ], "edges": [ { "source": "entity-1", "target": "entity-2", "label": "depends_on" } ] } ``` -------------------------------- ### Memory Vault CLI Commands Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Commonly used memory-vault CLI commands for status checks, data ingestion, search, token and space management, migrations, diagnostics, and starting the API or MCP server. ```bash memory-vault status # DB health, chunk count, spaces memory-vault ingest path/to/file # one-shot ingest, with --space flag memory-vault search "query" # CLI search with verbose output memory-vault token create my-app # create a bearer token memory-vault token list / revoke memory-vault space create / list memory-vault migrate # run pending migrations (idempotent) memory-vault diagnose # produce a redacted diagnostic zip memory-vault api # start the REST API (uvicorn) memory-vault mcp # start the MCP server (stdio) ``` -------------------------------- ### GET /api/chunks Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Retrieves a list of chunks, supporting pagination and filtering. ```APIDOC ## GET /api/chunks ### Description List chunks with pagination + filters ### Method GET ### Endpoint /api/chunks ### Parameters #### Query Parameters - **limit** (integer) - Optional - The maximum number of chunks to return. - **offset** (integer) - Optional - The number of chunks to skip. - **space_id** (string) - Optional - Filter chunks by memory space ID. ### Request Example ### Response #### Success Response (200) - **chunks** (array) - A list of chunks. - **total** (integer) - The total number of chunks available. #### Response Example { "chunks": [ { "id": "chunk-1", "content": "This is a chunk of text." } ], "total": 100 } ``` -------------------------------- ### GET /api/graph/entities Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Lists entities with filtering capabilities. ```APIDOC ## GET /api/graph/entities ### Description List entities with filters ### Method GET ### Endpoint /api/graph/entities ### Parameters #### Query Parameters - **filter** (string) - Optional - Filter criteria for entities. ### Request Example ### Response #### Success Response (200) - **entities** (array) - A list of entities. #### Response Example { "entities": [ { "id": "entity-1", "name": "Project Alpha" } ] } ``` -------------------------------- ### GET /api/chunks/{id} Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Fetches the details of a single chunk by its ID. ```APIDOC ## GET /api/chunks/{id} ### Description Get a single chunk ### Method GET ### Endpoint /api/chunks/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the chunk to retrieve. ### Request Example ### Response #### Success Response (200) - **id** (string) - The unique identifier of the chunk. - **content** (string) - The content of the chunk. #### Response Example { "id": "chunk-1", "content": "This is a chunk of text." } ``` -------------------------------- ### Fix Windows Line-Ending Issues for Memory Vault Source: https://github.com/mihaibuilds/memory-vault/blob/main/docs/windows.md Run these commands within the memory-vault repository to resolve line-ending issues that cause the start script to fail. This configuration change is specific to this repository and should not affect other projects. ```bash cd memory-vault git config core.autocrlf false git rm --cached -r . git reset --hard docker compose build --no-cache docker compose up -d ``` -------------------------------- ### GET /api/graph/relationships Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Lists relationships (edges) between entities with filtering capabilities. ```APIDOC ## GET /api/graph/relationships ### Description List edges with filters ### Method GET ### Endpoint /api/graph/relationships ### Parameters #### Query Parameters - **filter** (string) - Optional - Filter criteria for relationships. ### Request Example ### Response #### Success Response (200) - **relationships** (array) - A list of relationships. #### Response Example { "relationships": [ { "source": "entity-1", "target": "entity-2", "type": "depends_on" } ] } ``` -------------------------------- ### Get Single Chunk Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Retrieves details for a specific chunk using its unique ID. Requires authentication. ```APIDOC ## GET /api/chunks/{id} ### Description Get a single chunk ### Method GET ### Endpoint /api/chunks/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the chunk. ``` -------------------------------- ### GET /api/health Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Retrieves the health status of the service and its database. This endpoint does not require authentication. ```APIDOC ## GET /api/health ### Description Service + DB health (no auth) ### Method GET ### Endpoint /api/health ### Parameters ### Request Example ### Response #### Success Response (200) - **status** (string) - Indicates the health status of the service and database. #### Response Example { "status": "ok" } ``` -------------------------------- ### GET /api/graph/entities/{id} Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Retrieves detailed information about a specific entity, including its mentions and related entities. ```APIDOC ## GET /api/graph/entities/{id} ### Description Entity detail (mentions, related) ### Method GET ### Endpoint /api/graph/entities/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the entity. ### Request Example ### Response #### Success Response (200) - **entity** (object) - Detailed information about the entity. - **id** (string) - The entity's ID. - **name** (string) - The entity's name. - **mentions** (array) - List of mentions of this entity. - **related** (array) - List of related entities. #### Response Example { "entity": { "id": "entity-1", "name": "Project Alpha", "mentions": ["Project Alpha is a key initiative."], "related": ["entity-2"] } } ``` -------------------------------- ### Run Database Migrations and Status Check Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Apply database migrations and perform a status check to ensure the database is set up correctly. ```bash memory-vault migrate memory-vault status ``` -------------------------------- ### Run Tests and Lint Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Execute the test suite and run the linter locally to ensure code quality before submitting changes. ```bash pytest ruff check . ``` -------------------------------- ### Run Security Pentest Source: https://github.com/mihaibuilds/memory-vault/blob/main/SECURITY.md Execute the security pentest script after setting up the Docker environment and creating a temporary token. Revoke the token after the test. ```bash docker compose up -d TOKEN=$(memory-vault token create pentest) API_URL=http://localhost:8000 API_TOKEN="$TOKEN" bash scripts/security-pentest.sh memory-vault token revoke "${TOKEN:0:11}" ``` -------------------------------- ### Create Authentication Token Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Use this command to create a new bearer token for API authentication. The token is displayed only once, so copy it immediately. ```bash docker compose exec app memory-vault token create my-app ``` -------------------------------- ### Create Dashboard Access Token Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Use this command to create a bearer token for accessing the dashboard. This token is shown only once, so copy it immediately. ```bash docker compose exec app memory-vault token create dashboard ``` -------------------------------- ### Upload a File for Ingestion Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Upload a file to be processed through the ingestion pipeline. The file is sent as form data, and the target space is specified. ```bash curl -X POST http://localhost:8000/api/ingest/file \ -H "Authorization: Bearer $MV_TOKEN" \ -F "file=@notes.md" \ -F "space=default" ``` -------------------------------- ### POST /api/spaces Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Creates a new memory space within the system. ```APIDOC ## POST /api/spaces ### Description Create a new memory space ### Method POST ### Endpoint /api/spaces ### Parameters #### Request Body - **name** (string) - Required - The name for the new memory space. ### Request Example { "name": "New Project" } ### Response #### Success Response (200) - **id** (string) - The unique identifier of the newly created memory space. - **name** (string) - The name of the newly created memory space. #### Response Example { "id": "space-2", "name": "New Project" } ``` -------------------------------- ### List Existing Tokens Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md View all currently active bearer tokens, including their prefixes which are used for revocation. ```bash # See which tokens exist docker compose exec app memory-vault token list ``` -------------------------------- ### No-Docker Usage: Search Memories Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Search for memories using a specific query and limit the number of results when running without Docker. ```bash memory-vault search "hybrid search architecture" --limit 5 ``` -------------------------------- ### No-Docker Usage: Check Status Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Check the status of Memory Vault when running without Docker. ```bash memory-vault status ``` -------------------------------- ### Memory Vault High-Level Architecture Diagram Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md This diagram illustrates the core components of Memory Vault and their interactions, showing how clients connect to the FastAPI backend, which then interfaces with the ingestion pipeline, search engine, knowledge graph, and PostgreSQL database. ```text ┌─────────────────────────────────────────────────────────────┐ │ Clients │ │ │ │ Claude (MCP) Web Dashboard REST API CLI │ └────────┬──────────────┬───────────────┬──────────┬──────────┘ │ │ │ │ │ └───── HTTP ────┘ │ │ │ │ │ ┌────────▼────────┐ │ │ │ FastAPI │ │ │ │ (REST + WebUI) │ │ │ └────────┬────────┘ │ │ │ │ ┌────▼─────────┐ │ ┌────▼──────┐ │ MCP Server │ │ │ memory- │ │ (stdio) │ │ │ vault CLI │ └──────┬───────┘ │ └────┬──────┘ │ │ │ └───────────────────┼───────────────────┘ │ ┌────────────────┼────────────────┐ │ │ │ ┌─────────▼──────┐ ┌───────▼────────┐ ┌─────▼─────────┐ │ Ingestion │ │ Hybrid Search │ │ Knowledge │ │ Pipeline │ │ Engine │ │ Graph │ │ - Markdown │ │ - Vector HNSW │ │ - spaCy NER │ │ - Plaintext │ │ - Full-text │ │ - Co-occur │ │ - Claude JSON │ │ - RRF merge │ │ - Cytoscape │ └─────────┬──────┘ └───────┬────────┘ └─────┬─────────┘ │ │ │ └────────────────┴────────────────┘ │ ┌────────────▼────────────┐ │ PostgreSQL 16 │ │ + pgvector │ │ │ │ memory_spaces │ │ chunks │ │ api_tokens │ │ entities │ │ relationships │ │ entity_mentions │ │ query_log │ └─────────────────────────┘ ``` -------------------------------- ### POST /api/ingest/file Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Uploads a file to be processed and ingested through the pipeline. ```APIDOC ## POST /api/ingest/file ### Description Upload a file through the ingestion pipeline ### Method POST ### Endpoint /api/ingest/file ### Parameters #### Request Body - **file** (file) - Required - The file to upload. - **space_id** (string) - Optional - The ID of the space to ingest into. ### Request Example (Form data with 'file' field) ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful file ingestion. #### Response Example { "message": "File ingested successfully." } ``` -------------------------------- ### Run Memory Vault Diagnostic Bundler Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Execute the diagnostic command within the Docker Compose environment to gather system information and logs for bug reporting. This command helps in collecting necessary data for troubleshooting. ```bash docker compose exec app memory-vault diagnose ``` -------------------------------- ### Run Backend Tests Source: https://github.com/mihaibuilds/memory-vault/blob/main/CONTRIBUTING.md Execute the full test suite or specific tests using pytest. You can run all tests, tests for a specific file, or filter tests by keyword. ```bash pytest # full suite pytest tests/test_chat_api.py -v # one file pytest -k "redaction" # by keyword ``` -------------------------------- ### Ingest File Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Uploads a file and processes it through the ingestion pipeline to create chunks in a specified memory space. Requires authentication and multipart/form-data request. ```APIDOC ## POST /api/ingest/file ### Description Upload a file through the ingestion pipeline ### Method POST ### Endpoint /api/ingest/file ### Parameters #### Request Body - **file** (file) - Required - The file to upload. - **space** (string) - Required - The name of the memory space to ingest the file into. ### Request Example curl -X POST http://localhost:8000/api/ingest/file \ -H "Authorization: Bearer $MV_TOKEN" \ -F "file=@notes.md" \ -F "space=default" ``` -------------------------------- ### Manage Authentication Tokens Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Commands to list existing tokens and revoke specific tokens. Replace 'mv_abc1234' with the actual token ID. ```bash memory-vault token list memory-vault token revoke mv_abc1234 ``` -------------------------------- ### POST /api/search Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Performs a hybrid search across memory spaces. ```APIDOC ## POST /api/search ### Description Hybrid search ### Method POST ### Endpoint /api/search ### Parameters #### Request Body - **query** (string) - Required - The search query. - **space_id** (string) - Optional - The ID of the space to search within. ### Request Example { "query": "What is memory vault?", "space_id": "space-1" } ### Response #### Success Response (200) - **results** (array) - A list of search results. #### Response Example { "results": [ { "chunk_id": "chunk-1", "score": 0.95, "content": "Memory Vault is a system for storing and retrieving memories." } ] } ``` -------------------------------- ### Expanding ESLint with React and React DOM Rules Source: https://github.com/mihaibuilds/memory-vault/blob/main/web/README.md Integrate eslint-plugin-react-x and eslint-plugin-react-dom for enhanced React and React DOM linting. This configuration requires specific project tsconfig files. ```javascript // eslint.config.js import reactX from 'eslint-plugin-react-x' import reactDom from 'eslint-plugin-react-dom' export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'], extends: [ // Other configs... // Enable lint rules for React reactX.configs['recommended-typescript'], // Enable lint rules for React DOM reactDom.configs.recommended, ], languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, // other options... }, }, ]) ``` -------------------------------- ### Tune PostgreSQL maintenance_work_mem for Faster Index Rebuilds Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Adjust the maintenance_work_mem parameter in docker-compose.yml to improve HNSW index build performance. Increase to 2GB for hosts with 16GB+ RAM, or decrease to 256MB for systems with 4GB RAM or less. ```yaml db: image: pgvector/pgvector:pg16 command: - postgres - -c - maintenance_work_mem=2GB ``` -------------------------------- ### No-Docker Usage: Ingest File Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Ingest a file into Memory Vault when running without Docker. Specify the file name and the target space. ```bash memory-vault ingest notes.md --space default ``` -------------------------------- ### MCP Server Configuration for Docker Users Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md This JSON configuration is for users running Memory Vault via Docker. It specifies '127.0.0.1' for DB_HOST to connect to the PostgreSQL container. Ensure port 5432 is exposed in your docker-compose.yml. ```json { "mcpServers": { "memory-vault": { "command": "python", "args": ["-m", "src.mcp"], "cwd": "/path/to/memory-vault", "env": { "PYTHONPATH": "/path/to/memory-vault", "DB_HOST": "127.0.0.1", "DB_PORT": "5432", "DB_NAME": "memory_vault", "DB_USER": "memory_vault", "DB_PASSWORD": "memory_vault" } } } } ``` -------------------------------- ### RAG Chat (Streaming) Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Engages in a Retrieval-Augmented Generation (RAG) chat session over hybrid search results, providing token-by-token Server-Sent Events (SSE) streaming. Requires authentication. ```APIDOC ## POST /api/chat/stream ### Description RAG chat with token-by-token SSE streaming ### Method POST ### Endpoint /api/chat/stream ``` -------------------------------- ### POST /api/chat/stream Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Engages in a RAG chat session with token-by-token Server-Sent Events (SSE) streaming. ```APIDOC ## POST /api/chat/stream ### Description RAG chat with token-by-token SSE streaming ### Method POST ### Endpoint /api/chat/stream ### Parameters #### Request Body - **query** (string) - Required - The user's chat query. - **space_id** (string) - Optional - The ID of the space to use for context. ### Request Example { "query": "Explain the architecture.", "space_id": "space-1" } ### Response #### Success Response (200) - **event stream** - A stream of Server-Sent Events containing the chat response tokens. #### Response Example (SSE stream format) data: The architecture data: is designed data: for scalability. ``` -------------------------------- ### Expanding ESLint with Type-Checked Rules Source: https://github.com/mihaibuilds/memory-vault/blob/main/web/README.md Configure ESLint to enable type-aware lint rules for TypeScript files. Ensure 'tsconfig.node.json' and 'tsconfig.app.json' are correctly specified. ```javascript export default defineConfig([ globalIgnores(['dist']), { files: ['**/*.{ts,tsx}'], extends: [ // Other configs... // Remove tseslint.configs.recommended and replace with this tseslint.configs.recommendedTypeChecked, // Alternatively, use this for stricter rules tseslint.configs.strictTypeChecked, // Optionally, add this for stylistic rules tseslint.configs.stylisticTypeChecked, // Other configs... ], languageOptions: { parserOptions: { project: ['./tsconfig.node.json', './tsconfig.app.json'], tsconfigRootDir: import.meta.dirname, }, // other options... }, }, ]) ``` -------------------------------- ### List Memory Spaces Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Retrieves a list of all memory spaces available in the vault, including the count of chunks within each space. Requires authentication. ```APIDOC ## GET /api/spaces ### Description List memory spaces with chunk counts ### Method GET ### Endpoint /api/spaces ``` -------------------------------- ### List Chunks Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Retrieves a list of chunks with support for pagination and filtering. Requires authentication. ```APIDOC ## GET /api/chunks ### Description List chunks with pagination and filters ### Method GET ### Endpoint /api/chunks ``` -------------------------------- ### MCP Server Configuration for Claude Code Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md This JSON configuration is used in a project's .mcp.json file to set up the memory-vault MCP server. It specifies the command to run, arguments, working directory, and environment variables required for the server. ```json { "mcpServers": { "memory-vault": { "command": "python", "args": ["-m", "src.mcp"], "cwd": "/path/to/memory-vault", "env": { "PYTHONPATH": "/path/to/memory-vault", "DB_HOST": "localhost", "DB_PORT": "5432", "DB_NAME": "memory_vault", "DB_USER": "memory_vault", "DB_PASSWORD": "memory_vault" } } } } ``` -------------------------------- ### Ingest Text Content Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Ingest a text string as a chunk into a specified space. Ensure the Authorization header is correctly set. ```bash curl -X POST http://localhost:8000/api/ingest/text \ -H "Authorization: Bearer $MV_TOKEN" \ -H "Content-Type: application/json" \ -d '{"text": "Decided to use RRF for hybrid merging", "space": "default"}' ``` -------------------------------- ### POST /api/ingest/text Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Ingests a given text string into the memory vault. ```APIDOC ## POST /api/ingest/text ### Description Ingest a text string ### Method POST ### Endpoint /api/ingest/text ### Parameters #### Request Body - **text** (string) - Required - The text content to ingest. - **space_id** (string) - Optional - The ID of the space to ingest into. ### Request Example { "text": "This is a new piece of information to store.", "space_id": "space-1" } ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating successful ingestion. #### Response Example { "message": "Text ingested successfully." } ``` -------------------------------- ### POST /api/chat Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Engages in a Retrieval-Augmented Generation (RAG) chat session (non-streaming). ```APIDOC ## POST /api/chat ### Description RAG chat (non-streaming) ### Method POST ### Endpoint /api/chat ### Parameters #### Request Body - **query** (string) - Required - The user's chat query. - **space_id** (string) - Optional - The ID of the space to use for context. ### Request Example { "query": "Tell me about the project goals.", "space_id": "space-1" } ### Response #### Success Response (200) - **response** (string) - The generated chat response. #### Response Example { "response": "The project goals are to improve data retrieval efficiency." } ``` -------------------------------- ### Report Vulnerability Email Subject Source: https://github.com/mihaibuilds/memory-vault/blob/main/SECURITY.md Use this format for the subject line when emailing security reports to support@mihaibuilds.com. It helps categorize incoming reports. ```text Security: ``` -------------------------------- ### RAG Chat (Non-streaming) Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Engages in a Retrieval-Augmented Generation (RAG) chat session over hybrid search results. This endpoint provides a non-streaming response. Requires authentication. ```APIDOC ## POST /api/chat ### Description RAG chat over hybrid search (non-streaming) ### Method POST ### Endpoint /api/chat ``` -------------------------------- ### Revoke a Token by Prefix Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Remove access for a specific token using its prefix. After revocation, the dashboard will require a new token. ```bash # Revoke by prefix (shown in list output) docker compose exec app memory-vault token revoke mv_abc1234 ``` -------------------------------- ### Ingest Text Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Ingests a given text string as a new chunk into a specified memory space. Requires authentication and a JSON request body containing the text and space name. ```APIDOC ## POST /api/ingest/text ### Description Ingest a text string as a chunk ### Method POST ### Endpoint /api/ingest/text ### Parameters #### Request Body - **text** (string) - Required - The text content to ingest. - **space** (string) - Required - The name of the memory space to ingest the text into. ### Request Example { "text": "Decided to use RRF for hybrid merging", "space": "default" } ``` -------------------------------- ### Reciprocal Rank Fusion Algorithm Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md The formula for calculating the combined score of a document using Reciprocal Rank Fusion. Higher scores indicate better relevance. ```plaintext score(d) = Σ_{r ∈ rankers} 1 / (k + rank_r(d)) ``` -------------------------------- ### Hybrid Search Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Performs a hybrid search combining vector and full-text search with Rank-Fusion (RRF) for merging results. Requires authentication and a JSON request body specifying the query, target spaces, and result limit. ```APIDOC ## POST /api/search ### Description Hybrid search (vector + full-text + RRF) ### Method POST ### Endpoint /api/search ### Parameters #### Request Body - **query** (string) - Required - The search query string. - **spaces** (array of strings) - Required - A list of space names to search within. - **limit** (integer) - Optional - The maximum number of results to return. ### Request Example { "query": "how does hybrid search work", "spaces": ["default"], "limit": 5 } ``` -------------------------------- ### Service Health Check Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Checks the health status of the Memory Vault service and its database. This endpoint does not require authentication. ```APIDOC ## GET /api/health ### Description Service + database health (no auth) ### Method GET ### Endpoint /api/health ``` -------------------------------- ### DELETE /api/chunks/{id} Source: https://github.com/mihaibuilds/memory-vault/blob/main/ARCHITECTURE.md Soft-deletes a specified chunk. ```APIDOC ## DELETE /api/chunks/{id} ### Description Soft-delete a chunk ### Method DELETE ### Endpoint /api/chunks/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the chunk to delete. ### Request Example ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the chunk was soft-deleted. #### Response Example { "message": "Chunk deleted successfully." } ``` -------------------------------- ### Delete Chunk Source: https://github.com/mihaibuilds/memory-vault/blob/main/README.md Soft-deletes (forgets) a chunk identified by its ID. Requires authentication. ```APIDOC ## DELETE /api/chunks/{id} ### Description Soft-delete (forget) a chunk ### Method DELETE ### Endpoint /api/chunks/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the chunk to delete. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.