### Create Quickstart Directory and Files Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Sets up a directory structure and creates two markdown files for the MFS quickstart example. This prepares the data to be indexed. ```bash mkdir -p /tmp/mfs-quickstart/notes cat > /tmp/mfs-quickstart/README.md <<'EOF' # MFS quickstart notes MFS uses a Rust CLI and a Python server. The default server listens on 127.0.0.1:13619. EOF cat > /tmp/mfs-quickstart/notes/search.md <<'EOF' # Search checklist Use mfs search when words may not match exactly. Use mfs grep when the literal token matters. Use mfs cat with --range to verify exact context. EOF ``` -------------------------------- ### Run MFS Server Setup and Run Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Installs the mfs-server using uv and then sets up the server configuration. Finally, it runs the server. Ensure you have uv installed. ```bash uv tool install mfs-server mfs-server setup mfs-server run ``` -------------------------------- ### Manual Sequence for Open Tag Skill Setup Source: https://github.com/zilliztech/mfs/blob/main/examples/open-tag-skill/README.md This sequence outlines the manual steps to install and run the MFS server, index data into memory, configure environment variables, and start the Slack agent. Use this in an isolated Slack channel on a non-production machine. ```bash # 1. install + run MFS uv tool install mfs-server && mfs-server run # binds 127.0.0.1:13619 # 2. index your Memory (or just let the mfs-ingest skill do it) mfs add /path/to/your/repo mfs add slack://team-memory --config ./slack.toml # optional Slack history # 3. point the bot at the permitted scopes + Slack app + backend export MFS_ALLOWED_SCOPES="file://local/path/to/your/repo,slack://team-memory" export SLACK_APP_TOKEN="xapp-…" SLACK_BOT_TOKEN="xoxb-…" export OPENTAG_BACKEND="claude" SLACK_CHANNEL_ID="C0…" export MFS_URL="http://127.0.0.1:13619" MFS_TOKEN="$(cat ~/.mfs/server.token)" # 4. preflight, then start the bridge cd examples/open-tag-skill/open-tag python scripts/opentag_doctor.py --channel-id "$SLACK_CHANNEL_ID" uv run --with slack-bolt python scripts/slack_socket_agent.py --backend "$OPENTAG_BACKEND" ``` -------------------------------- ### Run Full Server Setup Wizard Source: https://github.com/zilliztech/mfs/blob/main/docs/configuration.md Execute the complete server setup wizard to configure all necessary components. ```bash mfs-server setup ``` -------------------------------- ### Run MFS Server Setup and Execution Source: https://github.com/zilliztech/mfs/blob/main/CONTRIBUTING.md Run the MFS server setup to create configuration files and then start the server. The server runs on 127.0.0.1:13619 by default. ```bash uv run mfs-server setup # optional: write $MFS_HOME/server.toml (Enter through for local defaults) uv run mfs-server run # 127.0.0.1:13619 ``` -------------------------------- ### Install mfs-server with All Connectors Source: https://github.com/zilliztech/mfs/blob/main/server/python/README.md Installs the mfs-server along with the SDKs for every available connector. ```bash uv tool install "mfs-server[all-connectors]" ``` -------------------------------- ### Cat API Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/python/docs/BrowseApi.md Demonstrates how to use the cat method from the BrowseApi to retrieve file content. Includes setup for authentication and API client configuration. ```python import mfs_sdk from mfs_sdk.models.cat_response import CatResponse from mfs_sdk.rest import ApiException from pprint import pprint # Defining the host is optional and defaults to http://localhost # See configuration.py for a list of all supported configuration parameters. configuration = mfs_sdk.Configuration( host = "http://localhost" ) # The client must configure the authentication and authorization parameters # in accordance with the API server security policy. # Examples for each auth method are provided below, use the example that # satisfies your auth use case. # Configure Bearer authorization (opaque): BearerAuth configuration = mfs_sdk.Configuration( access_token = os.environ["BEARER_TOKEN"] ) # Enter a context with an instance of the API client with mfs_sdk.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = mfs_sdk.BrowseApi(api_client) path = 'path_example' # str | range = 'range_example' # str | (optional) meta = False # bool | (optional) (default to False) density = 'density_example' # str | (optional) locator = 'locator_example' # str | (optional) try: # Cat api_response = api_instance.cat(path, range=range, meta=meta, density=density, locator=locator) print("The response of BrowseApi->cat:\n") pprint(api_response) except Exception as e: print("Exception when calling BrowseApi->cat: %s\n" % e) ``` -------------------------------- ### Run mfs Server with Specific Bind Address Source: https://github.com/zilliztech/mfs/blob/main/docs/server.md Examples of running the mfs server with explicit bind addresses for the API and worker processes. Also shows how to start a detached server process. ```bash uv run mfs-server run --bind 127.0.0.1:13619 uv run mfs-server api --bind 127.0.0.1:13619 uv run mfs-server worker --concurrency auto mfs serve start ``` -------------------------------- ### Web Connector Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors/web.md This TOML configuration specifies the starting point for the crawl, the domains that are allowed to be crawled, and a limit on the number of pages to fetch. ```toml start_urls = ["https://docs.example.com/"] allowed_domains = ["docs.example.com"] max_pages = 100 ``` -------------------------------- ### Install MFS Server Core Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the base MFS server with the OpenAI SDK and default ONNX embedding stack. This is the minimal installation. ```bash uv tool install mfs-server ``` -------------------------------- ### Install mfs-server with Specific Connectors Source: https://github.com/zilliztech/mfs/blob/main/server/python/README.md Installs the mfs-server with specific connector SDKs, such as PostgreSQL, S3, and Slack. ```bash uv tool install "mfs-server[pg,s3,slack]" ``` -------------------------------- ### Start Local MFS Server Source: https://github.com/zilliztech/mfs/blob/main/README.md Use `mfs serve start` to launch a local MFS server process. ```bash mfs serve start ``` -------------------------------- ### Run Specific Setup Wizard Sections Source: https://github.com/zilliztech/mfs/blob/main/docs/configuration.md Execute individual sections of the setup wizard, such as 'embedding' or 'auth', for targeted configuration. ```bash mfs-server setup --section embedding ``` ```bash mfs-server setup --section auth ``` -------------------------------- ### Setup LLM Provider Sections via CLI Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Run these commands to configure the description (for images) and summary (for directories/files) sections using the MFS server setup wizard. ```bash mfs-server setup --section description # images ``` ```bash mfs-server setup --section summary # directories / files ``` -------------------------------- ### Configure Embedding Provider via Setup Wizard Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Launches the MFS setup wizard to configure the embedding section. This is the recommended way to switch providers. ```bash mfs-server setup --section embedding ``` -------------------------------- ### Install LangGraph and MFS SDK Source: https://github.com/zilliztech/mfs/blob/main/docs/integrations/langgraph.md Install the necessary libraries for LangGraph and MFS integration. Ensure the MFS Python SDK is also installed separately. ```bash pip install langgraph langchain-core # plus the MFS Python SDK (mfs_sdk) — see the SDKs page ``` -------------------------------- ### Install MFS Server with Ollama Provider Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with additional dependencies for the Ollama embedding provider. Requires `uv tool install "mfs-server[ollama]"` or `all-providers`. ```bash uv tool install "mfs-server[ollama]" ``` -------------------------------- ### Install LangChain Core and MFS SDK Source: https://github.com/zilliztech/mfs/blob/main/docs/integrations/langchain.md Install the necessary Python packages for LangChain core and the MFS SDK. Ensure the MFS SDK is installed from its source location. ```bash pip install langchain-core # then install the checked-in MFS SDK from sdks/python (see the SDKs page) ``` -------------------------------- ### Install and Run MFS Server with Local Defaults Source: https://github.com/zilliztech/mfs/blob/main/docs/configuration.md Install the MFS server, set up its default configuration, and then run it. Use 'mfs status' and 'mfs config show' in another terminal to verify. ```bash uv tool install mfs-server mfs-server setup mfs-server run ``` ```bash mfs status mfs config show ``` -------------------------------- ### Postgres DSN Example Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors/postgres.md Provides an example of a standard PostgreSQL connection string (DSN). ```text postgresql://user:pass@host:5432/dbname ``` -------------------------------- ### Start MFS Server from Source Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/SKILL.md If the `mfs status` command returns 'connection refused', the server may be down. Start it from source using these commands. ```bash git clone https://github.com/zilliztech/mfs.git && cd mfs/server/python && uv sync && uv run mfs-server setup && uv run mfs-server run ``` -------------------------------- ### JobResponse Model Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/JobResponse.md Demonstrates how to create, log, stringify, and parse a JobResponse object using TypeScript. Ensure you have the '@mfs/sdk' types installed. ```typescript import type { JobResponse } from '@mfs/sdk' // TODO: Update the object below with actual values const example = { "id": null, "status": null, "opKind": null, "trigger": null, "error": null, "totalObjects": null, "succeededObjects": null, "failedObjects": null, "cancelledObjects": null, "startedAt": null, "finishedAt": null, } satisfies JobResponse console.log(example) // Convert the instance to a JSON string const exampleJSON: string = JSON.stringify(example) console.log(exampleJSON) // Parse the JSON string back to an object const exampleParsed = JSON.parse(exampleJSON) as JobResponse console.log(exampleParsed) ``` -------------------------------- ### Install MFS Server with Gemini Provider Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with additional dependencies for the Gemini embedding provider. Requires `uv tool install "mfs-server[gemini]"` or `all-providers`. ```bash uv tool install "mfs-server[gemini]" ``` -------------------------------- ### Example Postgres TOML Configuration Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/postgres.md An example TOML file demonstrating DSN, schemas, cursor column, max read rows, and object configurations. ```toml # in /tmp/mfs-pg-prod.toml dsN = "env:PG_PROD_DSN" schemas = ["public", "reporting"] cursor_column = "updated_at" max_read_rows = 500000 [[objects]] match = "/public/tickets" text_fields = ["title", "description"] locator_fields = ["id"] ``` -------------------------------- ### Install and Run MFS Server Locally Source: https://github.com/zilliztech/mfs/blob/main/docs/deployment.md Installs the base MFS server or with all connectors. Optionally sets up the configuration file and runs the server on 127.0.0.1:13619. Defaults to local configurations. ```bash uv tool install mfs-server # base server uv tool install "mfs-server[all-connectors]" # + every connector's SDK mfs-server setup # optional: write $MFS_HOME/server.toml mfs-server run # binds 127.0.0.1:13619 ``` -------------------------------- ### Install MFS Server with All Providers Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with dependencies for Gemini, Voyage, Mistral, Ollama, and Anthropic providers. Does not include the 'local' provider due to its larger dependency stack. ```bash uv tool install "mfs-server[all-providers]" ``` -------------------------------- ### Install MFS Server with Mistral Provider Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with additional dependencies for the Mistral embedding provider. Requires `uv tool install "mfs-server[mistral]"` or `all-providers`. ```bash uv tool install "mfs-server[mistral]" ``` -------------------------------- ### Install MFS CLI using Cargo Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Installs the MFS CLI from crates.io using the Cargo package manager. This is an alternative installation method. ```bash cargo install mfs-cli ``` -------------------------------- ### Install Connector Extras Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/troubleshooting.md If a connector fails due to missing dependencies, use this command to install the necessary extras for your connector. ```bash uv sync --extra slack ``` -------------------------------- ### Example Help Center Question Source: https://github.com/zilliztech/mfs/blob/main/evaluation/document-search/README.md An example of a user-generated question for help-center retrieval. ```text What is the pricing for email marketing on Wix? ``` -------------------------------- ### Install MFS Server with Anthropic Provider Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with additional dependencies for the Anthropic embedding provider. Requires `uv tool install "mfs-server[anthropic]"` or `all-providers`. ```bash uv tool install "mfs-server[anthropic]" ``` -------------------------------- ### Install MFS Server with Voyage Provider Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with additional dependencies for the Voyage embedding provider. Requires `uv tool install "mfs-server[voyage]"` or `all-providers`. ```bash uv tool install "mfs-server[voyage]" ``` -------------------------------- ### Install and Build TypeScript SDK Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/README.md Run these commands in the project directory after cloning to install dependencies and build the TypeScript source code. Node.js and npm are required. ```bash npm install npm run build ``` -------------------------------- ### Browse API Cat Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/python/README.md Example demonstrating how to use the BrowseApi's cat function to read a file. Configure the MFS server URL and optionally set an authorization token. Handles potential API exceptions. ```python import os import mfs_sdk from mfs_sdk.rest import ApiException from pprint import pprint # For normal mfs-server run/api, use http://127.0.0.1:13619. # The generated default http://127.0.0.1:8765 is for generated/smoke runs. # See configuration.py for a list of all supported configuration parameters. configuration = mfs_sdk.Configuration( host = os.getenv("MFS_URL", "http://127.0.0.1:13619") ) # Enter a context with an instance of the API client with mfs_sdk.ApiClient(configuration) as api_client: token = os.getenv("MFS_TOKEN") if token: api_client.set_default_header("Authorization", f"Bearer {token}") # Create an instance of the API class api_instance = mfs_sdk.BrowseApi(api_client) path = os.getenv("MFS_TARGET", "/tmp/mfs_sdk_fixture/auth.md") # str | read_range = None # str | for example "1:120" (optional) meta = False # bool | (optional) (default to False) density = None # str | for example "normal" (optional) try: # Cat api_response = api_instance.cat(path, range=read_range, meta=meta, density=density) print("The response of BrowseApi->cat:\n") pprint(api_response) except ApiException as e: print("Exception when calling BrowseApi->cat: %s\n" % e) ``` -------------------------------- ### Install MFS Server with Local Provider Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Installs the MFS server with additional dependencies for the local sentence-transformers embedding provider. This installs a larger dependency stack. ```bash uv tool install "mfs-server[local]" ``` -------------------------------- ### Zendesk TOML Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/zendesk.md Example TOML configuration for the Zendesk connector, specifying subdomain, email, API token, and optional read limits. ```toml subdomain = "acme" email = "alice@acme.com" api_token = "env:ZENDESK_API_TOKEN" max_read_rows = 50000 ``` -------------------------------- ### Clone and Install Pre-commit Hooks Source: https://github.com/zilliztech/mfs/blob/main/CONTRIBUTING.md Clone the MFS repository and install pre-commit hooks for code formatting and linting. ```bash git clone https://github.com/zilliztech/mfs.git cd mfs # install pre-commit hooks (runs ruff format + cargo fmt on staged files) pre-commit install ``` -------------------------------- ### MFS Grep Command Examples Source: https://github.com/zilliztech/mfs/blob/main/evaluation/code-search/experiment-skills/A1_mfs_search.md Illustrates the usage of `mfs grep` for server-side keyword or full-text search within a specified path. Includes an example for JSON output. ```bash mfs grep "ERR_TOKEN_EXPIRED" ./src/ ``` ```bash mfs --json grep "Middleware" ./src/ ``` ```bash mfs grep "todo" ./src/ ``` -------------------------------- ### Postgres Table Structure Example Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors/postgres.md Illustrates how MFS organizes tables within schemas, showing rows and schema files. ```text postgres://prod-db/ └── public/ ├── tickets/ │ ├── rows.jsonl table_rows → one searchable chunk per row │ └── schema.json table_schema → browsable schema; searchable with summary enabled └── users/ ├── rows.jsonl └── schema.json ``` -------------------------------- ### Install Server Dependencies Source: https://github.com/zilliztech/mfs/blob/main/CONTRIBUTING.md Synchronize Python server dependencies using uv. Use '--extra all-connectors' to include all connector SDKs. ```bash cd server/python uv sync # default deps (local ONNX, Milvus Lite, SQLite) uv sync --extra all-connectors # include every connector SDK ``` -------------------------------- ### TOML Connector Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/SKILL.md Example of a TOML file used for MFS server connector configuration. Values can be direct strings or environment variable references. ```toml # mfs-server connector config — # URI: = "" = "" ... ``` -------------------------------- ### MFS Search Results Example Source: https://github.com/zilliztech/mfs/blob/main/docs/examples.md Example output from an `mfs search --all` command, showing results from Slack, Jira, and local files with associated scores and context. ```text slack://acme/channels/oncall__C0A1B2/messages.jsonl score=0.91 [Mon 22:14] @alice: ratelimiter pegged 500ms p99 tail, dump attached jira://acme/projects/PLAT/issues.jsonl score=0.83 PLAT-491 "rate-limit guard misfires under burst" state=In Progress file://local/repo/src/throttle.go score=0.71 42 func handleRateLimit(req Request) error { ``` -------------------------------- ### MongoDB Connection URI Examples Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors/mongo.md Examples of valid MongoDB connection URIs, including standard and SRV formats. ```text mongodb://user:pass@host:27017/?authSource=admin mongodb+srv://user:pass@cluster.mongodb.net/?retryWrites=true ``` -------------------------------- ### GitHub Connector Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/github.md Example TOML configuration for the GitHub connector. Set the token using an environment variable and specify the branch and metadata indexing options. ```toml token = "env:GITHUB_TOKEN" branch = "main" index_meta = true # also index issues + PRs max_read_rows = 10000 ``` -------------------------------- ### Postgres Connector Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors/postgres.md TOML configuration for the MFS Postgres connector, including DSN, schemas, and object matching. ```toml dsn = "env:PG_DSN" schemas = ["public"] cursor_column = "updated_at" # strengthens the object fingerprint max_read_rows = 100000 [[objects]] match = "/public/tickets" text_fields = ["title", "description"] locator_fields = ["id"] metadata_fields = ["status", "updated_at"] ``` -------------------------------- ### Basic mfs CLI Quickstart Commands Source: https://github.com/zilliztech/mfs/blob/main/cli/README.md Demonstrates essential mfs CLI commands for checking server status, adding a local directory for indexing, and performing a hybrid semantic and literal search. Assumes the server is running on the default endpoint. ```bash mfs status # server up? connectors registered? mfs add ./my-repo # queue a local directory for indexing mfs job show JOB_ID # wait until status is succeeded mfs search "rate limit handler" ./my-repo --top-k 5 mfs cat ./my-repo/src/throttle.go --range 42:78 ``` -------------------------------- ### Write and Run with Specific Config File Source: https://github.com/zilliztech/mfs/blob/main/docs/configuration.md Use a custom TOML configuration file for server setup and execution. ```bash mfs-server setup --config /tmp/mfs-server.toml ``` ```bash mfs-server run --config /tmp/mfs-server.toml ``` -------------------------------- ### Install MFS Skills Globally Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Installs the mfs-ingest and mfs-find skills for all projects and supported agents. Use without -g for the current project only. ```bash npx skills add zilliztech/mfs --all -g ``` -------------------------------- ### MySQL Object Definition Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/mysql.md Define how MFS should ingest specific tables. This example shows how to match the '/tickets' path and specify which fields are text and locator fields. ```toml [[objects]] match = "/tickets" text_fields = ["title", "description"] locator_fields = ["id"] ``` -------------------------------- ### Discord Connector TOML Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/discord.md Example TOML configuration for the Discord connector, including token, guild ID, and max read rows. ```toml token = "env:DISCORD_BOT_TOKEN" guild_id = "987654321098765432" max_read_rows = 50000 ``` -------------------------------- ### Credential Setup Walkthrough Source: https://github.com/zilliztech/mfs/blob/main/examples/open-tag-skill/README.md Request a walkthrough for setting up Slack credentials, including creating a Slack app, enabling Socket Mode, and obtaining bot and app tokens with necessary scopes. ```plain-language I want to run an Open Tag bot but I don't have any Slack credentials yet. Walk me through creating the Slack app, turning on Socket Mode, and getting the bot and app tokens — tell me which scopes to add and where each token goes. ``` -------------------------------- ### Python SDK Setup and Server Info Source: https://github.com/zilliztech/mfs/blob/main/sdks/python/docs/README.md Demonstrates how to set up the MFS Python SDK client, including configuration with a host URL and bearer token authentication. It then shows how to retrieve and print the server version. ```python import os import mfs_sdk configuration = mfs_sdk.Configuration( host=os.getenv("MFS_URL", "http://127.0.0.1:13619") ) with mfs_sdk.ApiClient(configuration) as api_client: token = os.getenv("MFS_TOKEN") if token: api_client.set_default_header("Authorization", f"Bearer {token}") server = mfs_sdk.ServerApi(api_client) print(server.get_server_info().version) ``` -------------------------------- ### MFS Search Command Examples Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-find/reference/connectors/file.md Examples of using the mfs search command for different search intents. Use --mode semantic for conceptual queries. ```bash mfs search "X" /repo/path (file://local/...) ``` ```bash mfs search "X" /path --mode semantic ``` -------------------------------- ### Install OpenAPI Generator CLI and Generate SDKs Source: https://github.com/zilliztech/mfs/blob/main/docs/development.md Installs the OpenAPI Generator CLI globally and navigates to the SDKs directory to run the generation script. Requires Java 11+. ```bash npm install -g @openapitools/openapi-generator-cli cd sdks ./generate.sh ``` -------------------------------- ### MFS Cat Command Examples Source: https://github.com/zilliztech/mfs/blob/main/evaluation/code-search/experiment-skills/A3_mfs_search_and_browse.md Retrieve file content using `mfs cat`. Options include fetching a specific range of lines with `--range`, obtaining structured data with `--locator`, viewing only the heading/signature with `--peek`, or getting headings and the first paragraph of each section with `--skim`. ```bash mfs cat ./docs/auth.md --peek ``` ```bash mfs cat ./docs/auth.md --skim ``` ```bash mfs cat ./src/handler.py --range 40:80 ``` ```bash mfs cat ./src/handler.py --locator '{"lines":[40,80]}' ``` -------------------------------- ### MFS Server Embedding Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/docs/providers.md Example TOML configuration for the embedding section, specifying the provider, model, and dimension. The wizard probes for the actual dimension, but it can be set manually if needed. ```toml [embedding] provider = "onnx" model = "gpahal/bge-m3-onnx-int8" dim = 1024 ``` -------------------------------- ### Verify MFS CLI installation Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Checks the installed version of the MFS CLI. Run this command after installation to confirm it is accessible. ```bash mfs --version ``` -------------------------------- ### Example Usage of BrowseApi.cat Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/BrowseApi.md Demonstrates how to use the cat method from the Browse API. Ensure you have configured the HTTP bearer token and provided necessary example values for path, range, density, and locator. ```typescript import { Configuration, BrowseApi, } from '@mfs/sdk'; import type { CatRequest } from '@mfs/sdk'; async function example() { console.log("🚀 Testing @mfs/sdk SDK..."); const config = new Configuration({ // Configure HTTP bearer authorization: BearerAuth accessToken: "YOUR BEARER TOKEN", }); const api = new BrowseApi(config); const body = { // string path: path_example, // string (optional) range: range_example, // boolean (optional) meta: true, // string (optional) density: density_example, // string (optional) locator: locator_example, } satisfies CatRequest; try { const data = await api.cat(body); console.log(data); } catch (error) { console.error(error); } } // Run the test example().catch(console.error); ``` -------------------------------- ### Example Connector Usage Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors.md Demonstrates how to use different connectors with common MFS commands like search, ls, and cat. Each command targets a specific data source using its unique URI scheme. ```bash mfs search "release checklist" github://owner/repo mfs ls slack://acme/channels mfs cat postgres://prod-db/public/tickets/rows.jsonl --locator '{"id": 12345}' ``` -------------------------------- ### Run MFS Server Setup Wizard Source: https://github.com/zilliztech/mfs/blob/main/README.md Initiates the interactive walkthrough for configuring the MFS server. Use `--section` to re-run specific configuration steps. ```bash mfs-server setup # full interactive walkthrough mfs-server setup --section embedding # re-run just one section ``` -------------------------------- ### MySQL Connector TOML Configuration Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/mysql.md An example TOML configuration for the MySQL connector, including essential fields like host, database, user, and password, as well as optional fields like port and cursor_column. The password can be sourced from an environment variable. ```toml host = "db.example.com" port = 3306 database = "prod" user = "mfs_reader" password = "env:MYSQL_PROD_PASSWORD" cursor_column = "updated_at" [[objects]] match = "/tickets" text_fields = ["title", "description"] locator_fields = ["id"] ``` -------------------------------- ### Notion Connector Search Strategies Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-find/reference/connectors/notion.md Provides examples of how to use the 'mfs search' command to find data within the Notion connector. ```bash mfs search "X" notion:///data_sources/ ``` ```bash mfs search "X" notion:///pages/ ``` ```bash mfs search "X" notion:// ``` -------------------------------- ### Install mfs-find Skill Source: https://github.com/zilliztech/mfs/blob/main/examples/deep-research-skill/README.md Install the mfs-find skill, which is a dependency for the Deep Research skill. This command also specifies AI models and global installation. ```bash npx skills add zilliztech/mfs --skill mfs-find -a claude-code -a codex -g ``` -------------------------------- ### TypeScript SDK Setup and Server Info Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/README.md Demonstrates how to set up the TypeScript SDK client, configure it with a base path and optional bearer token for authentication, and retrieve server information. Ensure the MFS_URL and MFS_TOKEN environment variables are set for custom configurations. ```typescript import { Configuration, ServerApi } from "@mfs/sdk"; const basePath = process.env.MFS_URL ?? "http://127.0.0.1:13619"; const token = process.env.MFS_TOKEN; const configuration = new Configuration({ basePath, headers: token ? { Authorization: `Bearer ${token}` } : undefined, }); async function main() { const server = new ServerApi(configuration); const info = await server.getServerInfo(); console.log(info.version); } main().catch((error) => { console.error(error); process.exitCode = 1; }); ``` -------------------------------- ### MFS SDK Basic Operations in Python Source: https://github.com/zilliztech/mfs/blob/main/docs/sdks.md Demonstrates initializing the MFS SDK client, setting authentication, and performing server info retrieval, search, file listing, file content retrieval, and ingest job management. ```python import os import mfs_sdk base_url = os.getenv("MFS_URL", "http://127.0.0.1:13619") token = os.getenv("MFS_TOKEN") target = os.getenv("MFS_TARGET", "/tmp/mfs_sdk_fixture") configuration = mfs_sdk.Configuration(host=base_url) with mfs_sdk.ApiClient(configuration) as client: if token: client.set_default_header("Authorization", f"Bearer {token}") server = mfs_sdk.ServerApi(client) retrieval = mfs_sdk.RetrievalApi(client) browse = mfs_sdk.BrowseApi(client) ingest = mfs_sdk.IngestApi(client) print(server.get_server_info().version) search = retrieval.search(q="single sign-on login", top_k=3) for hit in search.results: print(hit.source, hit.score) listing = browse.ls(path=target) print([entry.name for entry in listing.entries]) content = browse.cat(path=f"{target}/auth.md") print(content) job = ingest.add_source(mfs_sdk.AddRequest(target=target, process=False)) job_status = ingest.get_job(job.job_id) print(job_status.id, job_status.status) ``` -------------------------------- ### Install mfs CLI with Cargo Source: https://github.com/zilliztech/mfs/blob/main/cli/README.md Installs the mfs CLI using Cargo, the Rust package manager. This requires having Rust and Cargo installed on your system. ```bash cargo install mfs-cli ``` -------------------------------- ### Add Slack and Jira, then Search Source: https://github.com/zilliztech/mfs/blob/main/docs/examples.md Add Slack and Jira as data sources using their respective configurations. Then, perform a search across all added sources. ```bash mfs add slack://acme --config ./slack.toml mfs add jira://acme --config ./jira.toml mfs search "why did we revert the burst guard?" --all ``` -------------------------------- ### Install mfs CLI with curl Source: https://github.com/zilliztech/mfs/blob/main/cli/README.md Installs the mfs CLI using a one-line curl script for Linux and macOS. Ensure you have curl installed and appropriate permissions. ```bash curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/zilliztech/mfs/releases/latest/download/mfs-cli-installer.sh | sh ``` -------------------------------- ### Add HubSpot and Zendesk, then Search Source: https://github.com/zilliztech/mfs/blob/main/docs/examples.md Integrate HubSpot and Zendesk as data sources with their configurations. Subsequently, search for customer-related information across these sources. ```bash mfs add hubspot://acme --config ./hubspot.toml mfs add zendesk://acme --config ./zendesk.toml mfs search "why is Globex unhappy with onboarding?" --all ``` -------------------------------- ### Build Docs Locally Source: https://github.com/zilliztech/mfs/blob/main/docs/development.md Build the documentation locally using `mkdocs`. Run this command from the repository root. ```bash uv run --group docs mkdocs build --strict ``` -------------------------------- ### Basic MFS SDK Usage with TypeScript Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/README.md Demonstrates how to initialize the BrowseApi client and perform a 'cat' operation to retrieve file content. It includes configuration for the base path and optional authorization token. ```typescript import { Configuration, BrowseApi, } from '@mfs/sdk'; import type { CatRequest } from '@mfs/sdk'; async function example() { const basePath = process.env.MFS_URL ?? "http://127.0.0.1:13619"; const token = process.env.MFS_TOKEN; const api = new BrowseApi(new Configuration({ basePath, headers: token ? { Authorization: `Bearer ${token}` } : undefined, })); const body = { // string path: process.env.MFS_TARGET ?? "/tmp/mfs_sdk_fixture/auth.md", // string (optional), for example "1:120" range: undefined, // boolean (optional) meta: false, // string (optional), for example "normal" density: undefined, } satisfies CatRequest; try { const data = await api.cat(body); console.log(data); } catch (error) { console.error(error); } } // Run the example example().catch(console.error); ``` -------------------------------- ### Minimal MFS Quickstart Smoke Test Source: https://github.com/zilliztech/mfs/blob/main/docs/deployment.md This script sets up a minimal MFS environment, adds a local file, and performs basic operations like status check, job monitoring, search, and file retrieval. It's useful for a quick end-to-end test. ```bash mkdir -p /tmp/mfs-quickstart cat > /tmp/mfs-quickstart/README.md <<'EOF' MFS uses a Rust CLI and a Python server. The default server listens on 127.0.0.1:13619. EOF export MFS_API_URL=http://127.0.0.1:13619 mfs status mfs add /tmp/mfs-quickstart # or: mfs add --upload ... for a container/remote server mfs job show JOB_ID mfs search "default endpoint" /tmp/mfs-quickstart --top-k 5 mfs cat /tmp/mfs-quickstart/README.md --range 1:20 ``` -------------------------------- ### Install Deep Research Skill Source: https://github.com/zilliztech/mfs/blob/main/examples/deep-research-skill/README.md Install the Deep Research skill using npx. The --full-depth flag is required as the skill is not in the top-level directory. The -a flags specify AI models to use, and -g indicates global installation. ```bash npx skills add zilliztech/mfs --full-depth --skill deep-research -a claude-code -a codex -g ``` -------------------------------- ### Export API Key and Add Linear Source Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/linear.md Demonstrates exporting the Linear API key as an environment variable and then adding the Linear connector as a source to MFS. ```bash export LINEAR_API_KEY=lin_api_... mfs add linear://acme --config /tmp/mfs-linear.toml ``` -------------------------------- ### ManifestFile Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/ManifestFile.md Demonstrates how to create a ManifestFile object, convert it to a JSON string, and parse it back. Use this as a template for creating ManifestFile instances. ```typescript import type { ManifestFile } from '@mfs/sdk' // TODO: Update the object below with actual values const example = { "path": null, "size": null, "mtimeNs": null, "inode": null, } satisfies ManifestFile console.log(example) // Convert the instance to a JSON string const exampleJSON: string = JSON.stringify(example) console.log(exampleJSON) // Parse the JSON string back to an object const exampleParsed = JSON.parse(exampleJSON) as ManifestFile console.log(exampleParsed) ``` -------------------------------- ### Install OpenAPI Generator CLI Source: https://github.com/zilliztech/mfs/blob/main/docs/sdks.md Installs the OpenAPI generator CLI globally using npm. This is a prerequisite for regenerating SDKs. ```bash npm install -g @openapitools/openapi-generator-cli ``` -------------------------------- ### Update MFS Skills Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Updates installed skills to their latest versions. For project-specific installs, use the 'npx skills add' command again. ```bash npx skills update ``` -------------------------------- ### Run mfs Server from Source Source: https://github.com/zilliztech/mfs/blob/main/docs/server.md Commands to set up and run the mfs server locally from its source code. Ensure you are in the 'server/python' directory. ```bash cd server/python uv sync --extra all-connectors uv run mfs-server setup uv run mfs-server run ``` -------------------------------- ### EstimateResponse Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/EstimateResponse.md Demonstrates how to use the EstimateResponse type in TypeScript, including creating an example object, converting it to JSON, and parsing it back. ```typescript import type { EstimateResponse } from '@mfs/sdk' // TODO: Update the object below with actual values const example = { "target": null, "type": null, "objects": null, "sampledObjects": null, "estChunks": null, "estTokens": null, } satisfies EstimateResponse console.log(example) // Convert the instance to a JSON string const exampleJSON: string = JSON.stringify(example) console.log(exampleJSON) // Parse the JSON string back to an object const exampleParsed = JSON.parse(exampleJSON) as EstimateResponse console.log(exampleParsed) ``` -------------------------------- ### Search Operation with MFS SDK Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/RetrievalApi.md Illustrates how to perform a search using the MFS SDK's search function. This example shows how to set query parameters like q, path, mode, topK, collapse, and kind. Authentication and valid input are required. ```typescript import { Configuration, RetrievalApi, } from '@mfs/sdk'; import type { SearchRequest } from '@mfs/sdk'; async function example() { console.log("🚀 Testing @mfs/sdk SDK..."); const config = new Configuration({ // Configure HTTP bearer authorization: BearerAuth accessToken: "YOUR BEARER TOKEN", }); const api = new RetrievalApi(config); const body = { // string q: q_example, // string (optional) path: path_example, // 'hybrid' | 'semantic' | 'keyword' (optional) mode: mode_example, // number (optional) topK: 56, // boolean (optional) collapse: true, // string (optional) kind: kind_example, } satisfies SearchRequest; try { const data = await api.search(body); console.log(data); } catch (error) { console.error(error); } } // Run the test example().catch(console.error); ``` -------------------------------- ### EstimateResponse Usage Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/python/docs/EstimateResponse.md Example demonstrating how to create and use an EstimateResponse object in Python, including instantiation from JSON and conversion to a dictionary. ```APIDOC ## Example ```python from mfs_sdk.models.estimate_response import EstimateResponse # TODO update the JSON string below json = "{}" # create an instance of EstimateResponse from a JSON string estimate_response_instance = EstimateResponse.from_json(json) # print the JSON string representation of the object print(EstimateResponse.to_json()) # convert the object into a dict estimate_response_dict = estimate_response_instance.to_dict() # create an instance of EstimateResponse from a dict estimate_response_from_dict = EstimateResponse.from_dict(estimate_response_dict) ``` ``` -------------------------------- ### Check for Skill Updates Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Checks for available updates for installed skills. Re-run the 'npx skills add' command to update project-level installs. ```bash npx skills check ``` -------------------------------- ### ProbeResponse Usage Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/python/docs/ProbeResponse.md Example of how to use the ProbeResponse model in Python, including creating instances from JSON and dictionaries, and converting to JSON and dictionaries. ```python from mfs_sdk.models.probe_response import ProbeResponse # Example JSON string (replace with actual JSON data) json_data = "{}" # Create an instance of ProbeResponse from a JSON string probe_response_instance = ProbeResponse.from_json(json_data) # Print the JSON string representation of the object print(ProbeResponse.to_json()) # Convert the object into a dict probe_response_dict = probe_response_instance.to_dict() # Create an instance of ProbeResponse from a dict probe_response_from_dict = ProbeResponse.from_dict(probe_response_dict) ``` -------------------------------- ### Slack Search Examples Source: https://github.com/zilliztech/mfs/blob/main/docs/connectors/slack.md Bash commands demonstrating how to search for specific terms within Slack messages and user data indexed by MFS. ```bash mfs search "deploy failed" slack://acme/channels/eng-backend__C012345/messages.jsonl ``` ```bash mfs search "Alice Wang" slack://acme/users.jsonl ``` -------------------------------- ### Install MFS Skills to Specific Agents Source: https://github.com/zilliztech/mfs/blob/main/docs/getting-started.md Installs the mfs-ingest and mfs-find skills to specified agents like claude-code and codex. Supports over 70 agents. ```bash npx skills add zilliztech/mfs -a claude-code -a codex -g ``` -------------------------------- ### MFS Cat Command Examples Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-find/SKILL.md These commands are used to browse and verify content after locating it. '--peek' shows an outline, '--skim' provides outlines with summaries, 'head' shows initial records, and 'tree' displays a subtree structure. ```bash mfs cat --peek ``` ```bash mfs cat --skim ``` ```bash mfs head -n 20 ``` ```bash mfs tree -L 2 ``` -------------------------------- ### JobResponse Usage Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/python/docs/JobResponse.md Example demonstrating how to use the JobResponse model in Python, including creating instances from JSON and dictionaries, and converting to JSON and dictionaries. ```APIDOC ## Example ```python from mfs_sdk.models.job_response import JobResponse # TODO update the JSON string below json = "{}" # create an instance of JobResponse from a JSON string job_response_instance = JobResponse.from_json(json) # print the JSON string representation of the object print(JobResponse.to_json()) # convert the object into a dict job_response_dict = job_response_instance.to_dict() # create an instance of JobResponse from a dict job_response_from_dict = JobResponse.from_dict(job_response_dict) ``` ``` -------------------------------- ### Run MFS Locally with Server and CLI Source: https://github.com/zilliztech/mfs/blob/main/README.md Set up and run MFS locally without an agent. This involves installing and running the mfs-server and using the mfs-cli for operations. ```bash uv tool install mfs-server && mfs-server run ``` ```bash mfs add /tmp/hello-mfs ``` ```bash mfs search "where the greeting is printed" /tmp/hello-mfs ``` -------------------------------- ### Get Server Information Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/ServerApi.md Retrieves general information about the server. Requires Bearer authentication. Use this to get details about the server's configuration and status. ```typescript import { Configuration, ServerApi, } from '@mfs/sdk'; import type { GetServerInfoRequest } from '@mfs/sdk'; async function example() { console.log("🚀 Testing @mfs/sdk SDK..."); const config = new Configuration({ // Configure HTTP bearer authorization: BearerAuth accessToken: "YOUR BEARER TOKEN", }); const api = new ServerApi(config); try { const data = await api.getServerInfo(); console.log(data); } catch (error) { console.error(error); } } // Run the test example().catch(console.error); ``` -------------------------------- ### Add Cloud Drive and S3 Bucket, then Search Source: https://github.com/zilliztech/mfs/blob/main/docs/examples.md Mount a Google Drive or S3 bucket to make its files searchable alongside local content. Search for specific information within these mounted sources. ```bash mfs add gdrive://my-drive --config ./gdrive.toml mfs add s3://acme-exports --config ./s3.toml mfs search "the Q3 board deck" --all ``` -------------------------------- ### MFS SDK Basic Operations in TypeScript Source: https://github.com/zilliztech/mfs/blob/main/docs/sdks.md Demonstrates initializing the MFS SDK client, setting authentication, and performing server info retrieval, search, file listing, file content retrieval, and ingest job management asynchronously. ```typescript import { BrowseApi, Configuration, IngestApi, RetrievalApi, ServerApi, } from "@mfs/sdk"; const basePath = process.env.MFS_URL ?? "http://127.0.0.1:13619"; const token = process.env.MFS_TOKEN; const target = process.env.MFS_TARGET ?? "/tmp/mfs_sdk_fixture"; const configuration = new Configuration({ basePath, headers: token ? { Authorization: `Bearer ${token}` } : undefined, }); const server = new ServerApi(configuration); const retrieval = new RetrievalApi(configuration); const browse = new BrowseApi(configuration); const ingest = new IngestApi(configuration); async function main() { const info = await server.getServerInfo(); console.log(info.version); const search = await retrieval.search({ q: "single sign-on login", topK: 3 }); for (const hit of search.results) { console.log(hit.source, hit.score); } const listing = await browse.ls({ path: target }); console.log(listing.entries.map((entry) => entry.name)); const content = await browse.cat({ path: `${target}/auth.md` }); console.log(content); const job = await ingest.addSource({ addRequest: { target, process: false }, }); const jobStatus = await ingest.getJob({ jobId: job.jobId }); console.log(jobStatus.id, jobStatus.status); } main().catch((error) => { console.error(error); process.exitCode = 1; }); ``` -------------------------------- ### BigQuery Object Match Example Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/bigquery.md Example of an `[[objects]]` block for the BigQuery connector, defining how to match a specific table and specifying fields for text and locator information. ```toml [[objects]] match = "/events/tables/user_events" text_fields = ["event_name", "event_properties_json"] locator_fields = ["event_id"] ``` -------------------------------- ### LsResponse Model Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/LsResponse.md Demonstrates how to create an instance of LsResponse, convert it to a JSON string, and parse it back. Ensure to update the example object with actual values. ```typescript import type { LsResponse } from '@mfs/sdk' // TODO: Update the object below with actual values const example = { "entries": null, "capabilities": null, } satisfies LsResponse console.log(example) // Convert the instance to a JSON string const exampleJSON: string = JSON.stringify(example) console.log(exampleJSON) // Parse the JSON string back to an object const exampleParsed = JSON.parse(exampleJSON) as LsResponse console.log(exampleParsed) ``` -------------------------------- ### LsEntry TypeScript Example Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/LsEntry.md Demonstrates how to create an LsEntry object, convert it to a JSON string, and parse it back. Use this example as a template for initializing LsEntry objects. ```typescript import type { LsEntry } from '@mfs/sdk' // TODO: Update the object below with actual values const example = { "name": null, "type": null, "mediaType": null, "sizeHint": null, "path": null, "searchStatus": null, "indexable": null, } satisfies LsEntry console.log(example) // Convert the instance to a JSON string const exampleJSON: string = JSON.stringify(example) console.log(exampleJSON) // Parse the JSON string back to an object const exampleParsed = JSON.parse(exampleJSON) as LsEntry console.log(exampleParsed) ``` -------------------------------- ### GrepResponse Example Usage Source: https://github.com/zilliztech/mfs/blob/main/sdks/typescript/docs/GrepResponse.md Demonstrates how to create, log, stringify, and parse a GrepResponse object in TypeScript. This example shows the basic structure and interaction with the GrepResponse type. ```typescript import type { GrepResponse } from '@mfs/sdk' // TODO: Update the object below with actual values const example = { "results": null, } satisfies GrepResponse console.log(example) // Convert the instance to a JSON string const exampleJSON: string = JSON.stringify(example) console.log(exampleJSON) // Parse the JSON string back to an object const exampleParsed = JSON.parse(exampleJSON) as GrepResponse console.log(exampleParsed) ``` -------------------------------- ### MongoDB Connection URIs Source: https://github.com/zilliztech/mfs/blob/main/skills/mfs-ingest/reference/connectors/mongo.md Examples of valid MongoDB connection URIs for authentication and cluster access. ```plaintext mongodb://user:pass@host:27017/?authSource=admin mongodb+srv://user:pass@cluster.mongodb.net/?retryWrites=true ```