diff --git a/README.md b/README.md index 19b15f059..36310c460 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ If you're new to CocoIndex, we recommend checking out 1. Install CocoIndex Python library -```bash +```sh pip install -U cocoindex ``` diff --git a/dev/README.md b/dev/README.md index 0efd539d0..334a41a70 100644 --- a/dev/README.md +++ b/dev/README.md @@ -10,7 +10,7 @@ Automatically generates CLI documentation from the CocoIndex Click commands. **Usage:** -```bash +```sh python dev/generate_cli_docs.py ``` diff --git a/docs/docs/ai/llm.mdx b/docs/docs/ai/llm.mdx index a01f79eb1..f84f69523 100644 --- a/docs/docs/ai/llm.mdx +++ b/docs/docs/ai/llm.mdx @@ -122,7 +122,7 @@ cocoindex.functions.EmbedText( * [Download](https://ollama.com/download) and install Ollama. * Pull your favorite LLM models by the `ollama pull` command, e.g. - ```bash + ```sh ollama pull llama3.2 ``` You can find the [list of models](https://ollama.com/library) supported by Ollama. @@ -146,7 +146,7 @@ cocoindex.LlmSpec( For text embedding with Ollama, you'll need to pull an embedding model first: -```bash +```sh ollama pull nomic-embed-text ``` @@ -330,7 +330,7 @@ To use the LiteLLM API, you need to set the environment variable `LITELLM_API_KE #### 1. Install LiteLLM Proxy -```bash +```sh pip install 'litellm[proxy]' ``` @@ -367,7 +367,7 @@ You need to set the environment variable `GROQ_API_KEY` to your Groq API key. #### 3. Run LiteLLM Proxy -```bash +```sh litellm --config config.yml ``` @@ -415,13 +415,13 @@ You can find the full list of models supported by OpenRouter [here](https://open Install vLLM: -```bash +```sh pip install vllm ``` Run vLLM Server -```bash +```sh vllm serve deepseek-ai/deepseek-coder-1.3b-instruct ``` diff --git a/docs/docs/core/cli-commands.md b/docs/docs/core/cli-commands.md index 7106c88bb..63cc5d515 100644 --- a/docs/docs/core/cli-commands.md +++ b/docs/docs/core/cli-commands.md @@ -13,7 +13,7 @@ Modes of operation: **Usage:** -```bash +```sh cocoindex drop [OPTIONS] [APP_TARGET] [FLOW_NAME]... ``` @@ -45,7 +45,7 @@ flow. **Usage:** -```bash +```sh cocoindex evaluate [OPTIONS] APP_FLOW_SPECIFIER ``` @@ -72,7 +72,7 @@ the backend. **Usage:** -```bash +```sh cocoindex ls [OPTIONS] [APP_TARGET] ``` @@ -95,7 +95,7 @@ It will allow tools like CocoInsight to access the server. **Usage:** -```bash +```sh cocoindex server [OPTIONS] APP_TARGET ``` @@ -128,7 +128,7 @@ storage and target (to export to). **Usage:** -```bash +```sh cocoindex setup [OPTIONS] APP_TARGET ``` @@ -160,7 +160,7 @@ flow. **Usage:** -```bash +```sh cocoindex show [OPTIONS] APP_FLOW_SPECIFIER ``` @@ -184,7 +184,7 @@ or `module:FlowName`. If `:FlowName` is omitted, updates all flows. **Usage:** -```bash +```sh cocoindex update [OPTIONS] APP_FLOW_SPECIFIER ``` diff --git a/docs/docs/examples/examples/00_codebase_index.md b/docs/docs/examples/examples/00_codebase_index.md index 3a705c25c..52d0ed2e7 100644 --- a/docs/docs/examples/examples/00_codebase_index.md +++ b/docs/docs/examples/examples/00_codebase_index.md @@ -51,7 +51,7 @@ The flow is composed of the following steps: - Install Postgres, follow [installation guide](https://cocoindex.io/docs/getting_started/installation#-install-postgres). - Install CocoIndex - ```bash + ```sh pip install -U cocoindex ``` @@ -206,7 +206,7 @@ if __name__ == "__main__": - Install dependencies - ```bash + ```sh pip install -e . ``` @@ -234,8 +234,8 @@ The returned results - each entry contains score (Cosine Similarity), filename, To get a better understanding of the indexing flow, you can use CocoInsight to help the development step by step. To spin up, it is super easy. -``` -cocoindex server main.py -ci +```sh +cocoindex server -ci main ``` Follow the url from the terminal - `https://cocoindex.io/cocoinsight` to access the CocoInsight. diff --git a/docs/docs/examples/examples/02_academic_papers_index.md b/docs/docs/examples/examples/02_academic_papers_index.md index 278a1e4e7..0126d3e10 100644 --- a/docs/docs/examples/examples/02_academic_papers_index.md +++ b/docs/docs/examples/examples/02_academic_papers_index.md @@ -341,7 +341,6 @@ If you need assist with writing the query, please feel free to reach out to us a You can walk through the project step by step in [CocoInsight](https://www.youtube.com/watch?v=MMrpUfUcZPk) to see exactly how each field is constructed and what happens behind the scenes. - ```sh cocoindex server -ci main ``` diff --git a/docs/docs/examples/examples/03_postgres_source.md b/docs/docs/examples/examples/03_postgres_source.md index 58833f24b..7515a80fb 100644 --- a/docs/docs/examples/examples/03_postgres_source.md +++ b/docs/docs/examples/examples/03_postgres_source.md @@ -182,25 +182,25 @@ For example, the following image shows the lineage of the `embedding` field, you 1. Set up dependencies: - ```bash + ```sh pip install -e . ``` 2. Create the source table with sample data: - ```bash + ```sh psql "postgres://cocoindex:cocoindex@localhost/cocoindex" -f ./prepare_source_data.sql ``` 3. Setup tables and update the index: - ```bash + ```sh cocoindex update main ``` 4. Run CocoInsight: - ```bash + ```sh cocoindex server -ci main ``` @@ -210,8 +210,8 @@ For example, the following image shows the lineage of the `embedding` field, you For continuous updating when the source changes, add `-L`: -```bash -cocoindex server -ci -L main +```sh +cocoindex update -L main ``` Check [live updates](https://cocoindex.io/docs/tutorials/live_updates) for more details. diff --git a/docs/docs/examples/examples/custom_targets.md b/docs/docs/examples/examples/custom_targets.md index b1902105b..5e78a6191 100644 --- a/docs/docs/examples/examples/custom_targets.md +++ b/docs/docs/examples/examples/custom_targets.md @@ -189,7 +189,7 @@ output_html.export( ## Run the example -```bash +```sh pip install -e . cocoindex update main ``` @@ -198,9 +198,9 @@ You can add, modify, or remove files in the `data/` directory — CocoIndex will For **real-time updates**, run in live mode: -```bash -cocoindex update -L main.py -``` + ```sh + cocoindex update -L main + ``` This keeps your knowledge graph continuously synchronized with your document source — perfect for fast-changing environments like internal wikis or technical documentation. diff --git a/docs/docs/examples/examples/image_search_clip.md b/docs/docs/examples/examples/image_search_clip.md index f6c541488..c5c7dfd42 100644 --- a/docs/docs/examples/examples/image_search_clip.md +++ b/docs/docs/examples/examples/image_search_clip.md @@ -265,7 +265,7 @@ You can check the frontend code [here](https://github.com/cocoindex-io/cocoindex ## Time to have fun! - Create a collection in Qdrant - ```bash + ```sh curl -X PUT 'http://localhost:6333/collections/image_search' \ -H 'Content-Type: application/json' \ -d '{ @@ -279,18 +279,18 @@ You can check the frontend code [here](https://github.com/cocoindex-io/cocoindex ``` - Setup indexing flow - ```bash - cocoindex setup main.py + ```sh + cocoindex setup main ``` It is setup with a live updater, so you can add new files to the folder and it will be indexed within a minute. - Run backend - ```bash + ```sh uvicorn main:app --reload --host 0.0.0.0 --port 8000 ``` - Run frontend - ```bash + ```sh cd frontend npm install npm run dev @@ -306,7 +306,7 @@ Wait a minute for the new image to be processed and indexed. ![Search](/img/examples/image_search_clip/search3.png) -If you want to monitor the indexing progress, you can view it in CocoInsight `cocoindex server -ci main `. +If you want to monitor the indexing progress, you can view it in CocoInsight `cocoindex server -ci main`. ![Index Status In CocoInsight](/img/examples/image_search_clip/index-status.png) diff --git a/docs/docs/examples/examples/manual_extraction.md b/docs/docs/examples/examples/manual_extraction.md index 0d76bdc0e..55d8e8cde 100644 --- a/docs/docs/examples/examples/manual_extraction.md +++ b/docs/docs/examples/examples/manual_extraction.md @@ -225,14 +225,15 @@ modules_index.export( ## Query and test your index Run the following command to setup and update the index. + ```sh -cocoindex update -L main.py +cocoindex update -L main ``` You'll see the index updates state in the terminal After the index is built, you have a table with the name `modules_info`. You can query it at any time, e.g., start a Postgres shell: -```bash +```sh psql postgres://cocoindex:cocoindex@localhost/cocoindex ``` diff --git a/docs/docs/examples/examples/multi_format_index.md b/docs/docs/examples/examples/multi_format_index.md index 8880602f1..180141217 100644 --- a/docs/docs/examples/examples/multi_format_index.md +++ b/docs/docs/examples/examples/multi_format_index.md @@ -192,7 +192,6 @@ search_results = client.query_points( You can walk through the project step by step in [CocoInsight](https://www.youtube.com/watch?v=MMrpUfUcZPk) to see exactly how each field is constructed and what happens behind the scenes. - ```sh cocoindex server -ci main ``` diff --git a/docs/docs/examples/examples/patient_form_extraction.md b/docs/docs/examples/examples/patient_form_extraction.md index 6ae0a6f00..0675c3761 100644 --- a/docs/docs/examples/examples/patient_form_extraction.md +++ b/docs/docs/examples/examples/patient_form_extraction.md @@ -225,7 +225,7 @@ patients_index.export( ### Install dependencies - ```bash + ```sh pip install -e . ``` @@ -240,7 +240,7 @@ patients_index.export( After the index is built, you have a table with the name `patients_info`. You can query it at any time, e.g., start a Postgres shell: -```bash +```sh psql postgres://cocoindex:cocoindex@localhost/cocoindex ``` @@ -258,7 +258,7 @@ For mission-critical use cases, it is important to evaluate the quality of the e 1. Dump the extracted data to YAML files. - ```bash + ```sh python3 main.py cocoindex evaluate ``` @@ -269,7 +269,7 @@ For mission-critical use cases, it is important to evaluate the quality of the e You can run the following command to see the diff: - ```bash + ```sh diff -r data/eval_PatientIntakeExtraction_golden data/eval_PatientIntakeExtraction_output ``` @@ -290,7 +290,7 @@ We could troubleshoot in two steps: I also use CocoInsight to help me troubleshoot. -```bash +```sh cocoindex server -ci main ``` diff --git a/docs/docs/examples/examples/patient_form_extraction_baml.md b/docs/docs/examples/examples/patient_form_extraction_baml.md index db2070fc9..5fd3633b3 100644 --- a/docs/docs/examples/examples/patient_form_extraction_baml.md +++ b/docs/docs/examples/examples/patient_form_extraction_baml.md @@ -287,7 +287,7 @@ Exports the index to Postgres as the `patients` table, with automatic updates an **Generate BAML client code** (required step, in case you didn’t do it earlier. ) -```bash +```sh baml generate ``` @@ -295,15 +295,15 @@ This generates the `baml_client/` directory with Python code to call your BAML Update the index: -```bash +```sh cocoindex update main ``` **CocoInsight** -I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with zero pipeline data retention. +I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with zero pipeline data retention. -```bash +```sh cocoindex server -ci main ``` diff --git a/docs/docs/examples/examples/pdf_elements.md b/docs/docs/examples/examples/pdf_elements.md index 71c3c261a..9afa64873 100644 --- a/docs/docs/examples/examples/pdf_elements.md +++ b/docs/docs/examples/examples/pdf_elements.md @@ -49,7 +49,7 @@ This flow automatically: If you don’t have Qdrant running locally, start it via Docker: -```bash +```sh docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant ``` @@ -57,7 +57,7 @@ docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant We’ll use a few sample PDFs (board game manuals). Download them into the `source_files` directory: -```bash +```sh ./pdf_elements/fetch_manual_urls.sh ``` @@ -68,19 +68,19 @@ Or, feel free to drop in any of your own PDFs. Install dependencies: -```bash +```sh pip install -e . ``` Then build your index (sets up tables automatically on first run): -```bash +```sh cocoindex update --setup main ``` Or Run in CocoInsight -```bash +```sh cocoindex server -ci main ``` @@ -287,7 +287,7 @@ It connects locally with **zero data retention**. Start your local server: -```bash +```sh cocoindex server -ci main ``` diff --git a/docs/docs/examples/examples/product_recommendation.md b/docs/docs/examples/examples/product_recommendation.md index 60fec3a74..239e8b5ec 100644 --- a/docs/docs/examples/examples/product_recommendation.md +++ b/docs/docs/examples/examples/product_recommendation.md @@ -392,7 +392,7 @@ MATCH p=()-->() RETURN p I used CocoInsight to troubleshoot the index generation and understand the data lineage of the pipeline. It is in free beta now, you can give it a try. Run following command to start CocoInsight: -``` +```sh cocoindex server -ci main ``` diff --git a/docs/docs/examples/integrations/sqs.md b/docs/docs/examples/integrations/sqs.md index c6aea07b0..d37601f10 100644 --- a/docs/docs/examples/integrations/sqs.md +++ b/docs/docs/examples/integrations/sqs.md @@ -93,7 +93,7 @@ The flow diagram illustrates how we'll process our codebase: Define the AWS endpoint and the SQS queue name in `.env` file: -```bash +```sh # Database Configuration DATABASE_URL=postgresql://localhost:5432/cocoindex @@ -135,7 +135,7 @@ For the rest of the flow, we can follow the tutorial The entire project is available [here](https://github.com/cocoindex-io/cocoindex/tree/main/examples/amazon_s3_embedding). ## Run the flow with live update -```bash +```sh cocoindex update main.py -L ``` diff --git a/docs/docs/getting_started/installation.md b/docs/docs/getting_started/installation.md index c8025d693..355612b30 100644 --- a/docs/docs/getting_started/installation.md +++ b/docs/docs/getting_started/installation.md @@ -18,7 +18,7 @@ To follow the steps in this guide, you'll need: ## 🌴 Install CocoIndex -```bash +```sh pip install -U cocoindex ``` @@ -31,7 +31,7 @@ If you don't have a Postgres database: 1. Install [Docker Compose](https://docs.docker.com/compose/install/) 🐳. 2. Start a Postgres SQL database for cocoindex using our docker compose config: -```bash +```sh docker compose -f <(curl -L https://raw.githubusercontent.com/cocoindex-io/cocoindex/refs/heads/main/dev/postgres.yaml) up -d ``` diff --git a/docs/docs/getting_started/quickstart.md b/docs/docs/getting_started/quickstart.md index f523bd71b..c609c9f22 100644 --- a/docs/docs/getting_started/quickstart.md +++ b/docs/docs/getting_started/quickstart.md @@ -23,7 +23,7 @@ In this tutorial, we’ll build an index with text embeddings, keeping it minima 1. Install CocoIndex: - ```bash + ```sh pip install -U 'cocoindex[embeddings]' ``` @@ -31,7 +31,7 @@ In this tutorial, we’ll build an index with text embeddings, keeping it minima 3. Create a new directory for your project: - ```bash + ```sh mkdir cocoindex-quickstart cd cocoindex-quickstart ``` @@ -140,13 +140,13 @@ CocoIndex supports other vector databases as well, with 1-line switch. - Specify the database URL by environment variable: - ```bash + ```sh export COCOINDEX_DATABASE_URL="postgresql://cocoindex:cocoindex@localhost:5432/cocoindex" ``` - Build the index: - ```bash + ```sh cocoindex update main ``` diff --git a/docs/docs/http_server.mdx b/docs/docs/http_server.mdx index 6165c6018..5e3623187 100644 --- a/docs/docs/http_server.mdx +++ b/docs/docs/http_server.mdx @@ -14,7 +14,7 @@ Use the `cocoindex server` command. See more options in the [CLI](./core/cli). - Default bind address: **127.0.0.1:49344** (only exposed locally for safety) - Override if you need to expose to all IPs (example: `0.0.0.0:49344`) -```bash +```sh # Start on the default local address (127.0.0.1:49344) cocoindex server path/to/app.py diff --git a/docs/docs/ops/functions.md b/docs/docs/ops/functions.md index ce8e97464..221623be9 100644 --- a/docs/docs/ops/functions.md +++ b/docs/docs/ops/functions.md @@ -130,7 +130,7 @@ Currently, `SplitRecursively` supports the following languages: This function requires the 'sentence-transformers' library, which is an optional dependency. Install CocoIndex with: -```bash +```sh pip install 'cocoindex[embeddings]' ``` @@ -215,7 +215,7 @@ These models use late interaction between image patch embeddings and text token These functions require the `colpali-engine` library, which is an optional dependency. Install CocoIndex with: -```bash +```sh pip install 'cocoindex[colpali]' ``` diff --git a/docs/docs/sources/amazons3.md b/docs/docs/sources/amazons3.md index bda77297c..ea2e9d390 100644 --- a/docs/docs/sources/amazons3.md +++ b/docs/docs/sources/amazons3.md @@ -91,7 +91,7 @@ AWS's [Guide of Configuring a Bucket for Notifications](https://docs.aws.amazon. For MinIO setups that don't use AWS SQS, you can configure MinIO to publish event notifications to Redis: * Configure MinIO to publish events to Redis by setting environment variables: - ```bash + ```sh export MINIO_NOTIFY_REDIS_ENABLE="on" export MINIO_NOTIFY_REDIS_ADDRESS="redis-endpoint.example.net:6379" export MINIO_NOTIFY_REDIS_KEY="bucketevents" @@ -100,7 +100,7 @@ For MinIO setups that don't use AWS SQS, you can configure MinIO to publish even Replace the values with your Redis server details. * Alternatively, use the `mc` command-line tool: - ```bash + ```sh mc alias set myminio http://minio.example.com:9000 ACCESSKEY SECRETKEY mc admin config set myminio/ notify_redis \ address="redis-endpoint.example.net:6379" \ diff --git a/docs/docs/targets/kuzu.md b/docs/docs/targets/kuzu.md index dc7410638..6a7abb1b8 100644 --- a/docs/docs/targets/kuzu.md +++ b/docs/docs/targets/kuzu.md @@ -36,7 +36,7 @@ Kuzu also provides a declaration spec `KuzuDeclaration`, to configure indexing o If you don't have a Kuzu instance yet, you can bring up a Kuzu API server locally by running: -```bash +```sh KUZU_DB_DIR=$HOME/.kuzudb KUZU_PORT=8123 docker run -d --name kuzu -p ${KUZU_PORT}:8000 -v ${KUZU_DB_DIR}:/database kuzudb/api-server:latest @@ -47,7 +47,7 @@ Currently Kuzu API server and the explorer cannot be up at the same time. So you To start the instance of the explorer, run: -```bash +```sh KUZU_EXPLORER_PORT=8124 docker run -d --name kuzu-explorer -p ${KUZU_EXPLORER_PORT}:8000 -v ${KUZU_DB_DIR}:/database -e MODE=READ_ONLY kuzudb/explorer:latest ``` diff --git a/docs/docs/targets/neo4j.md b/docs/docs/targets/neo4j.md index 5e4fdb22c..8b080a472 100644 --- a/docs/docs/targets/neo4j.md +++ b/docs/docs/targets/neo4j.md @@ -37,7 +37,7 @@ Neo4j also provides a declaration spec `Neo4jDeclaration`, to configure indexing If you don't have a Neo4j database, you can start a Neo4j database using our docker compose config: -```bash +```sh docker compose -f <(curl -L https://raw.githubusercontent.com/cocoindex-io/cocoindex/refs/heads/main/dev/neo4j.yaml) up -d ``` diff --git a/docs/docs/tutorials/live_updates.md b/docs/docs/tutorials/live_updates.md index ffa320e55..cdc954266 100644 --- a/docs/docs/tutorials/live_updates.md +++ b/docs/docs/tutorials/live_updates.md @@ -42,7 +42,7 @@ You can enable live updates using either the CocoIndex CLI or the Python library To start a live update process from the command line, use the `update` command with the `-L` or `--live` flag: -```bash +```sh cocoindex update -L your_flow_definition_file.py ``` diff --git a/examples/amazon_s3_embedding/README.md b/examples/amazon_s3_embedding/README.md index 4224498d0..e768c2ab1 100644 --- a/examples/amazon_s3_embedding/README.md +++ b/examples/amazon_s3_embedding/README.md @@ -14,7 +14,7 @@ Before running the example, you need to: 3. Create a `.env` file with your Amazon S3 bucket name and (optionally) prefix. Start from copying the `.env.example`, and then edit it to fill in your bucket name and prefix. - ```bash + ```sh cp .env.example .env $EDITOR .env ``` @@ -59,7 +59,7 @@ cocoindex server -ci main You can also add a `-L` flag to make the server keep updating the index to reflect source changes at the same time: ```sh -cocoindex server -ci -L main +cocoindex update -L main ``` Then open the CocoInsight UI at [https://cocoindex.io/cocoinsight](https://cocoindex.io/cocoinsight). diff --git a/examples/azure_blob_embedding/README.md b/examples/azure_blob_embedding/README.md index 582b1b088..83976c255 100644 --- a/examples/azure_blob_embedding/README.md +++ b/examples/azure_blob_embedding/README.md @@ -14,7 +14,7 @@ Before running the example, you need to: 3. Create a `.env` file with your Azure Blob Storage container name and (optionally) prefix. Start from copying the `.env.example`, and then edit it to fill in your bucket name and prefix. - ```bash + ```sh cp .env.example .env $EDITOR .env ``` @@ -59,7 +59,7 @@ cocoindex server -ci main You can also add a `-L` flag to make the server keep updating the index to reflect source changes at the same time: ```sh -cocoindex server -ci -L main +cocoindex server -ci main ``` Then open the CocoInsight UI at [https://cocoindex.io/cocoinsight](https://cocoindex.io/cocoinsight). diff --git a/examples/code_embedding/README.md b/examples/code_embedding/README.md index 0d5afb136..d8943c4f7 100644 --- a/examples/code_embedding/README.md +++ b/examples/code_embedding/README.md @@ -39,19 +39,19 @@ We will match against user-provided text by a SQL query, reusing the embedding o - Install dependencies: - ```bash + ```sh pip install -e . ``` - Update index: - ```bash + ```sh cocoindex update main ``` - Run: - ```bash + ```sh python main.py ``` diff --git a/examples/custom_output_files/README.md b/examples/custom_output_files/README.md index a2a4520a4..2bb8ed151 100644 --- a/examples/custom_output_files/README.md +++ b/examples/custom_output_files/README.md @@ -22,13 +22,13 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c Install dependencies: -```bash +```sh pip install -e . ``` Update the target: -```bash +```sh cocoindex update main ``` @@ -37,8 +37,8 @@ Each time when you run the `update` command, cocoindex will only re-process the You can also run `update` command in live mode, which will keep the target in sync with the source in real-time: -```bash -cocoindex update -L main.py +```sh +cocoindex update -L main ``` ## CocoInsight diff --git a/examples/custom_source_hn/README.md b/examples/custom_source_hn/README.md index ddc3131d6..a7cdb6f12 100644 --- a/examples/custom_source_hn/README.md +++ b/examples/custom_source_hn/README.md @@ -22,13 +22,13 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c Install dependencies: -```bash +```sh pip install -e . ``` Update the target: -```bash +```sh cocoindex update main ``` @@ -36,8 +36,8 @@ Each time when you run the `update` command, cocoindex will only re-process thre You can also run `update` command in live mode, which will keep the target in sync with the source continuously: -```bash -cocoindex update -L main.py +```sh +cocoindex update -L main ``` ## CocoInsight @@ -45,8 +45,8 @@ cocoindex update -L main.py I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight: -``` -cocoindex server -ci -L main +```sh +cocoindex server -ci main ``` Then open the CocoInsight UI at [https://cocoindex.io/cocoinsight](https://cocoindex.io/cocoinsight). diff --git a/examples/docs_to_knowledge_graph/README.md b/examples/docs_to_knowledge_graph/README.md index 2d3edb594..46c2731fe 100644 --- a/examples/docs_to_knowledge_graph/README.md +++ b/examples/docs_to_knowledge_graph/README.md @@ -28,13 +28,13 @@ You can read the official CocoIndex Documentation for Property Graph Targets [he Install dependencies: -```bash +```sh pip install -e . ``` Update index: -```bash +```sh cocoindex update main ``` @@ -56,7 +56,7 @@ MATCH p=()-->() RETURN p I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight: -```bash +```sh cocoindex server -ci main ``` diff --git a/examples/face_recognition/README.md b/examples/face_recognition/README.md index c71c3d768..4d19da655 100644 --- a/examples/face_recognition/README.md +++ b/examples/face_recognition/README.md @@ -23,13 +23,13 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c 2. Install Qdrant - ```bash + ```sh docker run -d -p 6334:6334 -p 6333:6333 qdrant/qdrant ``` 3. Install dependencies: - ```bash + ```sh pip install -e . ``` @@ -37,14 +37,14 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c Update index, which will also setup the tables at the first time: -```bash +```sh cocoindex update main ``` You can also run the command with `-L`, which will watch for file changes and update the index automatically. -```bash -cocoindex update -L main.py +```sh +cocoindex update -L main ``` ## CocoInsight diff --git a/examples/fastapi_server_docker/README.md b/examples/fastapi_server_docker/README.md index 63a787bc7..e91567433 100644 --- a/examples/fastapi_server_docker/README.md +++ b/examples/fastapi_server_docker/README.md @@ -16,25 +16,25 @@ COCOINDEX_DATABASE_URL=postgres://cocoindex:cocoindex@localhost/cocoindex - Install dependencies: - ```bash + ```sh pip install -e . ``` - Update index: - ```bash + ```sh cocoindex update main ``` - Run: - ```bash + ```sh uvicorn main:fastapi_app --reload --host 0.0.0.0 --port 8000 ``` ## Query the endpoint - ```bash + ```sh curl "http://localhost:8000/search?q=model&limit=3" ``` @@ -48,12 +48,12 @@ COCOINDEX_DATABASE_URL=postgres://cocoindex:cocoindex@coco_db:5436/cocoindex Build the docker container via: -```bash +```sh docker compose up --build ``` Test the endpoint: -```bash +```sh curl "http://0.0.0.0:8080/search?q=model&limit=3" ``` diff --git a/examples/gdrive_text_embedding/README.md b/examples/gdrive_text_embedding/README.md index 55bac06d8..47150e526 100644 --- a/examples/gdrive_text_embedding/README.md +++ b/examples/gdrive_text_embedding/README.md @@ -35,7 +35,7 @@ Before running the example, you need to: 3. Create `.env` file with your credential file and folder IDs. Starting from copying the `.env.example`, and then edit it to fill in your credential file path and folder IDs. - ```bash + ```sh cp .env.exmaple .env $EDITOR .env ``` @@ -75,7 +75,7 @@ cocoindex server -ci main You can also add a `-L` flag to make the server keep updating the index to reflect source changes at the same time: ```sh -cocoindex server -ci -L main +cocoindex server -ci main ``` Then open the CocoInsight UI at [https://cocoindex.io/cocoinsight](https://cocoindex.io/cocoinsight). diff --git a/examples/hn_trending_topics/README.md b/examples/hn_trending_topics/README.md index 02bebc7c8..39c6db2d7 100644 --- a/examples/hn_trending_topics/README.md +++ b/examples/hn_trending_topics/README.md @@ -36,13 +36,13 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c Install dependencies: -```bash +```sh pip install -e . ``` Update the target: -```bash +```sh cocoindex update main ``` @@ -50,7 +50,7 @@ Each time when you run the `update` command, cocoindex will only re-process thre You can also run `update` command in live mode, which will keep the target in sync with the source continuously: -```bash +```sh cocoindex update -L main.py ``` @@ -58,7 +58,7 @@ cocoindex update -L main.py After running the pipeline, you can query the extracted topics: -```bash +```sh # Get trending topics cocoindex query main.py get_trending_topics --limit 20 diff --git a/examples/live_updates/README.md b/examples/live_updates/README.md index 0977043e8..8963f8b9f 100644 --- a/examples/live_updates/README.md +++ b/examples/live_updates/README.md @@ -21,7 +21,7 @@ The script then starts a `FlowLiveUpdater`, which runs in the background and con 2. **Install the dependencies:** - ```bash + ```sh pip install -e . ``` @@ -33,7 +33,7 @@ The script then starts a `FlowLiveUpdater`, which runs in the background and con This method uses CocoIndex [Library API](https://cocoindex.io/docs/core/flow_methods#library-api-2) to perform live updates. - ```bash + ```sh python main.py ``` @@ -41,7 +41,7 @@ The script then starts a `FlowLiveUpdater`, which runs in the background and con This method is useful for managing your indexes from the command line, through CocoIndex [CLI](https://cocoindex.io/docs/core/flow_methods#cli-2). - ```bash + ```sh cocoindex update main -L --setup ``` @@ -53,6 +53,6 @@ The script then starts a `FlowLiveUpdater`, which runs in the background and con To remove the database table created by this example, you can run: -```bash -cocoindex drop main.py +```sh +cocoindex drop main ``` diff --git a/examples/manuals_llm_extraction/README.md b/examples/manuals_llm_extraction/README.md index 206e78651..e84854b1c 100644 --- a/examples/manuals_llm_extraction/README.md +++ b/examples/manuals_llm_extraction/README.md @@ -23,13 +23,13 @@ Before running the example, you need to: Install dependencies: -```bash +```sh pip install -e . ``` Update index: -```bash +```sh cocoindex update main ``` @@ -37,7 +37,7 @@ cocoindex update main After index is build, you have a table with name `modules_info`. You can query it any time, e.g. start a Postgres shell: -```bash +```sh psql postgres://cocoindex:cocoindex@localhost/cocoindex ``` diff --git a/examples/meeting_notes_graph/README.md b/examples/meeting_notes_graph/README.md index 07b985eb6..0bc5503c9 100644 --- a/examples/meeting_notes_graph/README.md +++ b/examples/meeting_notes_graph/README.md @@ -61,13 +61,13 @@ Notes: Install dependencies: -```bash +```sh pip install -e . ``` Update the index (run the flow once to build/update the graph): -```bash +```sh cocoindex update main ``` @@ -100,7 +100,7 @@ I used CocoInsight (Free beta now) to troubleshoot the index generation and unde Start CocoInsight: -```bash +```sh cocoindex server -ci main ``` diff --git a/examples/multi_format_indexing/README.md b/examples/multi_format_indexing/README.md index 833378175..14372940f 100644 --- a/examples/multi_format_indexing/README.md +++ b/examples/multi_format_indexing/README.md @@ -27,7 +27,7 @@ We will match against user-provided natural language text using ColPali's text-t You can start Qdrant with Docker: -```bash +```sh docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant ``` @@ -35,7 +35,7 @@ docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant Install dependencies: -```bash +```sh pip install -e . ``` @@ -43,13 +43,13 @@ pip install -e . Update index: -```bash +```sh cocoindex update main ``` Run: -```bash +```sh python main.py ``` diff --git a/examples/paper_metadata/README.md b/examples/paper_metadata/README.md index e804c8ece..236865771 100644 --- a/examples/paper_metadata/README.md +++ b/examples/paper_metadata/README.md @@ -31,7 +31,7 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c 2. Install dependencies: - ```bash + ```sh pip install -e . ``` @@ -41,13 +41,13 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c Update index, which will also setup the tables at the first time: -```bash +```sh cocoindex update main ``` You can also run the command with `-L`, which will watch for file changes and update the index automatically. -```bash +```sh cocoindex update -L main ``` diff --git a/examples/patient_intake_extraction/README.md b/examples/patient_intake_extraction/README.md index 6da59a2c9..aef495677 100644 --- a/examples/patient_intake_extraction/README.md +++ b/examples/patient_intake_extraction/README.md @@ -19,13 +19,13 @@ CocoIndex supports multiple [sources](https://cocoindex.io/docs/sources) and [LL 2. Install CocoIndex - ```bash + ```sh pip install -U cocoindex ``` 3. Install MarkItDown - ```bash + ```sh pip install 'markitdown[all]' ``` @@ -35,19 +35,19 @@ CocoIndex supports multiple [sources](https://cocoindex.io/docs/sources) and [LL Update index: -```bash +```sh cocoindex update main ``` Run query: -```bash +```sh python main.py ``` Run with CocoInsight: -```bash +```sh cocoindex server -ci main ``` diff --git a/examples/pdf_elements_embedding/README.md b/examples/pdf_elements_embedding/README.md index 79564d8dd..7c4cf078c 100644 --- a/examples/pdf_elements_embedding/README.md +++ b/examples/pdf_elements_embedding/README.md @@ -30,7 +30,7 @@ We appreciate a star ⭐ at [CocoIndex Github](https://github.com/cocoindex-io/c Start Qdrant with Docker (exposes HTTP 6333 and gRPC 6334): -```bash +```sh docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant ``` @@ -40,7 +40,7 @@ Note: This example connects via gRPC at `http://localhost:6334`. Download a few sample PDFs (all are board game manuals) and put them into the `source_files` directory by running: -```bash +```sh ./fetch_manual_urls.sh ``` @@ -50,13 +50,13 @@ You can also put your favorite PDFs into the `source_files` directory. Install dependencies: -```bash +```sh pip install -e . ``` Update index, which will also setup the tables at the first time: -```bash +```sh cocoindex update main ``` @@ -64,7 +64,7 @@ cocoindex update main I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight: -```bash +```sh cocoindex server -ci main ``` diff --git a/examples/pdf_embedding/README.md b/examples/pdf_embedding/README.md index 249a66208..dd195649d 100644 --- a/examples/pdf_embedding/README.md +++ b/examples/pdf_embedding/README.md @@ -30,19 +30,19 @@ We will match against user-provided text by a SQL query, and reuse the embedding Install dependencies: -```bash +```sh pip install -e . ``` Update index: -```bash +```sh cocoindex update main ``` Run: -```bash +```sh python main.py ``` diff --git a/examples/postgres_source/README.md b/examples/postgres_source/README.md index d1d67def8..6a52782d0 100644 --- a/examples/postgres_source/README.md +++ b/examples/postgres_source/README.md @@ -17,7 +17,7 @@ Before running the example, you need to: 1. Install dependencies: - ```bash + ```sh pip install -e . ``` @@ -25,7 +25,7 @@ Before running the example, you need to: 3. Create source table `source_products` with sample data: - ```bash + ```sh psql "postgres://cocoindex:cocoindex@localhost/cocoindex" -f ./prepare_source_data.sql ``` @@ -36,7 +36,7 @@ Before running the example, you need to: Update index, which will also setup the tables at the first time: -```bash +```sh cocoindex update main ``` @@ -53,7 +53,7 @@ cocoindex server -ci main You can also add a `-L` flag to make the server keep updating the index to reflect source changes at the same time: ```sh -cocoindex server -ci -L main +cocoindex server -ci main ``` Then open the CocoInsight UI at [https://cocoindex.io/cocoinsight](https://cocoindex.io/cocoinsight). diff --git a/examples/product_recommendation/README.md b/examples/product_recommendation/README.md index 5b2c2a563..dd82893fd 100644 --- a/examples/product_recommendation/README.md +++ b/examples/product_recommendation/README.md @@ -22,13 +22,13 @@ You can read the official CocoIndex Documentation for Property Graph Targets [he Install dependencies: -```bash +```sh pip install -e . ``` Update index: -```bash +```sh cocoindex update main ``` @@ -51,7 +51,7 @@ MATCH p=()-->() RETURN p I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight: -```bash +```sh cocoindex server -ci main ``` diff --git a/examples/text_embedding/README.md b/examples/text_embedding/README.md index e2fb37bd8..1967810e2 100644 --- a/examples/text_embedding/README.md +++ b/examples/text_embedding/README.md @@ -31,19 +31,19 @@ We will match against user-provided text by a SQL query, and reuse the embedding Install dependencies: -```bash +```sh pip install -e . ``` Update index: -```bash +```sh cocoindex update main ``` Run: -```bash +```sh python main.py ``` diff --git a/examples/text_embedding_lancedb/README.md b/examples/text_embedding_lancedb/README.md index 9b3f7dce0..44313636e 100644 --- a/examples/text_embedding_lancedb/README.md +++ b/examples/text_embedding_lancedb/README.md @@ -36,13 +36,13 @@ LanceDB will automatically create a local database directory when you run the ex Update index, which will also setup LanceDB tables at the first time: -```bash +```sh cocoindex update main ``` You can also run the command with `-L`, which will watch for file changes and update the index automatically. -```bash +```sh cocoindex update -L main ``` @@ -51,8 +51,8 @@ cocoindex update -L main I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight: -```bash -cocoindex server -ci -L main +```sh +cocoindex server -ci main ``` Open the CocoInsight UI at [https://cocoindex.io/cocoinsight](https://cocoindex.io/cocoinsight). diff --git a/examples/text_embedding_qdrant/README.md b/examples/text_embedding_qdrant/README.md index abd6d6be1..5cbbad085 100644 --- a/examples/text_embedding_qdrant/README.md +++ b/examples/text_embedding_qdrant/README.md @@ -28,7 +28,7 @@ We use Qdrant client to query the index, and reuse the embedding operation in th - Run Qdrant. - ```bash + ```sh docker run -d -p 6334:6334 -p 6333:6333 qdrant/qdrant ``` @@ -36,13 +36,13 @@ We use Qdrant client to query the index, and reuse the embedding operation in th - Install dependencies: - ```bash + ```sh pip install -e . ``` - Update index: - ```bash + ```sh cocoindex update main ``` @@ -51,7 +51,7 @@ We use Qdrant client to query the index, and reuse the embedding operation in th - Run: - ```bash + ```sh python main.py ``` @@ -60,7 +60,7 @@ We use Qdrant client to query the index, and reuse the embedding operation in th I used CocoInsight (Free beta now) to troubleshoot the index generation and understand the data lineage of the pipeline. It just connects to your local CocoIndex server, with Zero pipeline data retention. Run following command to start CocoInsight: -```bash +```sh cocoindex server -ci main ```